0
votes

I have an application insight component which collect some custom metrics from my application and send a metric alert. I would like to customize the metric alert messages to include custom dimensions..etc. Is there a way to do that please?

For example following example shows, how I created the custom metrics. I wanted properties (message, customdata) to be shown in the alert.

       MetricTelemetry metricLogEntry = new MetricTelemetry("logEntry", 0, 10, 0, 0, 0);

        metricLogEntry.Properties.Add("message", string.Format("INFO - started fireLogEntryTwo"));
        metricLogEntry.Properties.Add("customData", string.Format("id: {0}, methodName: {1}", id, methodName));

        tClient.TrackMetric(metricLogEntry);

custom metric telemetry in app insight portal

1
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.Roman Marusyk
Apologies for the incomplete post earlier.Kasunu
Do you wanna generate alert from code?Roman Marusyk
No, I'd like to customize the default metric alert. Anyway I don't think I have to use this approach anyway. It seems like I have to use a logic app which connect via application insight connector. So that I can send an email with any power query. At the same time, I can customized email body.Kasunu

1 Answers

0
votes

There is not a way to customize the contents of the built in alerts on metric values at this time.

you could use something like Microsoft Flow and the Application Insights connector, or other similar tools to generate the content you need.