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

Implement go.schedule.duration #5991

Merged
merged 8 commits into from
Sep 4, 2024

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented Aug 7, 2024

Fixes #5974.

This uses the same method for estimating the sum as the prometheus client-go: https://github.com/prometheus/client_golang/blob/46f77a97fa1e83e7285634745bd5c92c11bf20c7/prometheus/go_collector_latest.go#L543, which is to use the lower-bound of each bucket as the value of each observation.

It implements this using a metric producer. It is designed to be used together with existing runtime instrumentation.

@dashpole dashpole requested a review from a team August 7, 2024 02:56
@dashpole dashpole marked this pull request as draft August 7, 2024 02:56
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 12 lines in your changes missing coverage. Please review.

Project coverage is 65.7%. Comparing base (6ffea7b) to head (2950bc4).

Files with missing lines Patch % Lines
instrumentation/runtime/producer.go 86.2% 4 Missing and 4 partials ⚠️
instrumentation/runtime/options.go 72.7% 2 Missing and 1 partial ⚠️
instrumentation/runtime/runtime.go 95.2% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #5991     +/-   ##
=======================================
+ Coverage   65.5%   65.7%   +0.2%     
=======================================
  Files        203     203             
  Lines      12985   13034     +49     
=======================================
+ Hits        8506    8569     +63     
+ Misses      4219    4204     -15     
- Partials     260     261      +1     
Files with missing lines Coverage Δ
instrumentation/runtime/runtime.go 80.9% <95.2%> (+2.4%) ⬆️
instrumentation/runtime/options.go 88.4% <72.7%> (-11.6%) ⬇️
instrumentation/runtime/producer.go 86.2% <86.2%> (ø)

... and 1 file with indirect coverage changes

@dashpole dashpole marked this pull request as ready for review August 7, 2024 16:19
@MrAlias MrAlias added this to the v1.29.0 milestone Aug 7, 2024
@dashpole dashpole force-pushed the runtime_histogram branch 2 times, most recently from 873ff8a to 5db5299 Compare August 12, 2024 15:51
Copy link
Member

@XSAM XSAM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dashpole dashpole merged commit 8f5330c into open-telemetry:main Sep 4, 2024
25 checks passed
@dashpole dashpole deleted the runtime_histogram branch September 4, 2024 16:34
XSAM added a commit that referenced this pull request Sep 11, 2024
### Added

- Add `NewProducer` to
`go.opentelemetry.io/contrib/instrumentation/runtime`, which allows
collecting the `go.schedule.duration` histogram metric from the Go
runtime. (#5991)
- Add gRPC protocol support for OTLP log exporter in
`go.opentelemetry.io/contrib/exporters/autoexport`. (#6083)

### Removed

- Drop support for [Go 1.21]. (#6046, #6047)

### Fixed

- Superfluous call to `WriteHeader` when flushing after setting a status
code in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`.
(#6074)
- Superfluous call to `WriteHeader` when writing the response body after
setting a status code in
`go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`. (#6055)

[Go 1.21]: https://go.dev/doc/go1.21

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
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.

Support go.schedule.duration runtime metric
5 participants