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

Verify compliant metric SDK specification implementation: MetricProducer #3668

Closed
1 of 2 tasks
Tracked by #3674
MrAlias opened this issue Feb 3, 2023 · 10 comments
Closed
1 of 2 tasks
Tracked by #3674
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Feb 3, 2023

  • Identify all the normative requirements, recommendations, and options the specification defines as comments to this issue
  • Ensure the current metric SDK implementation is compliant with these normative requirements, recommendations, and options in those comments.
@MrAlias MrAlias converted this from a draft issue Feb 3, 2023
@MrAlias MrAlias added pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Feb 3, 2023
@MadVikingGod
Copy link
Contributor

Requirements from reading the Metric Producer Section of the spec.

  • MetricProducer is an open interface that can be implemented outside the SDK.

    MetricProducer defines the interface which bridges to third-party metric sources MUST implement so they can be plugged into an OpenTelemetry MetricReader as a source of aggregated metric data.

  • The SDK's in-memory state MAY implement the MetricProducer interface for convenience.

  • SDK authors MAY provide utility libraries to facilitate conversion between delta and cumulative temporalities.

  • If the batch of Metric points returned by Produce() includes a Resource, the MetricProducer MUST accept configuration for the Resource.

  • The MetricProducer Interface must have the following defined:
    • Produce
      • Produce MUST return a batch of Metric points.

      • Produce does not have any required parameters... SDK authors MAY choose to add parameters

      • Produce SHOULD provide a way to let the caller know whether it succeeded, failed or timed out.

      • When the Produce operation fails, the MetricProducer MAY return successfully collected results and a failed reasons list to the caller.

      • If a batch of Metric points can include InstrumentationScope information, Produce SHOULD include a single InstrumentationScope which identifies the MetricProducer.

@damemi
Copy link
Contributor

damemi commented Jul 5, 2023

@MrAlias can you assign this to me?

@damemi
Copy link
Contributor

damemi commented Jul 6, 2023

Requirements from reading the Metric Producer Section of the spec.

  • MetricProducer is an open interface that can be implemented outside the SDK.

    MetricProducer defines the interface which bridges to third-party metric sources MUST implement so they can be plugged into an OpenTelemetry MetricReader as a source of aggregated metric data.

  • The SDK's in-memory state MAY implement the MetricProducer interface for convenience.

I didn't find any implementations of this in the in-memory state

SDK authors MAY provide utility libraries to facilitate conversion between delta and cumulative temporalities.

Didn't see any

If the batch of Metric points returned by Produce() includes a Resource, the MetricProducer MUST accept configuration for the Resource.

Produce() (ScopeMetrics) does not include a Resource

The MetricProducer Interface must have the following defined:

  • Produce

It does

Produce MUST return a batch of Metric points.

Produce() returns []metricdata.ScopeMetrics.

Produce does not have any required parameters... SDK authors MAY choose to add parameters

Produce() requires a Go context. It's unclear whether the specification means that Produce "MUST" not have any required parameters (and authors may add optional parameters), or if authors may add required parameters.

Produce SHOULD provide a way to let the caller know whether it succeeded, failed or timed out.

Produce() returns a Go error (along with the batch of data points)

When the Produce operation fails, the MetricProducer MAY return successfully collected results and a failed reasons list to the caller.

This is up to each Producer's implementation, but for example the opencensus bridge will return successful results and an aggregated error (from internal.ConvertMetrics())

If a batch of Metric points can include InstrumentationScope information, Produce SHOULD include a single InstrumentationScope which identifies the MetricProducer.

ScopeMetrics includes a single InstrumentationScope


I think the only action item from this would be to clarify the intent of Produce does not have any required parameters... SDK authors MAY choose to add parameters

@MrAlias
Copy link
Contributor Author

MrAlias commented Jul 13, 2023

The MetricProducer specification needs to be stabilized before we can release our implementation of it stabilly.

@MrAlias
Copy link
Contributor Author

MrAlias commented Jul 14, 2023

I think the only action item from this would be to clarify the intent of Produce does not have any required parameters... SDK authors MAY choose to add parameters

@damemi do you plan to open a spec issue/PR for this?

@MrAlias
Copy link
Contributor Author

MrAlias commented Jul 14, 2023

The MetricProducer specification needs to be stabilized before we can release our implementation of it stabilly.

open-telemetry/opentelemetry-specification#3599

@damemi
Copy link
Contributor

damemi commented Jul 14, 2023

I think the only action item from this would be to clarify the intent of Produce does not have any required parameters... SDK authors MAY choose to add parameters

@damemi do you plan to open a spec issue/PR for this?

Opened open-telemetry/opentelemetry-specification#3601 for this question

@arminru
Copy link
Member

arminru commented Jul 25, 2023

Clarified that the required context parameter is fine: open-telemetry/opentelemetry-specification@15df460

@dashpole dashpole moved this from Blocked to In Progress in Go: Metric SDK (GA) Sep 13, 2023
@dashpole
Copy link
Contributor

I believe this can be closed now.

@MrAlias MrAlias closed this as completed Sep 13, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Go: Metric SDK (GA) Sep 13, 2023
@XSAM XSAM added this to the untracked milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package
Projects
No open projects
Development

No branches or pull requests

6 participants