1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-29 23:07:45 +02:00

Add the synchronous gauge to the metric API and SDK (#5304)

Resolve #5225 

The specification has [added a synchronous gauge
instrument](https://github.com/open-telemetry/opentelemetry-specification/pull/3540).
That instrument has now been
[stabilized](https://github.com/open-telemetry/opentelemetry-specification/pull/4019),
and that stabilization is included in the [next
release](https://github.com/open-telemetry/opentelemetry-specification/pull/4034).

This adds the new synchronous gauge instrument to the metric API and all
implementation we publish.

This change will be a breaking change for any SDK developer. The
`embedded` package is updated to ensure our compatibility guarantees are
meet.

---------

Co-authored-by: David Ashpole <dashpole@google.com>
This commit is contained in:
Tyler Yahn
2024-05-16 09:56:40 -07:00
committed by GitHub
parent 166b3473dd
commit dafe137bbe
24 changed files with 416 additions and 12 deletions

View File

@@ -25,7 +25,12 @@ func BenchmarkInstrument(b *testing.B) {
build := aggregate.Builder[int64]{}
var meas []aggregate.Measure[int64]
in, _ := build.PrecomputedLastValue()
build.Temporality = metricdata.CumulativeTemporality
in, _ := build.LastValue()
meas = append(meas, in)
build.Temporality = metricdata.DeltaTemporality
in, _ = build.LastValue()
meas = append(meas, in)
build.Temporality = metricdata.CumulativeTemporality