Skip to content

Simulate failures for histogram creation paths without risking a nil-interface panic - #7518

Merged
MrAlias merged 1 commit into
open-telemetry:mainfrom
tongoss:feature/improve-observ-test
Oct 20, 2025
Merged

Simulate failures for histogram creation paths without risking a nil-interface panic#7518
MrAlias merged 1 commit into
open-telemetry:mainfrom
tongoss:feature/improve-observ-test

Conversation

@tongoss

@tongoss tongoss commented Oct 19, 2025

Copy link
Copy Markdown
Contributor

Manual reader need to add Observability metric: #7009 .

If the code under test calls meter.Float64Histogram(...), the call will be dispatched to the embedded mapi.Meter interface field, which is nil → runtime panic (nil interface method call).

go test -timeout 60s -race ./sdk/...
ok  	go.opentelemetry.io/otel/sdk	(cached)
?   	go.opentelemetry.io/otel/sdk/instrumentation	[no test files]
ok  	go.opentelemetry.io/otel/sdk/internal/x	(cached)
ok  	go.opentelemetry.io/otel/sdk/resource	(cached)
ok  	go.opentelemetry.io/otel/sdk/trace	1.995s
?   	go.opentelemetry.io/otel/sdk/trace/internal	[no test files]
ok  	go.opentelemetry.io/otel/sdk/trace/internal/env	(cached)
2025/10/14 23:56:39 internal_logging.go:50: "msg"="Setting meter provider to its current value. No delegate will be configured" "error"="no delegate configured in meter provider"
--- FAIL: TestBSPCallback (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x1044c8c24]

Resolution:
Add Float64Histogram to errMeter

Context:

#7500 (comment)

@tongoss
tongoss marked this pull request as ready for review October 19, 2025 13:56
@flc1125 flc1125 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Oct 20, 2025
@MrAlias
MrAlias merged commit eb7ec3e into open-telemetry:main Oct 20, 2025
32 of 33 checks passed
@MrAlias MrAlias added this to the v1.39.0 milestone Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

4 participants