1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-12-01 23:12:29 +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

@@ -654,7 +654,7 @@ var dropSpanMetricsView = sdkmetric.NewView(
)
func TestBatchSpanProcessorMetricsDisabled(t *testing.T) {
t.Setenv("OTEL_GO_X_SELF_OBSERVABILITY", "false")
t.Setenv("OTEL_GO_X_OBSERVABILITY", "false")
tp := basicTracerProvider(t)
reader := sdkmetric.NewManualReader()
meterProvider := sdkmetric.NewMeterProvider(
@@ -693,7 +693,7 @@ func TestBatchSpanProcessorMetricsDisabled(t *testing.T) {
}
func TestBatchSpanProcessorMetrics(t *testing.T) {
t.Setenv("OTEL_GO_X_SELF_OBSERVABILITY", "true")
t.Setenv("OTEL_GO_X_OBSERVABILITY", "true")
tp := basicTracerProvider(t)
reader := sdkmetric.NewManualReader()
meterProvider := sdkmetric.NewMeterProvider(
@@ -719,16 +719,16 @@ func TestBatchSpanProcessorMetrics(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
assert.NoError(t, me.waitForSpans(ctx, 2))
assertSelfObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
assertObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
expectMetrics{queueCapacity: 2, queueSize: 0, successProcessed: 2})
// Generate 3 spans. 2 fill the queue, and 1 is dropped because the queue is full.
generateSpan(t, tr, testOption{genNumSpans: 3})
assertSelfObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
assertObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
expectMetrics{queueCapacity: 2, queueSize: 2, queueFullProcessed: 1, successProcessed: 2})
}
func TestBatchSpanProcessorBlockingMetrics(t *testing.T) {
t.Setenv("OTEL_GO_X_SELF_OBSERVABILITY", "true")
t.Setenv("OTEL_GO_X_OBSERVABILITY", "true")
tp := basicTracerProvider(t)
reader := sdkmetric.NewManualReader()
meterProvider := sdkmetric.NewMeterProvider(
@@ -756,7 +756,7 @@ func TestBatchSpanProcessorBlockingMetrics(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
assert.NoError(t, me.waitForSpans(ctx, 2))
assertSelfObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
assertObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
expectMetrics{queueCapacity: 2, queueSize: 0, successProcessed: 2})
// Generate 2 spans to fill the queue.
generateSpan(t, tr, testOption{genNumSpans: 2})
@@ -764,14 +764,14 @@ func TestBatchSpanProcessorBlockingMetrics(t *testing.T) {
// Generate a span which blocks because the queue is full.
generateSpan(t, tr, testOption{genNumSpans: 1})
}()
assertSelfObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
assertObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
expectMetrics{queueCapacity: 2, queueSize: 2, successProcessed: 2})
// Use ForceFlush to force the span that is blocking on the full queue to be dropped.
ctx, cancel = context.WithTimeout(context.Background(), 10*time.Millisecond)
defer cancel()
assert.Error(t, tp.ForceFlush(ctx))
assertSelfObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
assertObsScopeMetrics(t, internalBsp.componentNameAttr, reader,
expectMetrics{queueCapacity: 2, queueSize: 2, queueFullProcessed: 1, successProcessed: 2})
}
@@ -782,7 +782,7 @@ type expectMetrics struct {
queueFullProcessed int64
}
func assertSelfObsScopeMetrics(t *testing.T, componentNameAttr attribute.KeyValue, reader sdkmetric.Reader,
func assertObsScopeMetrics(t *testing.T, componentNameAttr attribute.KeyValue, reader sdkmetric.Reader,
expectation expectMetrics,
) {
t.Helper()