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

Update opentelemetry_metrics_exporter entrypoint to a MetricReader factory #3412

Closed
wants to merge 1 commit into from

Conversation

aabmass
Copy link
Member

@aabmass aabmass commented Aug 24, 2023

Description

  • Update the SDK Configuration to expect opentelemetry_metrics_exporter entrypoint impl to be a Callable[[], MetricReader]
  • Update the SDK's console exporter entrypoint to implement this new protocol
  • Update the OTLP exporters' entrypoints to implement this new protocol

Note this is a breaking change in an unstable component

Fixes #3411

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Existing tests are passing
  • Added new test cases in OTLP exporters to verify that entrypoints are being loaded by name

Does This PR Require a Contrib Repo Change?

Answer the following question based on these examples of changes that would require a Contrib Repo Change:

  • The OTel specification has changed which prompted this PR to update the method interfaces of opentelemetry-api/ or opentelemetry-sdk/

  • The method interfaces of test/util have changed

  • Scripts in scripts/ that were copied over to the Contrib repo have changed

  • Configuration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in

    • pyproject.toml
    • isort.cfg
    • .flake8
  • When a new .github/CODEOWNER is added

  • Major changes to project information, such as in:

    • README.md
    • CONTRIBUTING.md
  • Yes. - Link to PR:

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@aabmass aabmass changed the title Update opentelemetry_metrics_exporter entrypoint to a MetricReader factory Update opentelemetry_metrics_exporter entrypoint to a MetricReader factory Aug 24, 2023
@aabmass aabmass force-pushed the reader-factories-3411 branch from 4c079fe to 13d5735 Compare August 24, 2023 04:03
@aabmass aabmass marked this pull request as ready for review August 24, 2023 04:03
@aabmass aabmass requested a review from a team August 24, 2023 04:03
@@ -34,7 +34,7 @@ dependencies = [
otlp = "opentelemetry.exporter.otlp.proto.grpc._log_exporter:OTLPLogExporter"

[project.entry-points.opentelemetry_metrics_exporter]
otlp = "opentelemetry.exporter.otlp.proto.grpc.metric_exporter:OTLPMetricExporter"
otlp = "opentelemetry.exporter.otlp.proto.grpc.metric_exporter:_otlp_metric_exporter_entrypoint"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we not have "entrypoint" in the factory method name? Replace it with "factory" should be good to represent what it actually is.

@lzchen
Copy link
Contributor

lzchen commented Sep 7, 2023

Recalling from the SIG discussion on 08/24, we were going back and forth deciding whether we want to rename the exporter entrypoint into a reader or have two entry points to configure reader and exporter (where one will take priority if only one is needed). I believe the points were outlined as below:

Rename entrypoint to reader:

  1. Accurately reflects the reader classes for pull based exporters
  2. Is confusing for push based exporters

Keep entrypoint in PR as exporter:

  1. Pull based exporters are actually readers so this isn't entirely accurate

Have both reader and exporter entrypoints

  1. Allows for more configuration
  2. More complex and could introduce priority issues.

@aabmass

What do you think of keeping only one entrypoint, but allowing the factory to return either a metricreader or metricexporter, and setting up the metrics pipeline differently based off of return type?

@aabmass
Copy link
Member Author

aabmass commented Sep 7, 2023

Discussed in SIG and updated the issue with discussion. Will take a different approach.

@aabmass aabmass closed this Sep 7, 2023
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.

Make opentelemetry_metrics_exporter entrypoint support pull exporters
2 participants