opentelemetry-js
opentelemetry-js copied to clipboard
[sdk-metrics] implement metrics exemplars
Description
[!IMPORTANT] This is a large feature that is not suitable for beginners. Please make sure to sync with @open-telemetry/javascript-approvers first to ensure that there is bandwidth to review your work on this feature. It is recommended that the assignee joins the OpenTelemetry JavaScript SIG Meeting on Wednesdays to discuss any questions.
Prerequisite knowledge:
@opentelemetry/sdk-metricsinternals- Knowlege about trace context and context management in OTel JS
Exemplars are a stable specification feature (see specification) that has a bootstrapped implementation in @opentelemetry/sdk-metrics which has never been driven to completion.
The goal of this issue is to implement this feature according to the specification and expose it to the user as an experimental feature. The assignee may have to remove and adapt the existing code to ensure that it follows all our requirements as laid out on this issue.
This issue is considered done when
- [ ] the exemplars feature is implemented according to the current specification
- [ ] a mechanism to collect and export exemplars is implemented
- [ ] documentation is updated to include information about metrics exemplars and how to use them
- [ ] serialization logic in
@opentelemetry/otlp-transformeris amended in a way so thatExemplars may be exported using the existing OTLP/protobuf, OTLP/json and OTLP/grpc exporters - [ ] follow-up issues have been created to stabilize the feature after a suitable time-frame
Additonal Requirements
- only interfaces and (factory)-functions as may be exposed as new APIs on
@opentelemetry/sdk-metrics - all new interfaces and functions MUST be marked as
@experimental - any properties added to the existing the public API of
@opentelemetry/sdk-metricsMUST be optional and marked as@experimental
Additional Information/Resources
- it is recommended to first look at other language implementations of this feature before starting to work on it here
- Relevant Specification
- Bootstrapped and outdated implementation in
@opentelemetry/sdk-metrics