Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
EnrichmentScope & EnrichingActivityProcessor #969
EnrichmentScope & EnrichingActivityProcessor #969
Changes from 6 commits
73cee9b
66e1724
d52bec5
35a1a9c
b4d6532
1b16067
320c946
f33057c
651b4c7
04a86dd
e682a6a
6b88c9f
7eeaf58
7f76856
793a98c
96f9d30
60448bd
102c6b1
d319e56
24ef002
239e212
caf1dbb
6dbe93e
3463097
7c116de
505b87d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I know I'm always bad at naming things, the name
ContextualProcessor
keeps popping up in my mind 😂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.
(I'm not opposed to changing the name. I was just waiting to see if anyone else thought similar or had other ideas.)
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.
Should be my last question in this PR: do we envision a similar concept would be introduced for metrics/logs in the future? If yes, we might need to consider how we name things so we won't be cornered in the future.
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.
This is an interesting point. Slight tangent, but my mental model of "instrumentation" before OTel has been one that combines the concepts of collecting of traces, metrics, etc together. High-level I think of something like HTTP instrumentation as a thing that both generates spans in a trace as well as collecting metrics about the operation. From a configuration perspective, I've wondered if these things will continue to be treated as separate - that is, I build up my trace pipeline/configuration separate from my metric configuration.
In the context of EnrichmentScope, should there be a different trace vs. metric vs. log EnrichmentScope concept? Or can all of these be combined in one EnrichmentScope class that includes the ability to configure behavior on traces, metrics, and logs?
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.
There's nothing really Activity-specific about the current implementation. It uses @reyang's
RuntimeContext
stuff. Essentially what it is doing is buffering a callback/closure to be executed when the final thing to be enriched is available. So in that way, it could work for metrics & logs. Maybe you will be able to give it different callbacks depending on what is being enriched? I don't have enough of a mental picture of the metrics & logging APIs to say conclusively, but it would be great if we had one thing for all the spec areas. Open to suggestions.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.
My suggestion is that we get this PR merged and continue the discussion here 😆
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.
Yes, I'm leaning towards thinking one thing for all the spec areas make sense, though like you my mental picture is still somewhat fuzzy.
This is why I was pondering this thought in the realm of configuration since that's a little more concrete at the moment. For example, I can see the
AddOpenTelemetry
extension method onIServiceCollection
include additional parameters for a "MeterProviderBuilder" and a "LogProviderBuilder" like how you're suggesting distinct callbacks based on type of telemetry data for EnrichmentScope.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.
yes! agreed.