You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
768e930779
a part of #7020 ```txt goos: windows goarch: amd64 pkg: go.opentelemetry.io/otel/exporters/stdout/stdoutlog/internal/observ cpu: Intel(R) Core(TM) i7-14700 │ result.txt │ │ sec/op │ InstrumentationExportLogs/NoError-28 47.68n ± 5% InstrumentationExportLogs/PartialError-28 471.6n ± 2% InstrumentationExportLogs/FullError-28 471.9n ± 10% geomean 219.7n │ result.txt │ │ B/op │ InstrumentationExportLogs/NoError-28 0.000 ± 0% InstrumentationExportLogs/PartialError-28 305.0 ± 0% InstrumentationExportLogs/FullError-28 305.0 ± 0% geomean ¹ ¹ summaries must be >0 to compute geomean │ result.txt │ │ allocs/op │ InstrumentationExportLogs/NoError-28 0.000 ± 0% InstrumentationExportLogs/PartialError-28 4.000 ± 0% InstrumentationExportLogs/FullError-28 4.000 ± 0% geomean ¹ ¹ summaries must be >0 to compute geomean ``` --------- Co-authored-by: Damien Mathieu <42@dmathieu.com>
22 lines
636 B
Go
22 lines
636 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package x
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestObservability(t *testing.T) {
|
|
const key = "OTEL_GO_X_OBSERVABILITY"
|
|
require.Contains(t, Observability.Keys(), key)
|
|
|
|
t.Run("100", run(setenv(key, "100"), assertDisabled(Observability)))
|
|
t.Run("true", run(setenv(key, "true"), assertEnabled(Observability, "true")))
|
|
t.Run("True", run(setenv(key, "True"), assertEnabled(Observability, "True")))
|
|
t.Run("false", run(setenv(key, "false"), assertDisabled(Observability)))
|
|
t.Run("empty", run(assertDisabled(Observability)))
|
|
}
|