-
Notifications
You must be signed in to change notification settings - Fork 836
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
Define MetricExporter interfaces #2589
Comments
I don't find a clear interface of the metrics data of the Currently, we define the exporter to batch with a series of |
That was also the same thing we did for the existing SDK and we will likely do the same thing again. Modeling the batch interface after the OTLP spec ensures we have all data required for OTLP export which should be everything in the data model so it is a good shortcut to make sure we're not missing anything important. |
@dyladan sorry but I'm not sure what you are suggesting. Do you suggest we should keep The latter one (grouped form) can reduce the work on the exporter side if they can send the same metric in a compact form, i.e. they don't need to repeat metric descriptors for each attributes set. |
Both are reasonable options. I was suggesting the second one, but the first one would mean we don't have to update all of our metrics exporters. Fortunately we don't have that many yet. @legendecas unrelated but i'm not sure how else to contact you. are you on CNCF slack? we're trying to plan the metrics SDK and you've been pretty involved in metrics. |
open-telemetry/opentelemetry-specification#2106 It's been clarified on spec. We should go with the |
That isn't merged yet, but I'll add it to the issue description. |
I'd be happy to pick this one up if no one is already working on it. |
edit: oops I thought this was metric reader not metric exporter. Yes you can feel free to work on this. You may want to look at #2681 to make sure work is compatible and not duplicated. |
@legendecas Do we want to model pull exporters around |
It is my understanding that yes, pull metric exporters will implement the MetricReader interface. Configuring a push metric exporter (or similar) provider.addMetricReader(new PeriodicMetricReader(new PushMetricExporter(config)) Configuring a pull metric exporter (or similar) provider.addMetricReader(new PullMetricExporter(config)) |
I am wondering if we want to introduce any new interfaces. I think the existing interfaces are sufficient and we can make use of them. The push type exporters can implement the |
I agree that we don't need another new interface to describe the pulling exportation. In #2681 the MetricReader abstract class is intentionally implemented without the dependency on MetricExporter to allow various patterns of exporting. |
I think you are suggesting that both pull and push exporters would be implemented as MetricReaders directly rather than having a metric reader that takes a push exporter in the constructor? I would rather go the route we have already been going with a metric reader that takes an exporter because if we don't all push exporters would have to reimplement the logic to periodically collect and then export. |
No, you misunderstood me. I am suggesting only the pull exporters will implement the metric reader interface. The exporters like OTLP which are push model implement the |
Yeah that makes sense. Renaming to |
@dyladan I think it would be better to have a spec note on the naming, as the spec is already suggesting implementing pull metric exporter as a metric reader. |
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)
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)
The specification defines both push and pull metric exporters. These interfaces will need to be defined so that exporters can implement them.
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#metricexporter
Pending merge of open-telemetry/opentelemetry-specification#2106 the specification has clarified the requirements of the exporter interface:
Metrics
Metric
contains name, unit, description, meter information, etc, and a list ofMetricPoints
MetricPoint
contains timestamps, dimensions, value (or buckets), exemplars, etc, of collected metricsThe text was updated successfully, but these errors were encountered: