At AWS re:Invent 2020, we launched the preview of Amazon Managed Service for Prometheus, an open supply Prometheus-compatible monitoring service that makes it simple to observe containerized functions at scale. With Amazon Managed Service for Prometheus, you need to use the Prometheus question language (PromQL) to observe the efficiency of containerized workloads with out having to handle the underlying infrastructure required to scale and safe the ingestion, storage, alert, and querying of operational metrics.
Amazon Managed Service for Prometheus routinely scales as your monitoring wants develop. It’s a extremely accessible service deployed throughout a number of Availability Zones (AZs) that integrates AWS safety and compliance capabilities. The service provides native help for PromQL in addition to the flexibility to ingest Prometheus metrics from over 150 Prometheus exporters maintained by the open supply group.
With Amazon Managed Service for Prometheus, you may gather Prometheus metrics from Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Container Service (Amazon ECS), and Amazon Elastic Kubernetes Service (Amazon EKS) environments utilizing AWS Distro for OpenTelemetry (ADOT) or Prometheus servers as assortment brokers.
Throughout the preview, we contributed the high-availability alert supervisor to the open supply Cortex venture, a venture offering horizontally scalable, extremely accessible, multi-tenant, long-term retailer for Prometheus. Additionally, we lowered the worth of metric samples ingested by as much as 84 p.c, and supported assortment of metrics for AWS Lambda functions by ADOT.
In the present day, I’m joyful to announce the overall availability of Amazon Managed Service for Prometheus with new options reminiscent of alert supervisor and ruler that help Amazon Easy Notification Service (Amazon SNS) as a receiver vacation spot for notifications from Alert Supervisor. You may combine Amazon SNS with locations reminiscent of e-mail, webhook, Slack, PagerDuty, OpsGenie, or VictorOps with Amazon SNS.
Getting Began with Alert Supervisor and Ruler
To get began within the AWS Administration Console, you may merely create a workspace, a logical house devoted to the storage, alerting, and querying of metrics from a number of Prometheus servers. You may arrange the ingestion of Prometheus metrics to this workspace utilizing Helm and question these metrics. To be taught extra, see Getting began within the Amazon Managed Service for Prometheus Consumer Information.
At basic availability, we added new alert supervisor and guidelines administration options. The service helps two sorts of guidelines: recording guidelines and alerting guidelines. These guidelines information are the identical YAML format as standalone Prometheus, which can be configured after which evaluated at common intervals.
To configure your workspace with a algorithm, select Add namespace in Guidelines administration and choose a YAML format guidelines file.
An instance guidelines file would document CPU utilization metrics in container workloads and triggers an alert if CPU utilization is excessive for 5 minutes.
Subsequent, you may create a brand new Amazon SNS subject or reuse an present SNS subject the place it’ll route the alerts. The alertmanager routes the alerts to SNS and SNS routes to downstream places. Configured alerting guidelines will fireplace alerts to the Alert Supervisor, which deduplicate, group, and route alerts to Amazon SNS through the SNS receiver. Should you’d prefer to obtain e-mail notifications on your alerts, configure an e-mail subscription for the SNS subject you had.
To present Amazon Managed Service for Prometheus permission to ship messages to your SNS subject, choose the subject you intend to ship to, and add the entry coverage block:
When you have a subject to get alerts, you may configure this SNS receiver within the alert supervisor configuration. An instance config file is similar format as Prometheus, however you need to present the config beneath an
alertmanager_config: block in for the service’s Alert Supervisor. For extra details about the Alert Supervisor config, go to Alerting Configuration in Prometheus information.
alertmanager_config: route: receiver: default repeat_interval: 5m receivers: identify: default sns_configs: topic_arn: "arn:aws:sns:us-east-1:123456789012:Notifyme" sigv4: area: us-west-2 attributes: key: severity worth: "warning"
You may exchange the
topic_arn for the subject that you just create whereas establishing the SNS connection. To be taught extra concerning the SNS receiver within the alert supervisor config, go to Prometheus SNS receiver on the Prometheus Github web page.
To configure the Alert Supervisor, open the Alert Supervisor and select Add definition, then choose a YAML format alert config file.
When an alert is created by Prometheus and despatched to the Alert Supervisor, it may be queried by hitting the
ListAlerts endpoint to see all of the energetic alerts within the system. After hitting the endpoint, you may see alerts within the listing of actively firing alerts.
$ curl https://aps-workspaces.us-east-1.amazonaws.com/workspaces/ws-0123456/alertmanager/api/v2/alerts GET /workspaces/ws-0123456/alertmanager/api/v2/alerts HTTP/1.1 Host: aps-workspaces.us-east-1.amazonaws.com X-Amz-Date: 20210628T171924Z ... [ "receivers": [ ], "startsAt": "2021-09-24T01:37:42.393Z", "updatedAt": "2021-09-24T01:37:42.393Z", "endsAt": "2021-09-24T01:37:42.393Z", "standing": , "labels": } ]
A profitable notification will lead to an e-mail obtained out of your SNS subject with the alert particulars. Additionally, you may output messages in JSON format to be simply processed downstream of SNS by AWS Lambda or different APIs and webhook receiving endpoints. For instance, you may join SNS with a Lambda operate for message transformation or triggering automation. To be taught extra, go to Configuring Alertmanager to output JSON to SNS within the Amazon Managed Service for Prometheus Consumer Information.
Sending from Amazon SNS to Different Notification Locations
You may join Amazon SNS to quite a lot of outbound locations reminiscent of e-mail, webhook (HTTP), Slack, PageDuty, and OpsGenie.
- Webhook – To configure a preexisting SNS subject to output messages to a webhook endpoint, first create a subscription to an present subject. As soon as energetic, your HTTP endpoint ought to obtain SNS notifications.
- Slack – You may both combine with Slack’s email-to-channel integration the place Slack has the flexibility to simply accept an e-mail and ahead it to a Slack channel, or you may make the most of a Lambda operate to rewrite the SNS notification to Slack. To be taught extra, see How one can combine Amazon Managed Service for Prometheus with Slack.
- PagerDuty – To customise the payload despatched to PagerDuty, customise the template that’s utilized in producing the message despatched to SNS by adjusting or updating
template_filesblock in your alertmanager definition. To be taught extra, see Utilizing Amazon Managed Service for Prometheus Alert Supervisor to obtain alerts with PagerDuty.
Out there Now
Amazon Managed Service for Prometheus is obtainable at present in 9 AWS Areas: US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Frankfurt), Europe (Eire), Europe (Stockholm), Asia Pacific (Singapore), Asia Pacific (Sydney), and Asia Pacific (Tokyo).
You pay just for what you utilize, based mostly on metrics ingested, queried, and saved. As a part of the AWS Free Tier, you will get began with Amazon Managed Service for Prometheus for 40 million metric samples ingested and 10 GB metrics saved per 30 days. To be taught extra, go to the pricing web page.
If you wish to study AWS observability on AWS, go to One Observability Workshop which offers a hands-on expertise for you on the wide range of toolsets AWS provides to arrange monitoring and observability in your functions.
Please ship suggestions to the AWS discussion board for Amazon Managed Service for Prometheus or by way of your traditional AWS help contacts.
Be taught Extra
To be taught extra and see Amazon Managed Service for Prometheus in motion, register for our webinar and be a part of us on October 6, 2021 at 9:30am PST.