-
Notifications
You must be signed in to change notification settings - Fork 772
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
[sdk-metrics] ExemplarFilter updates to match latest specification #5404
[sdk-metrics] ExemplarFilter updates to match latest specification #5404
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5404 +/- ##
==========================================
+ Coverage 83.38% 84.58% +1.19%
==========================================
Files 297 284 -13
Lines 12531 12104 -427
==========================================
- Hits 10449 10238 -211
+ Misses 2082 1866 -216
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -55,6 +55,16 @@ | |||
API. | |||
([#5396](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5396)) | |||
|
|||
* **Experimental (pre-release builds only):** Removed the `ExemplarFilter`, |
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.
Very nice wording! crisp and clear. 💯
private MeterProvider meterProvider; | ||
private Meter meter; | ||
|
||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1602:Enumeration items should be documented", Justification = "Test only.")] | ||
public enum ExemplarFilterToUse | ||
public enum ExemplarConfigurationType |
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.
can you update the benchmark numbers as well? This was added to highlight the relevance of filtering and how perf gets affected when more measurements are considered (not store) for exemplars?
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 updated the numbers on here: 1c75977
But I will say, I think having the numbers in the source files is bad practice. The numbers are really only useful when run on the same machine and run against other numbers from the same machine run under similar circumstances. To properly benchmark, you need to run numbers on some branch, and then switch to a branch with code changes and re-run them again. Having the numbers in the source file could mislead people into thinking they have made things better or worse unless they correctly re-run the base first 🤔
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.
These numbers are useful for tracking memory allocation. It's easy to check if your code adds or reduces the memory allocation by comparing with the results in the source file.
Having the numbers in the source file could mislead people into thinking they have made things better or worse unless they correctly re-run the base first
We also copy the information about the hardware config when running the benchmarks so if someone is ignoring that, then maybe we could just add a comment saying these numbers are related to that particular config only.
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.
Probably not the way to do it. We don't even turn on memory allocation tracking by default you have to add "-m" 🤣 A solution would be more like we mark the things which we expect to be allocation-free and verify that in CI so we aren't reliant on a) people running them and b) people running them correctly understanding the nuances.
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.
CI based solution would be much better than what we have for sure.
But with the existing approach, for anyone updating benchmarks in a PR, the reviewers check (and should check) if the memory allocation column is added or not. They also check if the PR author ran the benchmarks for both main and the feature branch.
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.
we can still keep them with a note above.
Its very useful to look at it and see how much overhead each feature is adding on.
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.
Left some nits, nothing blocking and can be follow ups.
@CodeBlanch This needs to be updated as well:
|
/// Sets the <see cref="ExemplarFilterType"/> to be used for this provider | ||
/// which controls how measurements will be offered to exemplar reservoirs. | ||
/// Default provider configuration: <see | ||
/// cref="ExemplarFilterType.AlwaysOff"/>. |
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.
The default is TraceBased
Edit: I see it says provider configuration. Could we reword this? If someone just does SetExemplarFilter()
, the default would be TraceBased
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.
need some spec work to clarify defaults. It is not clear if exemplars, as a feature, itself is enabled by default. once enabled, yes, tracebased is the default, but we need to see if that makes sense. (I don't think so, but will wait for Blanch's current work before we approach spec)
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.
Agree it is a bit confusing in the spec.
There's two statements in metrics sdk:
Exemplar sampling SHOULD be turned off by default. If Exemplar sampling is off, the SDK MUST NOT have overhead related to exemplar sampling.
The ExemplarFilter SHOULD be a configuration parameter of a MeterProvider for an SDK. The default value SHOULD be TraceBased.
I tried to satisfy that 🤣
|
||
/// <summary> | ||
/// An exemplar filter which makes measurements recorded in the context of a | ||
/// sampled <see cref="Activity"/> (span) eligible for becoming an <see |
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.
/// sampled <see cref="Activity"/> (span) eligible for becoming an <see | |
/// sampled parent <see cref="Activity"/> (span) eligible for becoming an <see |
to match the spec definition.
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 "parent" text was in a couple spots. I removed it because I thought it was super confusing!
An ExemplarFilter which makes those measurements eligible for being an Exemplar, which are recorded in the context of a sampled parent span.
Does that mean Activity.Current.Parent.Recorded
or Activity.Current.Recorded
?
An ExemplarFilter which makes those measurements eligible for being an Exemplar, which are recorded in the context of a sampled span.
Seems to more clearly mean Activity.Current.Recorded
?
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 think the parent
term is used with respect to the measurement here. But I see the confusion, ok to keep what you have.
test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpMetricsExporterTests.cs
Show resolved
Hide resolved
Updated here: ce1e34e The build didn't catch it because |
Changes
ExemplarFilter
experimental API to match changes made to spec.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes