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

[SCHEMA] The MetricExporter schema is unsafe #109

Closed
marcalff opened this issue Aug 4, 2024 · 1 comment · Fixed by #110
Closed

[SCHEMA] The MetricExporter schema is unsafe #109

marcalff opened this issue Aug 4, 2024 · 1 comment · Fixed by #110

Comments

@marcalff
Copy link
Member

marcalff commented Aug 4, 2024

Currently:

  • there is a unique schema for MetricExporter, which can represent otlp, console, prometheus, or an extension point.
  • a PeriodicMetricReader uses a MetricExporter
  • a PullMetricReader uses a MetricExporter

This is unsafe, because push and pull exporters are mixed in a common schema, which makes it possible to represent:

meter_provider:
  readers:
    - periodic:
        exporter:
          prometheus:
    - pull:
        exporter:
          console:

This is invalid:

  • a periodic exporter is not going to use a prometheus scraper,
  • a pull exporter is now going to use the console to scrape.

Please define instead two separate schemas:

  • PushMetricExporter, which can represent otlp, console, or an extension point,
  • PullMetricExporter, which can represent prometheus, or an extension point,

This also imply that a extension points for PushMetricExporter and PullMetricExporter are different, because they have a different type, which is good.

The component registry will need to expose both types.

@jack-berg
Copy link
Member

Good call. Would you be willing to open a PR to fix?

marcalff added a commit to marcalff/opentelemetry-configuration that referenced this issue Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants