Closed rschmukler closed 6 months ago
observe
may return either a single measurement (a map) or a sequence of measurements (a sequence of maps). In your example, I suggest returning both measurements as a vector:
(defn read-temperatures []
(let [core-temp (get-core-temp)
exterior-temp (get-exterior-temp)]
[{:value core-temp
:attributes {:location :reactor-core}}
{:value exterior-temp
:attributes {:location :exterior}}]))
@rschmukler Looking a bit deeper into synchronous gauge support in OpenTelemetry Java, I see they are still in the incubator stage of the API. To date, clj-otel-api
has the bare minimum of OpenTelemetry Java dependencies and is focussed on the stable parts of the API. Therefore, the opentelemetry-extension-incubator
dependency is not likely to be added. Thank you for highlighting synchronous gauges (I had forgotten they are coming!) and please be assured I will add support when they come out of incubation.
Awesome! Thank you for the reply. I didn't know that multiple measurements could be returned. I will submit a PR to the guide highlighting this. Looking forward to sync gauges stabilizing. Thanks again for your work on this library, it has been great to use!
Hey! Thank you for your work on the library. I am trying to use a gauge and having some trouble navigating the API.
1) It doesn't look like there's a synchronous version of the API yet. Is this something that you would be open to a PR adding support for?
2) If an async gauge has different attributes, what is the best way for the polling function function to submit multiple readings for the different attributes. eg. Imagine in your
:location :reactor-core
example we also wanted to submit a reading for:location :exterior
- What would be the best way to do so?