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

AppMetrics generates a ton of string and string[] #766

Open
lazarshulekov opened this issue Dec 13, 2023 · 0 comments
Open

AppMetrics generates a ton of string and string[] #766

lazarshulekov opened this issue Dec 13, 2023 · 0 comments

Comments

@lazarshulekov
Copy link

lazarshulekov commented Dec 13, 2023

We found there are two methods that create too much garbage for the GC. Both are inside MetricTags.
Both public string AsMetricName(string metricName) in conjuction with public static MetricTags Concat() create a huge amount of strings and string[]. Especially in the cases where we have a couple of global tags we generate gigbytes of strings which are needed for a single operation - the GetOrAdd inside the DefaultMetricContextRegistry.
In our case we have finite set of Context/Tags combination, so if needed we can provide a unique key when pushing the metrics which can be used inside DefaultMetricContextRegistry.
Can you advise?

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

No branches or pull requests

1 participant