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

Define reentrant safety of JavaScript Metrics API callbacks #2782

Closed
1 task done
legendecas opened this issue Feb 11, 2022 · 1 comment · Fixed by #2822
Closed
1 task done

Define reentrant safety of JavaScript Metrics API callbacks #2782

legendecas opened this issue Feb 11, 2022 · 1 comment · Fixed by #2822

Comments

@legendecas
Copy link
Member

  • This only affects the JavaScript OpenTelemetry library

As https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#asynchronous-counter-creation states:

OpenTelemetry API authors SHOULD define whether this callback function needs to be reentrant safe / thread safe or not.

We should define the reentrant safety of JavaScript Metrics API callbacks.

@legendecas
Copy link
Member Author

The spec has updated to define that:

Callback functions MUST be documented as follows for the end user:

  • Callback functions SHOULD be reentrant safe. The SDK expects to evaluate callbacks for each MetricReader independently.
  • Callback functions SHOULD NOT take an indefinite amount of time.
  • Callback functions SHOULD NOT make duplicate observations (more than one Measurement with the same attributes) across all registered callbacks.

We should follow the latest definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant