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
[Docs] document how slack notifications work #4709
Comments
🤖 Hey there, @samhita-alla! 👋 I'm Dosu, a friendly bot that's here to assist you with bugs, answer your queries, and guide you on your journey to become a contributor. While we're waiting for a human maintainer to join us, feel free to ask me anything. How can I assist you today? Sure, I can provide some information on how Slack notifications work in Flyte. Flyte allows you to set up notifications that are triggered based on the state of the execution. These notifications can be of different types such as email, pagerduty, and slack. The notifications are defined in the workflow execution spec and they are published when the execution reaches the specified phase. The code snippet you provided shows how the notifications are published in the Here is the relevant part of the code: var emailNotification admin.EmailNotification
if notification.GetEmail() != nil {
emailNotification.RecipientsEmail = notification.GetEmail().GetRecipientsEmail()
} else if notification.GetPagerDuty() != nil {
emailNotification.RecipientsEmail = notification.GetPagerDuty().GetRecipientsEmail()
} else if notification.GetSlack() != nil {
emailNotification.RecipientsEmail = notification.GetSlack().GetRecipientsEmail()
} else {
logger.Debugf(ctx, "failed to publish notification, encountered unrecognized type: %v", notification.Type)
m.systemMetrics.UnexpectedDataError.Inc()
// Unsupported notification types should have been caught when the launch plan was being created.
return errors.NewFlyteAdminErrorf(codes.Internal, "Unsupported notification type [%v] for execution [%+v]",
notification.Type, request.Event.ExecutionId)
}
// Convert the email Notification into an email message to be published.
// Currently there are no possible errors while creating an email message.
// Once customizable content is specified, errors are possible.
email := notifications.ToEmailMessageFromWorkflowExecutionEvent(
*m.config.ApplicationConfiguration().GetNotificationsConfig(), emailNotification, request, adminExecution)
// Errors seen while publishing a message are considered non-fatal to the method and will not result
// in the method returning an error.
if err = m.notificationClient.Publish(ctx, proto.MessageName(&emailNotification), email); err != nil {
m.systemMetrics.PublishNotificationError.Inc()
logger.Infof(ctx, "error publishing email notification [%+v] with err: [%v]", notification, err)
} This code checks if the notification is of type Slack, and if so, it retrieves the recipient's email addresses. It then creates an email message and publishes it. If there is an error while publishing the message, it logs the error and increments a counter for publish notification errors. Please note that the actual sending of the Slack notification is not handled in this code. This code only prepares the email message to be sent. The actual sending is handled by the The However, the provided context does not show how Slack notifications are specifically handled. The I hope this helps! If you have any more questions, feel free to ask. Sources:
Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Hi, I read the discussion thread and it's talking about how to fix a config error, not about Slack notification specifically. Would you like assistance in drafting documentation on setting up Slack notifications, or perhaps refining the notification documentation to encompass resolving this error? Thx! |
Description
more context: https://discuss.flyte.org/t/14164511/hi-we-are-trying-to-implement-workflow-slack-notifications-w
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: