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

Rename Self-Observability as just Observability (#7302)

Self-Observability is a redundant term, the self being instrumented is
always the self that observability is being provided for. Remove this
redundancy.

Continue to provide backwards compatibility for any users already using
`OTEL_GO_X_SELF_OBSERVABILITY` to enable the feature.

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
Tyler Yahn
2025-09-11 01:01:19 -07:00
committed by GitHub
parent b06d2739a7
commit 7fdebbe3ed
25 changed files with 219 additions and 182 deletions

View File

@@ -401,18 +401,18 @@ func TestTracerProviderReturnsSameTracer(t *testing.T) {
assert.Same(t, t2, t5)
}
func TestTracerProviderSelfObservability(t *testing.T) {
func TestTracerProviderObservability(t *testing.T) {
handler.Reset()
p := NewTracerProvider()
// Enable self-observability
t.Setenv("OTEL_GO_X_SELF_OBSERVABILITY", "true")
// Enable observability
t.Setenv("OTEL_GO_X_OBSERVABILITY", "true")
tr := p.Tracer("test-tracer")
require.IsType(t, &tracer{}, tr)
tStruct := tr.(*tracer)
assert.True(t, tStruct.selfObservabilityEnabled, "Self-observability should be enabled")
assert.True(t, tStruct.observabilityEnabled, "observability should be enabled")
// Verify instruments are created
assert.NotNil(t, tStruct.spanLiveMetric, "spanLiveMetric should be created")
@@ -423,7 +423,7 @@ func TestTracerProviderSelfObservability(t *testing.T) {
assert.Empty(t, handlerErrs, "No errors should occur during instrument creation")
}
func TestTracerProviderSelfObservabilityErrorsHandled(t *testing.T) {
func TestTracerProviderObservabilityErrorsHandled(t *testing.T) {
handler.Reset()
orig := otel.GetMeterProvider()
@@ -432,8 +432,8 @@ func TestTracerProviderSelfObservabilityErrorsHandled(t *testing.T) {
p := NewTracerProvider()
// Enable self-observability
t.Setenv("OTEL_GO_X_SELF_OBSERVABILITY", "true")
// Enable observability
t.Setenv("OTEL_GO_X_OBSERVABILITY", "true")
// Create a tracer to trigger instrument creation.
tr := p.Tracer("test-tracer")