diff --git a/internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/bpf/probe.bpf.c b/internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/bpf/probe.bpf.c index e1530472d..ba1fc1efc 100644 --- a/internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/bpf/probe.bpf.c +++ b/internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/bpf/probe.bpf.c @@ -179,12 +179,12 @@ int uprobe_SetName(struct pt_regs *ctx) { return 0; } - void *span_name_ptr = get_argument(ctx, 4); + void *span_name_ptr = get_argument(ctx, 2); if (span_name_ptr == NULL) { return 0; } - void *span_name_len_ptr = get_argument(ctx, 5); + void *span_name_len_ptr = get_argument(ctx, 3); if (span_name_len_ptr == NULL) { return 0; } diff --git a/internal/test/e2e/otelglobal/main.go b/internal/test/e2e/otelglobal/main.go index b1f9c8915..2a8ae6b37 100644 --- a/internal/test/e2e/otelglobal/main.go +++ b/internal/test/e2e/otelglobal/main.go @@ -29,13 +29,7 @@ func innerFunction(ctx context.Context) { defer span.End() span.SetAttributes(attribute.String("inner.key", "inner.value")) -} - -func setNameOverride(ctx context.Context) { - _, span := tracer.Start(ctx, "SetNameOriginal") - defer span.End() - - span.SetName("SetNameOverride") + span.SetName("child override") } func createMainSpan(ctx context.Context) { @@ -43,7 +37,6 @@ func createMainSpan(ctx context.Context) { defer span.End() innerFunction(ctx) - setNameOverride(ctx) intAttr := attribute.Int("int_key", 42) strAttr := attribute.String("string_key", "forty-two") diff --git a/internal/test/e2e/otelglobal/traces.json b/internal/test/e2e/otelglobal/traces.json index f6921302e..8de293cdc 100644 --- a/internal/test/e2e/otelglobal/traces.json +++ b/internal/test/e2e/otelglobal/traces.json @@ -59,16 +59,7 @@ } ], "kind": 3, - "name": "child", - "parentSpanId": "xxxxx", - "spanId": "xxxxx", - "status": {}, - "traceId": "xxxxx" - }, - { - "attributes": [], - "kind": 3, - "name": "SetNameOverride", + "name": "child override", "parentSpanId": "xxxxx", "spanId": "xxxxx", "status": {},