open-telemetry / opentelemetry-erlang-api

Erlang/Elixir OpenTelemetry API
Apache License 2.0
60 stars 13 forks source link

opentelemetry metrics API #7

Closed tsloughter closed 4 years ago

tsloughter commented 4 years ago

This patch includes a behaviour for implementing the Meter SDK and API modules for calling the meter for creating and recording measurements.


Implements https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/api-metrics-user.md

I did it a couple weeks ago but never pushed so I don't recall right now if anything was left out. All the fun is in the SDK so I think this (the API) is close to complete.

arkgil commented 4 years ago

One more thing - I saw the spec mentioning the name of the meter: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/api-metrics-user.md#metric-names, but I don't see it here in the code. How do you plan to handle that?

tsloughter commented 4 years ago

@arkgil I haven't added named meters yet. But it'll just be part of the Meter tuple that opentelemetry:get_meter returns.

tsloughter commented 4 years ago

I've added Meter registration per-application https://github.com/open-telemetry/opentelemetry-erlang-api/pull/7/commits/e8caab1f58d576a740cbd8e4ed58ceb6d9ec771e

The observer API https://github.com/open-telemetry/opentelemetry-erlang-api/pull/7/commits/40108d33c369fa2acb87763cab65bf2e6184e943

And expanded the Elixir API https://github.com/open-telemetry/opentelemetry-erlang-api/pull/7/commits/d56c544a0b7ce2eafffa178be430a3ac25aee94d

tsloughter commented 4 years ago

I did some simplifications based on things removed for the time being in the spec.

tsloughter commented 4 years ago

Note some of the api may seem superfluous but should allow for optimizations of the code paths in the future when we know we are dealing with a counter or measure.