Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mdatagen] add LeveledMeter method #10933

Merged

Conversation

codeboten
Copy link
Contributor

This will use the LeveledMeterProvider in TelemetrySettings.

Split from #10912, follows #10931

This func will MeterProvider and MetricsLevel in the near future. Split from open-telemetry#10912

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This will use the LeveledMeterProvider in TelemetrySettings.

Split from open-telemetry#10912, follows open-telemetry#10931

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 91.60%. Comparing base (26fb7cb) to head (d7a6c7d).
Report is 5 commits behind head on main.

Files Patch % Lines
...ereceiver/internal/metadata/generated_telemetry.go 0.00% 2 Missing ⚠️
...terhelper/internal/metadata/generated_telemetry.go 0.00% 2 Missing ⚠️
...processor/internal/metadata/generated_telemetry.go 0.00% 2 Missing ⚠️
...sorhelper/internal/metadata/generated_telemetry.go 0.00% 2 Missing ⚠️
...verhelper/internal/metadata/generated_telemetry.go 0.00% 2 Missing ⚠️
...perhelper/internal/metadata/generated_telemetry.go 0.00% 2 Missing ⚠️
service/internal/metadata/generated_telemetry.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10933      +/-   ##
==========================================
- Coverage   91.66%   91.60%   -0.07%     
==========================================
  Files         404      404              
  Lines       18941    18955      +14     
==========================================
  Hits        17363    17363              
- Misses       1219     1233      +14     
  Partials      359      359              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codeboten codeboten marked this pull request as ready for review August 20, 2024 20:58
@codeboten codeboten requested review from a team and jpkrohling August 20, 2024 20:58
@codeboten codeboten merged commit 070e855 into open-telemetry:main Aug 21, 2024
48 of 49 checks passed
@codeboten codeboten deleted the codeboten/leveled-meter-split-3 branch August 21, 2024 15:05
@github-actions github-actions bot added this to the next release milestone Aug 21, 2024
@dmitryax
Copy link
Member

This change makes the LeveledMeterProvider field in TelemetrySettings required. If not provided, users get panic:

ic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102e1320c]

goroutine 16 [running]:
testing.tRunner.func1.2({0x107ccdf80, 0x10cb4a620})
	/opt/homebrew/Cellar/go@1.22/1.22.7/libexec/src/testing/testing.go:1631 +0x1c4
testing.tRunner.func1()
	/opt/homebrew/Cellar/go@1.22/1.22.7/libexec/src/testing/testing.go:1634 +0x33c
panic({0x107ccdf80?, 0x10cb4a620?})
	/opt/homebrew/Cellar/go@1.22/1.22.7/libexec/src/runtime/panic.go:770 +0x124
go.opentelemetry.io/collector/receiver/receiverhelper/internal/metadata.LeveledMeter({0x14002da8080, {0x108d46498, 0x14002d9d2c0}, {0x108d464c0, 0x14002d9d2d0}, 0x0, 0x2, {0x0, 0x0}}, 0x186?)
	/Users/danoshin/Projects/opentelemetry-collector/receiver/receiverhelper/internal/metadata/generated_telemetry.go:21 +0x3c
go.opentelemetry.io/collector/receiver/receiverhelper/internal/metadata.NewTelemetryBuilder({0x14002da8080, {0x108d46498, 0x14002d9d2c0}, {0x108d464c0, 0x14002d9d2d0}, 0x0, 0x2, {0x0, 0x0}}, {0x0, ...})
	/Users/danoshin/Projects/opentelemetry-collector/receiver/receiverhelper/internal/metadata/generated_telemetry.go:51 +0x128
go.opentelemetry.io/collector/receiver/receiverhelper.newReceiver({{{{0x14002bb19b0, 0x9}}, {0x14002bb19ba, 0xd}}, {0x1055abc97, 0x4}, 0x0, {{{{...}}, {0x14002bb19ba, 0xd}}, ...}})
	/Users/danoshin/Projects/opentelemetry-collector/receiver/receiverhelper/obsreport.go:52 +0x54
go.opentelemetry.io/collector/receiver/receiverhelper.NewObsReport(...)
	/Users/danoshin/Projects/opentelemetry-collector/receiver/receiverhelper/obsreport.go:48

Is the new field expected to be required? If so, should it be marked as a breaking change?

@dmitryax
Copy link
Member

@codeboten let me know if we need an issue from this? I can create one

@codeboten
Copy link
Contributor Author

This is expected as the LeveledMeterProvider should be present. Adding a note to the changelog makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants