-
Notifications
You must be signed in to change notification settings - Fork 821
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
Conversation
Codecov Report
@@ 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
|
Nit: the prefix of this PR should be |
Thanks, @legendecas. I was wondering if this change is needed since you had a question about the naming here #2589 (comment) |
@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. |
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)
experimental/packages/opentelemetry-sdk-metrics-base/src/export/MetricExporter.ts
Outdated
Show resolved
Hide resolved
experimental/packages/opentelemetry-sdk-metrics-base/src/export/MetricExporter.ts
Outdated
Show resolved
Hide resolved
@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. |
...rimental/packages/opentelemetry-sdk-metrics-base/src/export/PeriodicExportingMetricReader.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 👍
...rimental/packages/opentelemetry-sdk-metrics-base/src/export/PeriodicExportingMetricReader.ts
Outdated
Show resolved
Hide resolved
experimental/packages/opentelemetry-sdk-metrics-base/src/export/MetricExporter.ts
Outdated
Show resolved
Hide resolved
…t/MetricExporter.ts Co-authored-by: legendecas <legendecas@gmail.com>
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)
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)
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 inforceFlush
. Andexport
returns promise withExportResult
.