Dynatrace Managed SLO: configuration, limits and API (tutorial)

Dynatrace Managed SLO: define the SLI with a metric selector, create the SLO through API v2, check the error budget and know the limits compared with SaaS.
SLO Dynatrace Managed : configuration, limites et API (tutoriel)

You run an on-premise cluster and you want measurable reliability targets, not just dashboards. A Dynatrace Managed SLO exists, but it does not behave like the new SLOs of the SaaS platform: no Grail, no DQL, everything relies on metric selectors. Many teams discover these differences only when they wire up alerting.

Goal: by the end of this tutorial you will have an availability SLO on a critical service, created through the UI and then through the Environment API v2, versioned as JSON, and you will know how to check its status and error budget. The content applies to Dynatrace Managed. Differences with Dynatrace SaaS are covered in a dedicated section.

If you have not chosen your indicators yet, start with choosing your SLIs: an SLO is only useful when the SLI reflects the user experience.

The problem: a Dynatrace Managed SLO is not a Grail SLO

On recent SaaS, an SLO is built on a DQL query and Grail data. On Managed, an SLO is an environment configuration object, evaluated from a metric expression (metric selector) over classic metrics such as builtin:service.*. In practice:

  • the SLI must be expressible with the metrics available in the environment (built-in, calculated or ingested);
  • the evaluation window is a relative timeframe (for example -1w), not a free calendar;
  • the cluster’s metric retention limits how much history you can use.

Prerequisites

  • An up-to-date Dynatrace Managed environment with at least one service monitored by OneAgent.
  • A user allowed to change the environment configuration.
  • An environment API token with the slo.read and slo.write scopes (plus metrics.read for verification). The exact scope names are listed on the token creation page: check them for your version.
  • curl and jq on your workstation.

In the examples, the Managed API URL follows the pattern https://{your-cluster}/e/{environment-id}/api/v2/.

Step 1: define the SLI with a metric selector

Take an availability SLI: the percentage of server requests without errors. Test the expression first in the data explorer, or through the metrics API:

export DT_ENV="https://cluster.example.com/e/abc12345"
export DT_TOKEN="dt0c01.XXXX"

curl -s -G "$DT_ENV/api/v2/metrics/query" \
  -H "Authorization: Api-Token $DT_TOKEN" \
  --data-urlencode 'metricSelector=(100)*(builtin:service.errors.server.successCount:splitBy())/(builtin:service.requestCount.server:splitBy())' \
  --data-urlencode 'entitySelector=type(SERVICE),entityId(SERVICE-0123456789ABCDEF)' \
  --data-urlencode 'from=-1w' | jq '.result[0].data[0].values[-5:]'

Critical points: both operands must cover the same entity, and splitBy() with no argument aggregates everything. If the query returns empty values, the metric does not exist under that name in your version: list metrics with GET /api/v2/metrics?text=service.errors.

Step 2: create the Dynatrace Managed SLO in the UI

In the menu, open Service-level objectives (the label may vary by version), then add an SLO. Fill in:

  1. the name and a short metric name (used to build the func:slo.* metrics);
  2. the metric expression from step 1;
  3. the entity filter (the service concerned);
  4. the target (for example 99.5) and the warning threshold (for example 99.8);
  5. the evaluation window (for example 7 days).

The wizard also offers predefined templates. They are handy for a first try, but keep the expression explicit so it can be reviewed.

Step 3: create the same SLO through the API

To avoid configuration drift between environments, describe the SLO in a versioned file:

{
  "enabled": true,
  "name": "checkout - availability",
  "customDescription": "Server requests without errors, checkout service",
  "metricName": "checkout_availability",
  "metricExpression": "(100)*(builtin:service.errors.server.successCount:splitBy())/(builtin:service.requestCount.server:splitBy())",
  "evaluationType": "AGGREGATE",
  "filter": "type(\"SERVICE\"),entityId(\"SERVICE-0123456789ABCDEF\")",
  "target": 99.5,
  "warning": 99.8,
  "timeframe": "-1w"
}
curl -s -X POST "$DT_ENV/api/v2/slo" \
  -H "Authorization: Api-Token $DT_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d @slo-checkout.json -i | head -n 1

A 201 response confirms creation. The exact body schema may change between cluster versions: compare it with the SLO API reference on docs.dynatrace.com before automating it. To manage many SLOs, Terraform remains the most robust route, detailed in Dynatrace SLO with Terraform.

Step 4: wire up an alert

An SLO without an alert is just a number. On Managed there are two approaches: an alert on status or error budget, and a burn rate alert through a metric event on the func:slo.* metrics. The second is the most useful for on-call; it is covered step by step in SLO burn rate alerts. Then route the alert with a dedicated alerting profile, as explained in alerting profiles and integrations.

How to check that it works

  1. List the SLOs and get the identifier:
    curl -s "$DT_ENV/api/v2/slo?pageSize=25&evaluate=true" \
      -H "Authorization: Api-Token $DT_TOKEN" \
      | jq '.slo[] | {id, name, status, evaluatedPercentage, errorBudget}'
  2. Check that evaluatedPercentage is close to the value from step 1. Without evaluate=true, the list does not evaluate SLOs (page size is then capped at 25). A large gap often points to a different entity filter.
  3. If the status stays empty or in error, the error field of the response usually gives the cause (invalid expression, missing entity).
  4. In the UI, the SLO page should show the status, the remaining error budget and the trend.

Limits to know on Managed

  • No DQL: an SLI that needs to combine logs and traces must first become a metric (calculated metric or ingestion).
  • Retention: metric resolution decreases as data ages, according to the cluster policy; a 30-day window is possible, but precision depends on your configuration.
  • Load: every SLO is evaluated regularly. Dozens of SLOs with heavy expressions weigh on the cluster; keep expressions simple.
  • Missing SaaS features: Grail SLOs, the platform app form of Site Reliability Guardian and Workflows are not available on Managed. Check the availability matrix in the documentation.

Differences with Dynatrace SaaS

On SaaS, classic SLOs remain available in the relevant environments, but the new SLOs rely on DQL and Grail, which allows SLIs on any data, including OpenTelemetry. If you are preparing a migration, keep your SLIs simple and documented: they will translate more easily. For the SaaS side, see OpenTelemetry SLOs with DQL.

Best practices

  • One SLO per critical user journey, not one per microservice.
  • Warning threshold above the target, so you react before the budget runs out.
  • Versioned JSON or Terraform files, reviewed like code: less toil, fewer manual mistakes.
  • Stable metric name: renaming it breaks the alerts and dashboards that depend on it.
  • Monthly error budget review with the product team, in a blameless way.

Frequently asked questions

Can OpenTelemetry metrics feed a Managed SLO?

Yes, if they are ingested as metrics into the environment and can be queried with a metric selector. Check the query with the metrics API first.

Which evaluation window should I choose?

Seven days suit team-level steering. Thirty days better match a contractual commitment, subject to your cluster’s retention.

Should each team have its own token?

It is recommended: one token per pipeline, with only the SLO scopes it needs, limits the impact of a leak and makes auditing easier.

Conclusion

SLOs on Managed demand more rigour on the SLI, but they give you a solid base: a tested metric expression, an object versioned through the API, a burn rate alert. Start with one critical service, measure for a week, then expand.

span.observer is an independent community blog, not affiliated with Dynatrace LLC. Dynatrace is a trademark of its owner. Screens and API fields may vary with your cluster version: check them in the official documentation.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
Postmortem sans blâme avec Dynatrace : modèle de document et requêtes DQL

Blameless postmortem with Dynatrace: a document template and DQL queries

Next Post
SLO Dynatrace Grafana : le comparatif avec Prometheus mis en pratique

Dynatrace vs Grafana SLO: a hands-on comparison with Prometheus

Related Posts