Slack alert documentation for Dataform

I’ve created a log-based alert for Dataform workflow failures sent through Slack
I want to include workflow name (Workflow config ID) in the alert message in Slack but couldn’t do it
Here is the alert documentation (Slack message format) versions which I tried to use :

Log-based alert in project ${project} detected a failed Dataform workflow.

Dataform workflow with configuration ID:
${log.extracted_label.workflowConfigId} has failed in repository ${resource.labels.repository_id}.

*See details here: https://console.cloud.google.com/dataform/repositories/${resource.labels.location}/${resource.labels.repository_id}/workflow-executions;query=${payload.jsonPayload.workflowInvocationId}
*
I also tried the following syntaxes to get the workflow config ID :
${jsonPayload.workflowConfigId}

Can anyone help if you know how to do it ?

Thanks in advance

Hi HossamM2Dergham,

It looks like you are encountering an issue where your Slack alerts for Dataform workflow failures are missing the workflow name (Workflow Config ID). Despite trying different syntaxes like ‘${log.extracted_label.workflowConfigId}’ and ‘${jsonPayload.workflowConfigId}’, you’re unable to extract and display this key detail, making it more difficult to quickly pinpoint which workflow has failed.

Here are the potential ways that might help with your use case:

  • Inspect your Dataform failure logs in Cloud Logging: You may want to review your Dataform failure logs in Cloud Logging to identify the exact field and path—such as jsonPayload.dataform.workflowConfig.name or jsonPayload.workflowName—that contains your workflow identifier. This ensures you’re referencing the correct value in your alerts or monitoring setup.

  • Access workflowConfigId via jsonPayload: You may want to consider using ${jsonPayload.workflowConfigId} to obtain the workflow name. Make sure this field is present in your Dataform logs for accurate reference.

  • Enrich Alert Messages: You may want to enrich your alert messages by including more than just the workflow name. Make sure you add your specific error message, any relevant task names, and clear links to the corresponding log entry and your Dataform workflow execution in the Google Cloud Console to streamline troubleshooting.

  • Use Google Cloud Monitoring: You may want to set up your alerts using Google Cloud Monitoring to enhance your workflow visibility. This allows you to define your own failure-specific log filters, configure Slack as your notification channel, and manage your alert frequency and grouping to reduce unnecessary noise.

  • Structure for Action: You may want to make sure your alert includes enough context to help you quickly triage and troubleshoot issues, such as your repository name, project, and execution ID.

For more information, you can check the following documentation below:

1 Like

Hello Marvin,
Thanks for your answer

I found a way few hours ago where I needed to store the workflowConfigId as a label in the alert policy and then call it in the documentation as shown below

It worked out and the alert message in slack showed the workflow name which really helped the team by understanding which workflow failed and just the concerned person checked it directly