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

feat(sdk-metrics-base): update metric exporter interfaces #2707

Merged
merged 15 commits into from
Feb 22, 2022

Conversation

srikanthccv
Copy link
Member

@srikanthccv srikanthccv commented Jan 8, 2022

Fixes #2589

This PR updates the exporter interfaces. Renames the push exporter type to PushMetricExporter to make it more clear. Makes the shutdown abstract so that implementation can have control over things such as closing connections etc, which one might not do in forceFlush. And export returns promise with ExportResult.

@codecov
Copy link

codecov bot commented Jan 8, 2022

Codecov Report

Merging #2707 (e18900f) into main (b756b7c) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2707      +/-   ##
==========================================
- Coverage   93.42%   93.41%   -0.02%     
==========================================
  Files         159      159              
  Lines        5449     5450       +1     
  Branches     1143     1145       +2     
==========================================
  Hits         5091     5091              
- Misses        358      359       +1     
Impacted Files Coverage Δ
...etry-sdk-metrics-base/src/export/MetricExporter.ts 27.27% <0.00%> (-25.67%) ⬇️
...s-base/src/export/PeriodicExportingMetricReader.ts 97.56% <0.00%> (-2.44%) ⬇️

@legendecas
Copy link
Member

Nit: the prefix of this PR should be feat instead of chore. chore is suitable for internal facilities like how we run tests and more importantly it won't bump as semver minor when generating release versions.

@srikanthccv
Copy link
Member Author

Thanks, @legendecas. I was wondering if this change is needed since you had a question about the naming here #2589 (comment)

@legendecas
Copy link
Member

@lonewolf3739 I didn't mean we don't need this change. I mean we need a spec clarification on the interface naming. Just opened open-telemetry/opentelemetry-specification#2286.

@srikanthccv srikanthccv changed the title chore: update metric exporter interface feat(sdk-metrics-base): update metric exporter interfaces Jan 24, 2022
@srikanthccv srikanthccv marked this pull request as ready for review January 24, 2022 07:47
@srikanthccv srikanthccv requested a review from a team January 24, 2022 07:47
tigrannajaryan pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Feb 15, 2022
If the implementors choose to implement pull metric exporters modeled as a metric reader, the only variant for metric exporter interface is push metric exporter. While the pull metric exporter is modeled as a "metric reader", the better naming for the genric "metric exporter" interface may be "push metric exporter".

Just open this PR to see if there are similar naming confusions with other SDK implementors. If so, I'd believe the metric exporter and metric reader section need a re-structure in a follow-up PR since how the pull metric exporter is modeled is important to the naming of the metric exporter interface.

Related:
- open-telemetry/opentelemetry-js#2707
- open-telemetry/opentelemetry-js#2589 (comment)
@legendecas
Copy link
Member

@lonewolf3739 thank you for your work on this! open-telemetry/opentelemetry-specification#2286 has been landed, I think it is good now to continue with this work.

@vmarchaud vmarchaud requested a review from legendecas February 19, 2022 20:32
Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

Thank you for your work! Most of the code LGTM 👍

@vmarchaud vmarchaud merged commit 630a261 into open-telemetry:main Feb 22, 2022
@vmarchaud vmarchaud added the enhancement New feature or request label Feb 22, 2022
@srikanthccv srikanthccv deleted the issue-2589 branch February 22, 2022 15:06
ChengJinbao added a commit to ChengJinbao/opentelemetry-specification that referenced this pull request Nov 16, 2022
If the implementors choose to implement pull metric exporters modeled as a metric reader, the only variant for metric exporter interface is push metric exporter. While the pull metric exporter is modeled as a "metric reader", the better naming for the genric "metric exporter" interface may be "push metric exporter".

Just open this PR to see if there are similar naming confusions with other SDK implementors. If so, I'd believe the metric exporter and metric reader section need a re-structure in a follow-up PR since how the pull metric exporter is modeled is important to the naming of the metric exporter interface.

Related:
- open-telemetry/opentelemetry-js#2707
- open-telemetry/opentelemetry-js#2589 (comment)
joaopgrassi pushed a commit to dynatrace-oss-contrib/semantic-conventions that referenced this pull request Mar 21, 2024
If the implementors choose to implement pull metric exporters modeled as a metric reader, the only variant for metric exporter interface is push metric exporter. While the pull metric exporter is modeled as a "metric reader", the better naming for the genric "metric exporter" interface may be "push metric exporter".

Just open this PR to see if there are similar naming confusions with other SDK implementors. If so, I'd believe the metric exporter and metric reader section need a re-structure in a follow-up PR since how the pull metric exporter is modeled is important to the naming of the metric exporter interface.

Related:
- open-telemetry/opentelemetry-js#2707
- open-telemetry/opentelemetry-js#2589 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define MetricExporter interfaces
3 participants