23 Sep 2024 09:23 PM - last edited on 24 Sep 2024 07:42 AM by MaciejNeumann
Hi All,
I hope this message finds you well.
I would like to explore the options available for routing alerts from a single Teams channel to multiple Teams channels. Currently, I am directing all Dynatrace alerts to one Teams channel, and I am interested in finding a way to distribute these alerts to various channels without having to create multiple profiles or alert notifications on the Dynatrace portal.
Any insights or suggestions on how to achieve this would be greatly appreciated.
Thank you for your assistance.
24 Sep 2024 12:22 PM
Hi @amandadi
Regarding the raised concern, simple logic behind the case Dynatrace only pushes the notification to the target integration channel for example teams webhook which means:
You can refer to the below links for more information and how to configure it:
Regards,
Peter.
03 Oct 2024 08:22 PM
Thank you for your inputs @Peter_Youssef !!
03 Oct 2024 03:24 PM
Hey @amandadi ,
There is one way of achieving this which would be using workflows. (If you're on SaaS tenant)
You won't have to worry about alerting profiles and stuff then, but you have to obviously create multiple Teams webhooks. Typically, one per teams' channel.
Create a workflow on SaaS tenant.
Here are the workflow steps.
1. Trigger would be based on Problems. (Select problem trigger)
Consider this as a sample
2. The second step would be to get the required details from problem trigger. (Ideally when we use this trigger, we get the problem data passed as payload to the workflow).
import { execution } from '@dynatrace-sdk/automation-utils';
export default async function ({ execution_id }) {
const ex = await execution(execution_id);
let payload;
//Here the params.event has all the problem related data.
const tags = ex.params.event.entity_tags;
const root_cause_entity_id = ex.params.event.root_cause_entity_id;
const root_cause_entity_name = ex.params.event.root_cause_entity_name;
const display_id = ex.params.event.display_id;
const pid = ex.params.event['event.id'];
const event_state = ex.params.event['event.status'];
const event_transition_state = ex.params.event['event.status_transition'];
const event_category = ex.params.event['event.category']
const event_name = ex.params.event['event.name']
payload =
{
"root_cause_entity_id": root_cause_entity_id,
"root_cause_entity_name": root_cause_entity_name,
"display_id": display_id,
"pid": pid,
"event_state": event_state,
"event_transaction_state": event_transition_state,
"event_category": event_category,
"event_name": event_name
}
return payload;
}
3. Now use this payload in next step to filter out problems and route them to different channels based on your requirement.
Hope this Helps.
Regards,
Maheedhar
03 Oct 2024 08:23 PM
Sure, thank you so much for detailed info, will try this approach @Maheedhar_T .
04 Oct 2024 04:18 AM
Hey Amandadi,
Teams channels support receiving messages via email. You could use that to have 1 email integration that has each channels address in the "to" section.
This solution is only good if the number of problems generated doesn't breach teams thresholds that can be found here so do be careful. If there are high volumes I would explore the options suggested by the other community members.