Skip to main content

This is possibly a silly question.


I am currently migrating from OpsGenie where I am using their Amazon RDS integrationhttps://support.atlassian.com/opsgenie/docs/integrate-opsgenie-with-amazon-rds/ for RDS events https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Subscribing.html


It’s basically an SNS integration.


This works fine, but I can’t get it working with PagerDuty


Does PD support RDS events? I can’t find anything on these forums discussing them. It appears, from poking around in the OpsGenie debug log that the payload for the message from SNS is the following


{
"Message": "{\\"Event Source\\":\\"db-instance\\",\\"Event Time\\":\\"2024-01-09 16:02:46.891\\",\\"Identifier Link\\":\\"https://console.aws.amazon.com/rds/home?region=eu-west-1#dbinstance:id=mysql8\\",\\"Source ID\\":\\"mysql8\\",\\"Source ARN\\":\\"arn:aws:rds:eu-west-1:XXX:db:mysql8\\",\\"Event ID\\":\\"http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html#RDS-EVENT-0087\\",\\"Event Message\\":\\"DB instance stopped\\",\\"Tags\\":{\\"Maintainer\\":\\"DevOps\\",\\"Owner\\":\\"Lendinvest\\",\\"Managed_by\\":\\"Terraform\\",\\"Environment\\":\\"sandbox\\",\\"Name\\":\\"mysql8\\"}}",
"MessageAttributes":
{
"EventID":
{
"Type": "String",
"Value": "RDS-EVENT-0087"
},
"Resource":
{
"Type": "String",
"Value": "arn:aws:rds:eu-west-1:XXX:db:mysql8"
}
},
"MessageId": "45371776-5863-5bc8-86fa-4961280477b2",
"Signature": "Lb9DHoOBBCof0T3BDffI+0zPMpgna/EzhLyEkgfAhitSo+RAIagnM5GYmxx1H8gli8I9RJs42uYjD1/ei1ocd8y1/9equ60A8fLAoPErpfmqURdT3LtrKJvxBjlrHUPmaYyoQitBQMLzCNElLHxzPG73Iu3j9ltFxCzxApKXXlmax6y4/hJRpbMU/Ud71ECDMLNzSeg+Y8Kjzy4qebeQlgHyfOLMNzXCSxBDj8SRjPnOWq4OcF7ZCLXB5Cm03lM8r7RA72pTNcMwiiK5QgxS2TrvG9odxmOSF3OJ2nvGk1D6ybJc4tE7SDzJvryt/G8kecYMPmVKma0M77GZdrTptg==",
"SignatureVersion": "1",
"SigningCertURL": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-01d088a6f77103d0fe307c0069e40ed6.pem",
"Subject": "RDS Notification Message",
"Timestamp": "2024-01-09T16:02:47.409Z",
"TopicArn": "arn:aws:sns:eu-west-1:XXX:RdsEvents",
"Type": "Notification",
"UnsubscribeURL": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:XXX:RdsEvents:ba393ab1-86bb-4191-9e36-7295728e7b5f"

}


But when this is sent I get nothing in PagerDuty, although the SNS delivery logs say it was accepted


{
"notification": {
"messageMD5Sum": "fce9c513e01b1f08531192c6b2e6bcb3",
"messageId": "45371776-5863-5bc8-86fa-4961280477b2",
"topicArn": "arn:aws:sns:eu-west-1:XXX:RdsEvents",
"timestamp": "2024-01-09 16:15:18.501"
},
"delivery": {
"deliveryId": "6b998ef2-e4c3-57ef-8ae8-d0e59795a214",
"destination": "https://events.eu.pagerduty.com/integration/xxxxx/enqueue",
"providerResponse": "Accepted",
"dwellTimeMs": 192,
"statusCode": 202
},
"status": "SUCCESS"

}


Does PD have anything like the OpsGenie debug log, rather than requests just disappearing into the void when they can’t be processed?

Hello @stephen!


PagerDuty does not provide a direct integration with Amazon RDS events but you can setup something similar to what you referred to in OpsGenie. The main difference here is that OpsGenie seems to use an APIKey as part of the URL that you configure as a subscription for the SNS Topic and you just send the RAW event from RDS. We do it differently.


To ingest data in PagerDuty you use the Events API - the endpoint is always the same -> https://events.pagerduty.com/v2/enqueue. This API requires a routing_key so we can redirect the event to the correct service in PagerDuty, apply mechanisms to aggregate events, reducing noise for you and your team. You can generate this key on a service level, or globally and then use Event Orchestration (requires AIOps).


Below is an example of the body of a request.


"payload": {
"summary": "DISK at 99% on machine prod-datapipe03.example.com",
"timestamp": "2015-07-17T08:42:58.315+0000",
"severity": "critical",
"source": "prod-datapipe03.example.com",
"component": "mysql",
"group": "prod-datapipe",
"class": "disk",
"custom_details": {
"free space": "1%",
"ping time": "1500ms",
"load avg": 0.75
}
},
"routing_key": "R03DY2M1RGJBE25G57OK7WFQ1T3TOZ6A",
"event_action": "trigger"
}

So, this means that you cannot just send the RDS event directly to PagerDuty but you need to transform it. For that, I would recommend one of two approaches:



  1. Use SNS Topic and add a subscriber which is your API (Lambda function or something else) that gets the event from RDS and builds the correct payload based on the event attributes and sends it to PagerDuty.

  2. Use Amazon Event Bridge, define RDS events as a source, apply a transformation to the payload, define PagerDuty Events API as the target.


The second option might be more resilient because Event Bridge will be responsible for retrying if something fails but it is up for you to choose the option that works best in your case.


I hope this helps. Let me know if you need more help.


Thanks, guessing the same is true for SES feedback notifications. I shall look into event bridge then


Reply