Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics SDK collector support: support "transient descriptors" #1220

Closed
jmacd opened this issue Oct 1, 2020 · 2 comments
Closed

Metrics SDK collector support: support "transient descriptors" #1220

jmacd opened this issue Oct 1, 2020 · 2 comments
Labels
area:metrics Part of OpenTelemetry Metrics

Comments

@jmacd
Copy link
Contributor

jmacd commented Oct 1, 2020

There is a change I would like to submit for the Metrics SDK that does not directly address any SDK or API-level specification. What it will do is enable us to use the OTel-Go metrics SDK as part of an OTel-Collector processing pipeline.

The problem being solved is that the SDK expects each instrument used by the API to be registered once, statically. It expects that each instrument will have a unique registration, too. To use the SDK in a different context, where it is possible that multiple descriptors for the same name exist and where instruments are not long lived, requires support for "transient descriptors".

I have prototyped this code here:

jmacd#59

This re-uses the "refcount_mapped.go" support use to manage synchronous records for managing instruments. This code allows the OTel-Go SDK to be used in an environment where multiple descriptors with the same-name exist, and it will avoid leaking memory over time as these descriptors come and go. This also allows the OTel-Go SDK to be re-used as the implementation for other metric APIs with different instrument-lifecycle requirements than OTel, e.g., statsd libraries that do not require instrument registration.

@jmacd jmacd added the area:metrics Part of OpenTelemetry Metrics label Oct 1, 2020
@jmacd
Copy link
Contributor Author

jmacd commented Oct 1, 2020

@MrAlias
Copy link
Contributor

MrAlias commented Oct 6, 2020

@jmacd should we tag this with required-for-ga?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics
Projects
None yet
Development

No branches or pull requests

2 participants