Repository navigation
Dotnet Counters + Dotnet Monitor Unification - #4254
Conversation
noahfalk
left a comment
There was a problem hiding this comment.
I was mentally prepared for a lot more churn, this feels not bad at all :) I do think there are a few things to change, comments inline.
| <ItemGroup> | ||
| <InternalsVisibleTo Include="dotnet-monitor" /> | ||
| <InternalsVisibleTo Include="dotnet-counters" /> | ||
| <InternalsVisibleTo Include="DotnetCounters.UnitTests" /> |
There was a problem hiding this comment.
This is likely a bigger discussion we can have outside of this PR, but all this InternalsVisibleTo usage looks like something we should move away from. I'd suggest we declare that M.D.Monitoring.* are implementation details of tools our teams maintain and then we convert all the internal APIs we expect those tools to call to be public. Years back when dotnet-monitor was getting started we had ideas that there might be an ecosystem of tools and we might also host an in-proc version of the monitor. Since then it feels pretty clear that OpenTelemetry.NET is the defacto standard in-proc agent and its unlikely anyone else has a need to build an out-of-proc diagnostic tool around this library other than our teams.
For now I'm not objecting to the IVT existing or that we are adding a new one, just suggesting a direction to move in for the future.
|
|
||
| int Series { get; } | ||
|
|
||
| bool IsValuePublishedEvent { get => EventType != EventType.BeginInstrumentReporting; } |
There was a problem hiding this comment.
I'd suggest enumerating the event types which do qualify rather than those which do not, it makes the intent more clear. The current impl is also incorrectly triaging a bunch of events. For example error payloads shouldn't return true I think.
For consistency I'd add this to the EventType extensions so its less likely to be missed if new events are added.
There was a problem hiding this comment.
Sorry, I misinterpreted the initial ask - since the exceptions were already being filtered out earlier in this conditional I didn't account for them. If I should have included any other EventTypes, just let me know and I'll add them in.
noahfalk
left a comment
There was a problem hiding this comment.
A few tiny things still outstanding, but overall I think its in good shape. Double check with @mikem8361 before merging to make sure the timing isn't conflicting with the tools release but I think that already happened and there is no issue there.
|
Yes, the recent tools release is done and out. Merging this when it is ready would be just fine. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| try | ||
| { | ||
| session = await client.StartEventPipeSessionAsync(_sourceConfig.GetProviders(), _sourceConfig.RequestRundown, _sourceConfig.BufferSizeInMB, cancellationToken).ConfigureAwait(false); | ||
| if (resumeRuntime) |
There was a problem hiding this comment.
I don't think the concept of runtime resumption should be here at all. Let the caller do that after it gets the stream back. Only have the EventPipeStreamProvider care about providing the event stream, nothing else.
I also don't think this should be a setting on EventSourcePipeline class either. Again, let the caller do that. Only have the pipeline care about collection events from the event source.
Pseudo example of a caller needing to resume the runtime:
DiagnosticsClient client = ...;
EventTracePipeline pipeline = new(client, ...);
await pipeline.StartAsync(...);
await client.ResumeRuntimeAsync(...);There was a problem hiding this comment.
Feel free to defer this as there is nothing technically wrong with how it is.
This PR was co-developed with @wiktork.
Dotnet-Counters and the metrics functionality within Dotnet-Monitor currently share a lot of common logic, and keeping the code separate has resulted in a lot of duplicated work as new features are added to both tools.
This PR encompasses the unification work that takes place in dotnet-counters (a small amount of changes were also required within the dotnet-monitor repo). If you notice any behavior that seems to be inconsistent with what you'd expect, just let us know and we'll look into it - the intent is for this to not be a breaking change for either tool. I plan to do a final round of manual testing prior to merging in these changes, once all other feedback has been resolved.
Another PR contains functional tests to reduce the likelihood of breaking changes - these changes do not depend on each other.