Skip to main content

AMS Prometheus

Reading time: 0 minute(s) (0 words)

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 Opens in a new tab

Creating SLOs with AMS Prometheus​

Nobl9 Web​

Follow the instructions below to create your SLOs with AWS Prometheus in the Nobl9 Web:

  1. Navigate to Service Level Objectives.
  2. Click .
  3. Select a Service.
    It will be the location for your SLO in Nobl9.
  4. Select your Amazon managed service for Prometheus data source.
  5. 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.
  6. 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.
SLI values for good and total
When choosing the query for the ratio SLI (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.
  1. 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=""}

  1. Define the Time window for your SLO:
  2. 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 objectives
      To 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 value 1 for two objectives, set it to 1.0000001 for the first objective and to 1.0000002 for the second one.
      Learn more about threshold value uniqueness.
  3. 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 with sloctl 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.
  4. Click CREATE SLO.

  5. SLO configuration use case
    Check the SLO configuration use case for a real-life SLO example.

sloctl​

Sample Amazon Prometheus threshold SLO
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

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.

For a more in-depth look, consult additional resources: