Skip to content
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

Support additional perf counter providers #1529

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

roji
Copy link
Member

@roji roji commented May 30, 2020

  • Extends infrastructure to allow specifying arbitrary number of perf counter providers.
  • Add support for Kestrel and Npgsql counters.

Closes #1513

Hopefully the perf counter settings I set make sense... to be tested more thoroughly.

/cc @sebastienros @shirhatti @davidfowl

* Extends infrastructure to allow specifying arbitrary number of
  perf counter providers.
* Add support for Kestrel and Npgsql counters.

Closes aspnet#1513
@davidfowl
Copy link
Member

This is excellent 😄

@sebastienros sebastienros merged commit 60ec822 into aspnet:master Jun 2, 2020
@sebastienros
Copy link
Member

How should we make it truly extensible? Or should we even care?
Here we are enlisting npgsql directly. I think it's ok for aspnet/runtime, but what for other libraries?

Counters are special, as they can't be added from the application itself, but on the agent. Maybe we could have some arguments on the driver that would point to a file that contains these counter metadata, and then instead of passing a string like you did here, we could just send the metadata directly with the job. After all the metadata is already contained in the ServerJob object when it's added from the agent. So if any metadata is set when the job is sent, then the agent would just read it too. We can still embed predefined sets (aspnet/runtime/npgsql/...) in the driver.

@davidfowl
Copy link
Member

Wait I thought this let you specify event source names

@roji
Copy link
Member Author

roji commented Jun 2, 2020

Yeah this lets you specify event source names (e.g. System.Runtime, Microsoft-AspNetCore-Server-Kestrel, Npgsql), but the infrastructure reduces all perf counter samples it takes (e.g. average, max), so it needs some metadata to tell it what to do.

We could just perform the various possible reductions for all counters (average, median, max) and output all of them...

@sebastienros
Copy link
Member

Yes, but without metadata you don't see it in the console. For instance imagine you track the aspnet number of requests. It's a counter that always increases. We can track it continuously but how does the driver know what to "record" in the results: max? avg? last? That's why we have metadata.
Or we could just not display anything in this case but keep tracking all the measures. Though I am not sure how useful it would be.

So in the end I think it's better to have some string that represent sets event counters, including the mask the represents the source to listen to.

@sebastienros
Copy link
Member

@roji that's a good idea, at least for the ones that are not described. Or generate these metadata for those which don't have any.

@roji
Copy link
Member Author

roji commented Jun 2, 2020

Could even display all reductions always, doesn't hurt... will open an issue to track.

@sebastienros
Copy link
Member

Wait, I need to revert your change, you modified the identifier which will break all charts.

@sebastienros
Copy link
Member

Or are you ok if I put the old values back?

@roji
Copy link
Member Author

roji commented Jun 2, 2020

You mean the name in MeasurementMetadata? Sure, put the old values back, there's the source which identifies where it came from anyway.

@roji
Copy link
Member Author

roji commented Jun 2, 2020

#1534

@roji roji deleted the MoarCounters branch September 23, 2022 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable collection of new EventCounters in Kestrel
3 participants