open-telemetry / open-telemetry/opentelemetry-ruby
Consider changes to timeouts for asynchronous metrics
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 606
- Forks
- 301
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 42
Description
@wsmoak brought up some great points about the timeout behavior for asynchronous metrics in #1877.
Some things to ponder:
-
Currently, the asynchronous timeout is using Ruby's Timeout class, which operates in seconds. OTel exporter timeouts use milliseconds. Should we change the implementation to use milliseconds? Regardless, we should update the documentation to be clearer about the required unit.
-
Does the spec allow timeouts to be set for an asynchronous instrument on creation? Are any other implementations doing this? We should consider whether attributes could also be set on instrument creation.
From #1877:
I left a comment on https://github.com/wsmoak/opentelemetry-ruby/commit/309c129610166267055ce550c50c72826d67fba4#r164094574
I am confused by the need to set the timeout and attributes separately after creating the observable gauge.
And why you do that by calling
observeon the just-created instrument. (Which does, actually, record an observation, in addition to setting the attributes for observations going forward.)It seems like those could just be supplied when you create it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading metrics_sdk/lib/opentelemetry/sdk/metrics/state/asynchronous_metric_stream.rb and metrics_sdk/lib/opentelemetry/sdk/metrics/instrument/observable_gauge.rb, then investigate the referenced questions about timeout units and instrument creation. Done means reaching a decision on the API behavior and updating the documentation to state the required timeout unit clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100