Automations
All questions related to Workflow Automation, AutomationEngine, and EdgeConnect, as well as integrations with various tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create a custom metrics from DQL query and send a message on Microsoft Teams

Mardock
Newcomer
Hi everyone,
I’m looking for guidance on how to create a custom metric in Dynatrace with DQL query  and then use the result to send a notification/post to Microsoft Teams

If you have examples, best practices, or links to relevant documentation, I’d really appreciate it.
Thanks in advance!

Mardock
1 REPLY 1

t_pawlak
Leader

Hi,
I think that you can’t directly “push” the result of a DQL query to Microsoft Teams, but There are two supported ways to achieve this in Dynatrace, depending on whether you really need a stored custom metric or just want to use DQL results to post to Teams.
If your DQL is based on logs, create a log metric using DQL matchers, then alert on that metric using Metric events, and finally send the notification to Microsoft Teams.
1. Settings → Log Monitoring → Metrics extraction → Add log metric). This uses a DQL-based matcher
https://docs.dynatrace.com/docs/analyze-explore-automate/logs/lma-log-processing/lma-log-metrics
2. Create alerting using Metric events https://docs.dynatrace.com/docs/dynatrace-intelligence/anomaly-detection/metric-events
3. Send to Teams using webhook.

On the other hand, ifyour goal is simply “run a DQL query and post the result to Teams”, you can do it directly with Workflows. Use Workflows action: Execute DQL Query to run your query and get results for subsequent steps
https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/default-workflow-actions/dql-quer...
and add Microsoft Teams Connector → Send message and format the message https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/actions/microsoft-teams

Featured Posts