1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-05 00:28:58 +02:00

[API EPIC 4/4] Fix tests and examples (#2587)

* Empty All of the metrics dir

* Add instrument api with documentation

* Add a NoOp implementation.

* Updated to the new config standard

* Address PR comments

* This change moves components to sdk/metrics

The Moved components are:
- metric/metrictest
- metric/number
- metric/internal/registry
- metric/sdkapi

* The SDK changes necessary to satasify the new api

* This fixes the remaing tests.

* Update changelog

* refactor the Noop meter and instruments into one package.

* Renamed pkg.Instruments to pkg.InstrumentProvider

Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
This commit is contained in:
Aaron Clawson
2022-03-02 09:50:29 -06:00
committed by GitHub
parent b66c902777
commit 18f4cb85ec
102 changed files with 1721 additions and 4404 deletions

View File

@ -23,7 +23,6 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
"go.opentelemetry.io/otel/sdk/metric/controller/controllertest"
"go.opentelemetry.io/otel/sdk/metric/export/aggregation"
@ -45,7 +44,8 @@ func TestPullNoCollect(t *testing.T) {
ctx := context.Background()
meter := puller.Meter("nocache")
counter := metric.Must(meter).NewInt64Counter("counter.sum")
counter, err := meter.SyncInt64().Counter("counter.sum")
require.NoError(t, err)
counter.Add(ctx, 10, attribute.String("A", "B"))
@ -83,7 +83,8 @@ func TestPullWithCollect(t *testing.T) {
ctx := context.Background()
meter := puller.Meter("nocache")
counter := metric.Must(meter).NewInt64Counter("counter.sum")
counter, err := meter.SyncInt64().Counter("counter.sum")
require.NoError(t, err)
counter.Add(ctx, 10, attribute.String("A", "B"))