-
Notifications
You must be signed in to change notification settings - Fork 785
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
AddSource with predicate #5353
AddSource with predicate #5353
Conversation
Would you provide a concrete use case? For example, if the goal is to avoid "Azure.Verbose.Stuff", does "Azure.Error.Stuff" + "Azure.Info.Stuff" + "Azure.Xyz.Stuff" (should be a manageable list) work? I think any user provided callback on the hot path is something dangerous and we should put a high bar #5349 (comment). |
The specific use-case is Cosmos DB:
There expected to be a few sources per each Azure SDK (already is), documented beforehand that look like More use cases and spec-level discussion here open-telemetry/opentelemetry-specification#3867 This callback is not on the hot path - it's executed when source is created (e.g. once per source during process or client instance lifetime) and I don't see the dangers you're talking about in this case. |
Could these be categorized using the names? Down the path would there be indefinite number of special cases, and how would the user manage it (e.g. keeping add special cases in the predicate?) |
they are categorized using names.
With There could be better solutions:
So yes, predicate does not solve all the problems, but it's a simple evolution of wildcard enablement and solves the problem of disabling noisy source or picking better defaults than |
c493a0d
to
2e04ba1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5353 +/- ##
==========================================
+ Coverage 83.38% 84.86% +1.48%
==========================================
Files 297 282 -15
Lines 12531 12257 -274
==========================================
- Hits 10449 10402 -47
+ Misses 2082 1855 -227
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Thanks for the pointers to Currently it'd only work along with
Still, So, I'd like to get @open-telemetry/dotnet-maintainers / @open-telemetry/dotnet-approvers opinion on how they see more generic metric configuration in vanilla otel package:
builder.Services.AddMetrics(b => b.EnableMetrics("Microsoft.")
.DisableMetrics("Microsoft.AspNetCore.Routing"));
builder.Services.AddOpenTelemetry().WithMetrics(m => m.AddOtlpExporter()); Making
I created dotnet/runtime#100317 to see if something like |
A quick update on dotnet/runtime#100317: based on the offline conversation with @noahfalk there are no plans to provide |
Capturing the discussion we had on 3/4 during SIG meeting:
|
c7b13bd
to
fbf27ff
Compare
@open-telemetry/dotnet-maintainers / @open-telemetry/dotnet-approvers thank you for the feedback, I believe I addressed it. Please take a look
I don't envision a need to return a config. Given this API is experimental now I suggest that we don't block on this now, but will consider it if/when it goes stable. |
6eea832
to
c7bb924
Compare
c7bb924
to
91c5de1
Compare
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 don't think we should pursue this change for the following reasons:
- Selectively disabling tracers (
ActivitySource
) is a general problem that needs to be solved across all the SDK implementations and is not a .NET specific issue. The spec already has an issue that covers this problem. I don't see the need to get ahead of ourselves now when we can wait to see how spec decides to tackle this. - I'm against adding experimental public APIs for which there is no end in sight as to when and how they get stabilized. I know that we can always remove experimental stuff but why create unnecessary maintenance burden in the first place?
- This is not significant enough to be rushed into considering the very small number of people that have complained about this. On top of that, it's not a blocker. AddSource method accepts an array of strings. Curating the list of
ActivitySource
to listen to is a one-time thing so it shouldn't be a recurring inconvenience. For more unusual scenarios such as if you are the library author and you keep updating the list ofActivitySource
used in your library frequently, then you should consider providing a public API to make it easy for your users to curate the list of required ActivitySources which they can then simply pass to theAddSource
method.
There's a couple of points I think are interesting here. First, I get asked this all the time, so I don't think it's a small number of users. Not all users come onto github, are an internal Microsoft Department, or have a support contract with Microsoft. I don't think it's valid to dismiss this based on that argument. Until recently, there hasn't been a tonne of libraries implementing multiple sources using namespaces. I've recently worked with 3 big OSS projects that have added them, and will likely be thinking about that as an approach. That said, they're only looking at 2/3 sources, so it's not a big thing for them. The thing I get call for is "On by default, then disable". So what they essentially want is: builder.Services.AddOpenTelemetry()
.WithTracing(tpb =>
tpb.AddSource("*")
.RemoveSource("System.Data.SqlClient")
) That is a very common usecase, where people want "everything", but then to selectively turn it off. An example would be how the Node instrumentations library works. I'm not sure predicate is the right way to do this, but adding a |
We prefer assessing the demand for something based on actual users upvoting/commenting on an issue rather than someone's personal accounts such as " I get asked this all the time".
I'm not sure where you're getting this from. The reasons for blocking this PR are already mentioned in this comment and they apply to your proposal of adding |
99% of users will not come here to request features and comment on PRs. The sentiment comes from outreach and talking to users, something that I do all the time. Ignoring what users are saying, and basing everything on upvotes here is not the way we build adoption. The vast majority of features I see being added are actually from internal conversations that you're having with the runtime time or internal Microsoft teams, so it feels like you're already judging demand based on the conversations you and the rest of the team are having (such as the enhancements you're making to enable Aspire). I get that you may not trust me as I'm not internal, but dismissing what I'm telling you I'm hearing from the community is utterly wrong. |
I get that you may not trust me as I'm not internal If you have any concerns about how the maintainers/approvers of this repo are acting, you can raise it with OpenTelemetry Governance Committee. |
Thanks @cijothomas, that is the route we're taking, this was the last piece of evidence I needed. Feel free to reach out if you want to discuss. |
No, I don't have anything to discuss. |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Fixes dotnet/aspnetcore#4371
Changes
Adds ability to add sources using predicate for
ActivitySource
:Azure.*
enables all Azure SDK sources, but what if I want to listen to all butAzure.Verbose.Stuff
)Context: open-telemetry/opentelemetry-specification#3867
It's a common need for libraries to emit multiple sources and let users decide which ones they want (or all of them).
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes