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

How to add a Prefix to the names of the default captured metrics #3548

Closed
bradacina opened this issue Feb 12, 2024 · 4 comments
Closed

How to add a Prefix to the names of the default captured metrics #3548

bradacina opened this issue Feb 12, 2024 · 4 comments

Comments

@bradacina
Copy link

Is your feature request related to a problem? Please describe.
We are collecting custom metrics from different micro-services and usually add a prefix to the metric names in each of these micro services so we can have them grouped together in the Metric drop down on Azure Portal (it saves time when creating dashboards; we use a single Application Insights resource for the entire Prod environment). With a new micro service that I'm building I've added the applicationInsights jar and just want to let it capture the default metrics for the time being. Is there a way to set a prefix (in applicationinsights.json or somewhere else?) to the names of all metrics that get sent to Application Insights?

Describe the solution you would like
Set a "NamePrefix" property in applicationinsights.json ?

Describe alternatives you have considered
Did not consider any alternatives.

Thank you in advance.

@heyams
Copy link
Contributor

heyams commented Feb 12, 2024

Hi @bradacina, Application Insights azure portal requires certain metrics (auto-collected) to have fixed names. Ideally, you wouldn't want to add the same prefix to all metrics.
However, you can set your own rolename so that you can group all your metrics under the same role name using metrics filter.

Under the metrics blade, you can use filtering based on the cloud role name:
image

Hope that helps and please let me know if that resolves your issue.

@bradacina
Copy link
Author

Hi @heyams . Thank you for your reply! And sorry for my late reply. I'm on UTC+1 timezone.

Yes we set role names for each of the micro services. What makes it difficult for us right now is that we already have hundreds of metrics with different names (and prefixes - see screenshots) that are grouped together, so easy to "find", but the new metrics from the jar with "standard" names are interspersed between the existing ones. We can specify the Filter after we've selected a metric. And then in the Filter you only get to see the Cloud Role Name that emits that metric ( in our case it'll be just one, because each service outputs prefixed metrics ). So the time was already "spent" looking for the correct metric and the Filter doesn't help much. It would be ideal to add Filter first, and then add Metric.

image
image

Anyway, I don't want to drag this on and waste your time. This is not a feature that is going to make a big impact. I wanted to know if there's a way to prefix the metrics that's all.

@heyams
Copy link
Contributor

heyams commented Feb 13, 2024

@bradacina this is a list of default metrics we collect https://github.com/microsoft/ApplicationInsights-Java/wiki/Default-Metrics-Captured-by-Java-3.0-Agent. Some of these are required by the Applicaiton Insights Azure Portal UI.

You can add prefix to all metrics using OpenTelemetry extension when 3.5 GA is released, but please note that it will break some UI if you're ok with it?

@bradacina
Copy link
Author

Sounds good! Thank you madam!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants