AMS Prometheus
Amazon Managed Service for Prometheus (or AMS Prometheus) is a monitoring and alerting service that ensures easy-to-use monitoring of containerized applications and infrastructure. It's scalable, and you don't have to worry about hosting it yourself.
Amazon Prometheus parameters and supported features in Nobl9
- General support:
- Release channel: Stable, Beta
- Connection method: Agent
- Replay and SLI Analyzer: Historical data limit 30 days
- Event logs: Not supported
- Query checker: Not supported
- Query parameters retrieval: Supported
- Timestamp cache persistence: Supported
- Query parameters:
- Query interval: 1 min
- Query delay: 0
- Jitter: 15 sec
- Timeout: 30 sec
- Agent details and minimum required versions for supported features:
- Plugin name: n9prometheus
- Query delay environment variable: PROM_QUERY_DELAY
- Replay and SLI Analyzer: 0.65.0
- Query parameters retrieval: 0.73.2
- Timestamp cache persistence: 0.65.0
- Custom HTTP headers: 0.83.0-beta
- Additional notes:
- Support for Prometheus metrics
- No support for IAM roles for bare EC2 instances
- Learn more
Creating SLOs with AMS Prometheusβ
Nobl9 Webβ
Follow the instructions below to create your SLOs with AWS Prometheus in the Nobl9 Web:
- Navigate to Service Level Objectives.
- Click .
- Select a Service.
It will be the location for your SLO in Nobl9. - Select your Amazon managed service for Prometheus data source.
- Modify Period for Historical Data Retrieval, when necessary.
- This value defines how far back in the past your data will be retrieved when replaying your SLO based on Amazon managed service for Prometheus.
- A longer period can extend the data loading time for your SLO.
- Must be a positive whole number up to the maximum period value you've set when adding the Amazon managed service for Prometheus data source.
- Select the Metric type:
- Threshold metric: a single time series is evaluated against a threshold.
- Ratio metric: two-time series for comparison for good events and total events.
For ratio metrics, select the Data count method: incremental or non-incremental.
countMetrics
), keep in mind that the values ββresulting from that query for both good and total:- Must be positive.
- While we recommend using integers, fractions are also acceptable.
- If using fractions, we recommend them to be larger than
1e-4
=0.0001
. - Shouldn't be larger than
1e+20
.
-
Enter a Query (for the Threshold metric) or Good Query, and Total Query (for the Ratio metric). The following are query examples:
-
Threshold metric for AMS Prometheus: Query:
sum(changes(kube_pod_status_ready{condition="true"}[5m]))
-
Ratio metric for AMS Prometheus: Good Query:
sum(server_requests{code=~"2xx|3xx",host=""})
Total Query:server_requests{code="total",host=""}
-
- Define the Time window for your SLO:
- Rolling time windows constantly move forward as time passes. This type can help track the most recent events.
- Calendar-aligned time windows are usable for SLOs intended to map to business metrics measured on a calendar-aligned basis.
- Configure the Error budget calculation method and Objectives:
- Occurrences method counts good attempts against the count of total attempts.
- Time Slices method measures how many good minutes were achieved (when a system operates within defined boundaries) during a time window.
- You can define up to 12 objectives for an SLO.
Similar threshold values for objectivesTo use similar threshold values for different objectives in your SLO, we recommend differentiating them by setting varying decimal points for each objective.
For example, if you want to use threshold value1
for two objectives, set it to1.0000001
for the first objective and to1.0000002
for the second one.
Learn more about threshold value uniqueness. - Add the Display name, Name, and other settings for your SLO:
- Name identifies your SLO in Nobl9. After you save the SLO, its name becomes read-only.
Use only lowercase letters, numbers, and dashes. - Create composite SLO: with this option selected, you create a composite SLO 1.0. Composite SLOs 1.0 are deprecated. They're fully operable; however, we encourage you to create new composite SLOs 2.0.
You can create composite SLOs 2.0 withsloctl
using the provided template. Alternatively, you can create a composite SLO 2.0 with Nobl9 Terraform provider. - Set Notifications on data. With it, Nobl9 will notify you in the cases when SLO won't be reporting data for more than 15 minutes.
- Add alert policies, labels, and links, if required.
Up to 20 items of each type per SLO is allowed.
- Name identifies your SLO in Nobl9. After you save the SLO, its name becomes read-only.
- Click CREATE SLO
sloctlβ
- Threshold (rawMetric)
- Ratio (countMetric)
apiVersion: n9/v1alpha
kind: SLO
metadata:
name: api-server-slo
displayName: API Server SLO
project: default
labels:
area:
- latency
- slow-check
env:
- prod
- dev
region:
- us
- eu
team:
- green
- sales
annotations:
area: latency
env: prod
region: us
team: sales
spec:
description: Example Amazon Prometheus SLO
indicator:
metricSource:
name: amazon-prometheus
project: default
kind: Agent
budgetingMethod: Occurrences
objectives:
- displayName: Good response (200)
value: 200
name: ok
target: 0.95
rawMetric:
query:
amazonPrometheus:
promql: api_server_requestMsec{host="*",job="nginx"}
op: lte
primary: true
service: api-server
timeWindows:
- unit: Month
count: 1
isRolling: false
calendar:
startTime: 2022-12-01T00:00:00.000Z
timeZone: UTC
alertPolicies:
- fast-burn-5x-for-last-10m
attachments:
- url: https://docs.nobl9.com
displayName: Nobl9 Documentation
anomalyConfig:
noData:
alertMethods:
- name: slack-notification
project: default
apiVersion: n9/v1alpha
kind: SLO
metadata:
name: api-server-slo
displayName: API Server SLO
project: default
labels:
area:
- latency
- slow-check
env:
- prod
- dev
region:
- us
- eu
team:
- green
- sales
annotations:
area: latency
env: prod
region: us
team: sales
spec:
description: Example Amazon Prometheus SLO
indicator:
metricSource:
name: amazon-prometheus
project: default
kind: Agent
budgetingMethod: Occurrences
objectives:
- displayName: Good response (200)
value: 1
name: ok
target: 0.95
countMetrics:
incremental: true
good:
amazonPrometheus:
promql: >-
sum(http_request_duration_seconds_bucket{handler="/api/v1/slos",le="2.5"})
total:
amazonPrometheus:
promql: sum(http_request_duration_seconds_count{handler="/api/v1/slos"})
primary: true
service: api-server
timeWindows:
- unit: Month
count: 1
isRolling: false
calendar:
startTime: 2022-12-01T00:00:00.000Z
timeZone: UTC
alertPolicies:
- fast-burn-5x-for-last-10m
attachments:
- url: https://docs.nobl9.com
displayName: Nobl9 Documentation
anomalyConfig:
noData:
alertMethods:
- name: slack-notification
project: default
Important notes:
-
Specification for metric from Prometheus has one mandatory field:
promql
β a Prometheus query in the PromQL (Prometheus Query Language) that allows the user to select and aggregate time-series data in real-time.
Querying the AMS Prometheus serverβ
Nobl9 agent makes one request to API per minute per unique query. Make sure that your Prometheus server can handle additional traffic. For more details on Amazon service quota, go to Service Quotas | Amazon Managed Service for Prometheus documentation.