Commit ca7e892
Stabilize Enabled API for synchronous instruments (#4746)
Fixes
#4215
Current implementation status:
| Language | Status | Where it is / code reference |
| ----------------- | ---------------------- |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
| **Go** | **Yes (experimental)** | Implemented on synchronous
instruments in the SDK’s experimental `x` package: “Instrument
**Enabled** synchronous instruments provide an **Enabled** method.” See
the Go package docs. ([1]) |
| **.NET** | **Yes (in BCL)** | Use
**`System.Diagnostics.Metrics.Instrument.Enabled`**: “Gets a value that
indicates if there are any listeners for this instrument.” This is the
.NET runtime Metrics API that OpenTelemetry .NET uses. ([2]) |
| **Java** | **Yes (incubator)** | Implemented on synchronous
instruments in the incubator API. ([3]) |
| **JavaScript** | **No** | |
| **Python** | **No** | |
| **C++** | **No** | |
| **Rust** | **No** | |
| **Ruby** | **No** | |
| **PHP** | **No** | |
| **Swift** | **No** | |
| **Erlang/Elixir** | **No** | |
[1]: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric/internal/x
"go.opentelemetry.io/otel/sdk/metric/internal/x - Go Packages"
[2]:
https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.instrument.enabled?view=net-9.0
"Instrument.Enabled Property (System.Diagnostics.Metrics)"
[3]:
https://github.com/open-telemetry/opentelemetry-java/tree/main/api/incubator/src/main/java/io/opentelemetry/api/incubator/metrics
Note that @open-telemetry/collector-maintainers would benefit from
making it stable and would not have to do things like
https://github.com/open-telemetry/opentelemetry-collector/blob/2e9c82787618ea7da3fada176abb45b5a30714bf/service/internal/obsconsumer/enabled.go.
---------
Co-authored-by: Carlos Alberto Cortez <[email protected]>1 parent fdaa149 commit ca7e892
2 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
| 475 | + | |
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
482 | | - | |
483 | 481 | | |
484 | | - | |
| 482 | + | |
485 | 483 | | |
486 | 484 | | |
487 | 485 | | |
| |||
0 commit comments