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

Allow passing a namespace with a custom metric #2088

Closed
yoranvanoirschot opened this issue Feb 4, 2022 · 0 comments · Fixed by #2447
Closed

Allow passing a namespace with a custom metric #2088

yoranvanoirschot opened this issue Feb 4, 2022 · 0 comments · Fixed by #2447

Comments

@yoranvanoirschot
Copy link

Is your feature request related to a problem? Please describe.
Currently all custom metrics land in the namespace: 'azure.applicationinsights'. It seems to be possible to provide a Metric namespace through the REST API (https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-custom-overview#sample-custom-metric-publication) and in the C# SDK (https://github.com/microsoft/ApplicationInsights-dotnet/blob/405fd6a9916956f2233520c8ab66110a1f9dcfbc/BASE/src/Microsoft.ApplicationInsights/DataContracts/MetricTelemetry.cs) however this is unavailable from the Java SDK.

Describe the solution you would like
I would like to set the namespace in a similar way to the C# SDK, an example:

var metric = new MetricTelemetry();
metric.setMetricNamespace("<myNamespace>");
metric.setName("<myMetric>");
metric.setValue(50.0);
client.trackMetric(metric);

Preferably we would be able to set a default metric namespace on the TelemetryClient.

Describe alternatives you have considered
Alternatively we prefix the metric name with the namespace. We are using a shared App Insights instance for over 40 applications. This will result in a huge list of metrics. We would rather namespace them per application (or per group of applications).

@ghost ghost added the Needs: Triage 🔍 label Feb 4, 2022
@trask trask self-assigned this Aug 15, 2022
@ghost ghost added the Status: Fixed label Aug 18, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants