open-telemetry / open-telemetry/opentelemetry-ruby

Have `MetricReader#Collect` report a status instead of raw data

Open
#2,364 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug metrics spec-compliance spec:stable
Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

Description

Spec requirement

MetricReader#Collect SHOULD report success/failure/timeout (sdk.md:1497-1523).

Current behavior

export/metric_reader.rb:21-23 (permalink) #collect returns whatever @metric_store.collect returns (an array of MetricData, not a status/result object) so there's no success/failure/timeout signal for callers.

Suggested fix

Wrap the collected data in a result object or add a parallel status-reporting return path. This would allow callers to distinguish a successful, but empty, collection from a failed one without changing the existing data-returning behavior that callers currently rely on.

Related rows in SPEC_COMPLIANCE_METRICS.md

SDK-55

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with metrics_sdk/lib/opentelemetry/sdk/metrics/export/metric_reader.rb, especially lines 21-23, and compare its current return behavior with the linked SDK specification section. Trace how callers use the collected MetricData array before choosing between a result object and a parallel status path. Done means callers can distinguish success, failure, and timeout, including successful empty collections, without breaking existing data-dependent callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.