-
Notifications
You must be signed in to change notification settings - Fork 896
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
Add MetricProducer as a source of external metric data #2838
Conversation
Thank you @dashpole. I think resetting the review state here could help us improve this feature. I would like us now to also consider the "ALTERNATIVE" proposal known as option number two in #2722. I re-read this PR and think with small changes we could have the alternative approach (which I now favor). Whereas you wrote:
The alternative looks like one (or more) MetricProducers in a pipeline between the Reader and the Exporter.
Most of the PR doesn't have to change much. MetricReaders no longer care, what's left is a question about trade-offs.
@dashpole what do you think? |
@jmacd you mentioned that
I don't think the specification says that resource MUST only be associated the providers. Out of all the concepts so far that is true, and the statement you linked tells how that association must be implemented, but I don't see anywhere where it is forbidden to have other sources of telemetry with their own "Resource". Because of that I still believe the version where MetricProvider implementing the Reader is ok. |
Not sure what you're trying to say. I feel that this is a new topic. I quoted part of the Resource SDK specification. Above the part I quoted,
If we allow the Bridge to configure its own Resource, there's a good chance the bridge will appear as a separate Resource meaning a different entity. I believe the under-specified spirit of the Resource SDK Specification is that we should not encourage a bridge implementation that uses different Resource attributes than the OTel MeterProvider it is associated with. |
I think its slightly confusing for a MetricProducer to receive metrics from a MetricReader. Would this:
instead of this:
be a reasonable approach? |
I think there is value of having this component and it should be called "MetricProcessor". Calling it "MetricProducer" will be problematic if later we want to introduce MetricProcessor (and we'll struggle with the ordering of these components in the pipeline). |
How about this?
And here is my reason:
|
As long as we're discussing naming |
+1 👍 (I see the point where "writer" might be confusing, I think "bridge" or "adapter" might be okay) |
Overall, i'd like to settle on Integrating with the MetricReader vs MeterProvider question before we dive into other details. I'm happy to revisit naming, interfaces, or other aspects after that. I would summarize the tradeoffs as: Bridge integrates with MeterProvider (:tada:):
Bridge integrates with MetricReader (:rocket:):
Orthogonal-issues that I don't believe impact the decision above:
Feel free to propose benefits/drawbacks of the approaches that i've missed. I'd like to take the temperature of the room with 🎉 or 🚀 reactions to this comment. |
+1 on "Bridge integrates with MetricReader" - I think most users won't directly interact with the bridge, I would imagine that OpenCensus (or Micrometer, whatever) Bridge to be packaged under some distro/family-pack, so folks can use it easily during the migration, without having to understand all the implementation details. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
I think this PR isn't really stale? |
Yeah, I'm still working on it. But I don't have any updates to share right now. Edit: I can't reopen, but if someone else can, that would be appreciated. |
I just mean it should be reopened. Closed PRs tend to be lost |
Part of #1175
Related to #2730
Required for #2732
Supersedes #2722. The numbering scheme for alternatives caused some confusion, and it was requested that I open a new PR.
Changes
Add a MetricProducer interface to the metrics SDK. It is an optional argument when creating a MetricReader meant to support non-SDK sources of metric data.
Metric data from a MetricProducer is not subject to the MeterProviders or MetricReaders configuration for instruments. This means Views on MeterProviders, and default Aggregations and Aggregation Temporalities configured on MetricReaders are not applied to data from MetricProducers.
This is needed to support an OpenCensus metric bridge, which is proposed separately. It could also be used to support other bridges as well, such as a Prometheus bridge.