Dynatrace
Dynatrace is a software intelligence platform that monitors and optimizes application performance, development and security, IT infrastructure, and user experience. The Dynatrace Software Intelligence Platform maps, and monitors applications, microservices, container orchestration platforms such as Kubernetes, and IT infrastructure running in multi-cloud and hybrid-cloud environments, and provides automated problem remediation.
Nobl9 integration with Dynatrace allows users to fetch metric datapoints via metric v2 API with a one-minute resolution. Users can provide a custom selector (by providing value for the metricSelector parameter of the API).
Dynatrace's metricSelector
allows you to query for multiple metrics at once. Note that Nobl9 treats SLO data points as time series. Effectively, it means that Nobl9 rejects any datapoint with a timestamp already stored for a given SLO.
To avoid uncertainty, query for data points for only one metric.
Scope of support
- Query parameters retrieval with
sloctl
- SLI Analyzer
- Replay
- Event logs for direct connection method
- Query checker
Nobl9 integration with Dynatrace supports only metrics obtained via the metricSelector
clause. For details, see Metrics API - Get Metric Data Points | Dynatrace documentation.
Authentication
When setting up the Nobl9 agent or direct connection to your Dynatrace instance, you must provide an access token with metrics.read
scope activated.
For details on how to get your token, refer to the Dynatrace API - Tokens and authentication | Dynatrace documentation.
Adding Dynatrace as a data source
You can add the Dynatrace data source using the direct or agent connection methods.
Direct connection method
Direct connection to Dynatrace requires users to enter their credentials which Nobl9 stores safely.
Nobl9 Web
To set up this type of connection:
- Navigate to Integrations > Sources.
- Click
.
- Click the required Source icon.
- Choose Agent.
-
Select one of the following Release Channels:
- The
stable
channel is fully tested by the Nobl9 team. It represents the final product; however, this channel does not contain all the new features of abeta
release. Use it to avoid crashes and other limitations. - The
beta
channel is under active development. Here, you can check out new features and improvements without the risk of affecting any viable SLOs. Remember that features in this channel can change.
- The
-
Add the URL to connect to your data source (mandatory).
Depending on the type of environment, the URL must match one of the following formats:-
SaaS:
<https://{your-environment-id}.live.dynatrace.com>
-
Managed:
<https://{your-domain}/e/{your-environment-id}>
-
Environment ActiveGate:
<https://{your-activegate-domain}/e/{your-environment-id}>
-
-
Enter the Dynatrace Token (mandatory).
To use the Dynatrace API, you must provide an access token withmetrics.read
scope activated. For more information, refer to the Authentication section above.
- Select a Project.
Specifying a project is helpful when multiple users are spread across multiple teams or projects. When the Project field is left blank, Nobl9 uses thedefault
project. - Enter a Display Name.
You can enter a user-friendly name with spaces in this field. - Enter a Name.
The name is mandatory and can only contain lowercase, alphanumeric characters, and dashes (for example,my-project-1
). Nobl9 duplicates the display name here, transforming it into the supported format, but you can edit the result. - Enter a Description.
Here you can add details such as who is responsible for the integration (team/owner) and the purpose of creating it. - Specify the Query delay to set a customized delay for queries when pulling the data from the data source.
- The default value in Dynatrace integration for Query delay is
2 minutes
.
infoChanging the Query delay may affect your SLI data. For more details, check the Query delay documentation. - The default value in Dynatrace integration for Query delay is
- Enter a Maximum Period for Historical Data Retrieval.
- This value defines how far back in the past your data will be retrieved when replaying your SLO based on this data source.
- The maximum period value depends on the data source.
Find the maximum value for your data source. - A greater period can extend the loading time when creating an SLO.
- The value must be a positive integer.
- Enter a Default Period for Historical Data Retrieval.
- It is used by SLOs connected to this data source.
- The value must be a positive integer or
0
. - By default, this value is set to 0. When you set it to
>0
, you will create SLOs with Replay.
- Click Add Data Source
When you run Replay for the Maximum Period for Historical Data Retrieval for Dynatrace (28 days), remember that due to Dynatrace limitations, there may be 1h of degraded resolution at the beginning of the selected time range.
sloctl
The YAML for setting up a direct connection to Dynatrace looks like this:
apiVersion: n9/v1alpha
kind: Direct
metadata:
name: dynatrace-direct
displayName: Dynatrace direct
project: dynatrace-direct
spec:
description: Direct integration with Dynatrace
sourceOf:
- Metrics
dynatrace:
url: "https://{your-environment-id}.live.dynatrace.com"
dynatraceToken: ""
queryDelay:
unit: Minute
value: 720
logCollectionEnabled: false
historicalDataRetrieval:
maxDuration:
value: 28
unit: Day
defaultDuration:
value: 7
unit: Day
Field | Type | Description |
---|---|---|
queryDelay.unit mandatory | enum | Specifies the unit for the query delay. Possible values: Second | Minute . • Check query delay documentation for default unit of query delay for each source. |
queryDelay.value mandatory | numeric | Specifies the value for the query delay. • Must be a number less than 1440 minutes (24 hours). • Check query delay documentation for default unit of query delay for each source. |
logCollectionEnabled optional | boolean | Optional. Defaults to false . Set to true if you'd like your direct to collect event logs. Beta functionality available only through direct release channel. Reach out to support@nobl9.com to activate it. |
releaseChannel mandatory | enum | Specifies the release channel. Accepted values: beta | stable . |
Source-specific fields | ||
dynatrace.dynatraceURL mandatory | string | Interface URL. Depending on the environment, the expected URL format is: • SaaS: https://{your-environment-id}.live.dynatrace.com • Managed: https://{your-domain}/e/{your-environment-id} • ActiveGate: https://{your-activegate-domain}/e/{your-environment-id} |
dynatrace.dynatraceToken mandatory | string, secret | A hash that can be generated in the Dynatrace UI. See authentication for more details. |
Replay-related fields | ||
historicalDataRetrieval optional | n/a | Optional structure related to configuration related to Replay. ❗ Use only with supported sources. • If omitted, Nobl9 uses the default values of value: 0 and unit: Day for maxDuration and defaultDuration . |
maxDuration.value optional | numeric | Specifies the maximum duration for historical data retrieval. Must be integer ≥ 0 . See Replay documentation for values of max duration per data source. |
maxDuration.unit optional | enum | Specifies the unit for the maximum duration of historical data retrieval. Accepted values: Minute | Hour | Day . |
defaultDuration.value optional | numeric | Specifies the default duration for historical data retrieval. Must be integer ≥ 0 and ≤ maxDuration . |
defaultDuration.unit optional | enum | Specifies the unit for the default duration of historical data retrieval. Accepted values: Minute | Hour | Day . |
spec.historicalDataRetrieval
- refer to Replay documentation for more details.
Agent connection method
Nobl9 Web
Follow the instructions below to set up an agent connection.
- Navigate to Integrations > Sources.
- Click
.
- Click the required Source icon.
- Choose Agent.
-
Select one of the following Release Channels:
- The
stable
channel is fully tested by the Nobl9 team. It represents the final product; however, this channel does not contain all the new features of abeta
release. Use it to avoid crashes and other limitations. - The
beta
channel is under active development. Here, you can check out new features and improvements without the risk of affecting any viable SLOs. Remember that features in this channel can change.
- The
-
Add the URL to connect to your data source.
- Select a Project.
Specifying a project is helpful when multiple users are spread across multiple teams or projects. When the Project field is left blank, Nobl9 uses thedefault
project. - Enter a Display Name.
You can enter a user-friendly name with spaces in this field. - Enter a Name.
The name is mandatory and can only contain lowercase, alphanumeric characters, and dashes (for example,my-project-1
). Nobl9 duplicates the display name here, transforming it into the supported format, but you can edit the result. - Enter a Description.
Here you can add details such as who is responsible for the integration (team/owner) and the purpose of creating it. - Specify the Query delay to set a customized delay for queries when pulling the data from the data source.
- The default value in Dynatrace integration for Query delay is
2 minutes
.
infoChanging the Query delay may affect your SLI data. For more details, check the Query delay documentation. - The default value in Dynatrace integration for Query delay is
- Enter a Maximum Period for Historical Data Retrieval.
- This value defines how far back in the past your data will be retrieved when replaying your SLO based on this data source.
- The maximum period value depends on the data source.
Find the maximum value for your data source. - A greater period can extend the loading time when creating an SLO.
- The value must be a positive integer.
- Enter a Default Period for Historical Data Retrieval.
- It is used by SLOs connected to this data source.
- The value must be a positive integer or
0
. - By default, this value is set to 0. When you set it to
>0
, you will create SLOs with Replay.
- Click Add Data Source
When you run Replay for the Maximum Period for Historical Data Retrieval for Dynatrace (28 days), remember that due to Dynatrace limitations, there may be 1h of degraded resolution at the beginning of the selected time range.
sloctl
The YAML for setting up an agent connection to Dynatrace looks like this:
apiVersion: n9/v1alpha
kind: Agent
metadata:
name: dynatrace
displayName: Dynatrace Agent
project: dynatrace
spec:
sourceOf:
- Metrics
- Services
releaseChannel: beta
queryDelay:
unit: Minute
value: 720
dynatrace:
url: https://your-environment-id.live.dynatrace.com
historicalDataRetrieval:
maxDuration:
value: 28
unit: Day
defaultDuration:
value: 7
unit: Day
Field | Type | Description |
---|---|---|
queryDelay.unit mandatory | enum | Specifies the unit for the query delay. Possible values: Second | Minute . • Check query delay documentation for default unit of query delay for each source. |
queryDelay.value mandatory | numeric | Specifies the value for the query delay. • Must be a number less than 1440 minutes (24 hours). • Check query delay documentation for default unit of query delay for each source. |
releaseChannel mandatory | enum | Specifies the release channel. Accepted values: beta | stable . |
Source-specific fields | ||
dynatrace.dynatraceURL mandatory | string | Interface URL. Depending on the environment, the expected URL format is: • SaaS: https://{your-environment-id}.live.dynatrace.com • Managed: https://{your-domain}/e/{your-environment-id} • ActiveGate: https://{your-activegate-domain}/e/{your-environment-id} |
Replay-related fields | ||
historicalDataRetrieval optional | n/a | Optional structure related to configuration related to Replay. ❗ Use only with supported sources. • If omitted, Nobl9 uses the default values of value: 0 and unit: Day for maxDuration and defaultDuration . |
maxDuration.value optional | numeric | Specifies the maximum duration for historical data retrieval. Must be integer ≥ 0 . See Replay documentation for values of max duration per data source. |
maxDuration.unit optional | enum | Specifies the unit for the maximum duration of historical data retrieval. Accepted values: Minute | Hour | Day . |
defaultDuration.value optional | numeric | Specifies the default duration for historical data retrieval. Must be integer ≥ 0 and ≤ maxDuration . |
defaultDuration.unit optional | enum | Specifies the unit for the default duration of historical data retrieval. Accepted values: Minute | Hour | Day . |
You can deploy only one agent in one YAML file by using the sloctl apply
command.
Agent deployment
When you add the data source, Nobl9 automatically generates a Kubernetes configuration and a Docker command line for you to use to deploy the agent. Both of these are available in the web UI, under the Agent Configuration section. Be sure to swap in your credentials (e.g., replace <DYNATRACE_TOKEN>
in the following YAML with your Dynatrace access token with metrics.read
scope activated).
- Kubernetes
- Docker
If you use Kubernetes, you can apply the supplied YAML config file to a Kubernetes cluster to deploy the agent. It will look something like this:
# DISCLAIMER: This deployment description contains only the fields necessary for the purpose of this demo.
# It is not a ready-to-apply Kubernetes deployment description, and the client_id and client_secret are only exemplary values.
apiVersion: v1
kind: Secret
metadata:
name: nobl9-agent-nobl9-dev-mydynatrace-b
namespace: default
type: Opaque
stringData:
dynatrace_token: <DYNATRACE_TOKEN>
client_id: "unique_client_id"
client_secret: "unique_client_secret"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nobl9-agent-nobl9-dogfood-default-dynatrace-agent
namespace: default
spec:
replicas: 1
selector:
matchLabels:
nobl9-agent-name: dynatrace-agent
nobl9-agent-project: default
nobl9-agent-organization: nobl9-dogfood
template:
metadata:
labels:
nobl9-agent-name: dynatrace-agent
nobl9-agent-project: default
nobl9-agent-organization: nobl9-dogfood
spec:
containers:
- name: agent-container
image: nobl9/agent:0.80.0
resources:
requests:
memory: "350Mi"
cpu: "0.1"
env:
- name: N9_CLIENT_ID
valueFrom:
secretKeyRef:
key: client_id
name: nobl9-agent-nobl9-dogfood-default-dynatrace-agent
- name: N9_CLIENT_SECRET
valueFrom:
secretKeyRef:
key: client_secret
name: nobl9-agent-nobl9-dogfood-default-dynatrace-agent
- name: DYNATRACE_TOKEN
valueFrom:
secretKeyRef:
key: dynatrace_token
name: nobl9-agent-nobl9-dogfood-default-dynatrace-agent
# The N9_METRICS_PORT is a variable specifying the port to which the /metrics and /health endpoints are exposed.
# The 9090 is the default value and can be changed.
# If you don’t want the metrics to be exposed, comment out or delete the N9_METRICS_PORT variable.
- name: N9_METRICS_PORT
value: "9090"
If you use Docker, you can run the supplied Docker command to deploy the agent. It will look something like this:
# DISCLAIMER: This Docker command contains only the fields necessary for the purpose of this demo.
# It is not a ready-to-apply command, and you will need to replace the placeholder values with your own values.
docker run -d --restart on-failure \
--name nobl9-agent-nobl9-dev-mydynatrace-dynatraceagent \
-e N9_CLIENT_ID="unique_client_id" \
-e N9_CLIENT_SECRET="unique_client_secret" \
# The N9_METRICS_PORT is a variable specifying the port to which the /metrics and /health endpoints are exposed.
# The 9090 is the default value and can be changed.
# If you don’t want the metrics to be exposed, comment out or delete the N9_METRICS_PORT variable.
-e N9_METRICS_PORT=9090 \
-e DYNATRACE_TOKEN="<DYNATRACE_TOKEN>" \
nobl9/agent:0.80.0
Creating SLOs with Dynatrace
Nobl9 Web
Follow the instructions below to create your SLOs with Dynatrace in the UI:
-
Navigate to Service Level Objectives.
-
Click
.
-
In step 1 of the SLO wizard, select the Service the SLO will be associated with.
-
In step 2, select Dynatrace as the Data Source for your SLO, then specify the Metric. You can choose either a Threshold Metric, where a single time series is evaluated against a threshold, or a Ratio Metric, which allows you to enter two time series to compare (for example, a count of good requests and total requests).
- Choose the Data Count Method for your ratio metric:
- Non-incremental: counts incoming metric values one-by-one. So the resulting SLO graph is pike-shaped.
- Incremental: counts the incoming metric values incrementally, adding every next value to previous values.
It results in a constantly increasing SLO graph.
- Choose the Data Count Method for your ratio metric:
-
Enter a Metric Selector, or Metric selector for good counter and Metric selector for total counter for the metric you selected.
- Metric selector selects metrics for the query by their keys.
- You can select up to 10 metrics for one query.
metricSelector
can be obtained from the Dynatrace v2 API. In the Custom chart area, select the Try it out button. Then, in the Data Explorer, select the Code tab.
For more information and query samples, refer to the Creating Dynatrace SLOs with sloctl section below.
SLI values for good and totalWhen 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
.
-
In step 3, define a Time Window for the SLO.
-
Rolling time windows are better for tracking the recent user experience of a service.
-
Calendar-aligned windows are best suited for SLOs that are intended to map to business metrics measured on a calendar-aligned basis, such as every calendar month or every quarter.
-
In step 4, specify the Error Budget Calculation Method and your Objective(s).
- Occurrences method counts good attempts against the count of total attempts.
- Time Slicesmethod 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.
See the use case example and the SLO calculations guide for more information on the error budget calculation methods.
-
In step 5, add the Display name, Name, and other settings for your SLO:
- Create a composite SLO
- Set notification on data, if this option is available for your data source.
When activated, Nobl9 notifies you if your SLO hasn't received data or received incomplete data for more than 15 minutes. - Add alert policies, labels, and links, if required.
You can add up to 20 links per SLO.
-
Click Create SLO.
sloctl
- rawMetric
- countMetric
Here’s an example of Dynatrace using a rawMetric
(threshold metric):
apiVersion: n9/v1alpha
kind: SLO
metadata:
name: dynatrace-slo-example
project: dynatrace
spec:
service: dynatrace-service
indicator:
metricSource:
name: dynatrace
timeWindows:
- unit: Day
count: 7
isRolling: true
budgetingMethod: Occurrences
objectives:
- displayName: Good
op: lte
rawMetric:
query:
dynatrace:
metricSelector: builtin:synthetic.http.duration.geo:filter(and(in("dt.entity.http_check",entitySelector("type(http_check),entityName(~"API Sample~")")),in("dt.entity.synthetic_location",entitySelector("type(synthetic_location),entityName(~"N. California~")")))):splitBy("dt.entity.http_check","dt.entity.synthetic_location"):avg:auto:sort(value(avg,descending)):limit(20)
value: 150
target: 0.50
- displayName: Moderate
op: lte
rawMetric:
query:
dynatrace:
metricSelector: builtin:synthetic.http.duration.geo:filter(and(in("dt.entity.http_check",entitySelector("type(http_check),entityName(~"API Sample~")")),in("dt.entity.synthetic_location",entitySelector("type(synthetic_location),entityName(~"N. California~")")))):splitBy("dt.entity.http_check","dt.entity.synthetic_location"):avg:auto:sort(value(avg,descending)):limit(20)
value: 200
target: 0.75
- displayName: Annoying
op: lte
rawMetric:
query:
dynatrace:
metricSelector: builtin:synthetic.http.duration.geo:filter(and(in("dt.entity.http_check",entitySelector("type(http_check),entityName(~"API Sample~")")),in("dt.entity.synthetic_location",entitySelector("type(synthetic_location),entityName(~"N. California~")")))):splitBy("dt.entity.http_check","dt.entity.synthetic_location"):avg:auto:sort(value(avg,descending)):limit(20)
value: 300
target: 0.95
Here’s an example of Dynatrace using a countMetric
(ratio metric):
apiVersion: n9/v1alpha
kind: SLO
metadata:
name: dynatrace-slo-ratio
displayName: Dynatrace Ratio
project: dynatrace
spec:
budgetingMethod: Occurrences
indicator:
metricSource:
kind: Agent
name: dynatrace
project: dynatrace
objectives:
- countMetrics:
good:
dynatrace:
metricSelector: >
builtin:synthetic.http.request."statusCode":filter(
and(in("dt.entity.http_check_step",entitySelector("type(http_check_step),
entityName(~"httpbin.org~")")),eq("Status code",SC_2xx),
in("dt.entity.synthetic_location",entitySelector("type(synthetic_location),
entityName(~"N. California~")")))):
splitBy("Status code","dt.entity.http_check_step","dt.entity.synthetic_location"):
count:auto:sort(value(avg,descending)):limit(20)
incremental: false
total:
dynatrace:
metricSelector: >
builtin:synthetic.http.request."statusCode":filter(
and(in("dt.entity.http_check_step",entitySelector("type(http_check_step),
entityName(~"httpbin.org~")")),in("dt.entity.synthetic_location",
entitySelector("type(synthetic_location),entityName(~"N. California~")")))):
splitBy("dt.entity.synthetic_location","dt.entity.http_check_step"):
count:auto:sort(value(avg,descending)):limit(20)
displayName: Enough
target: 0.5
value: 1
service: dynatrace-demo-service
timeWindows:
- count: 1
isRolling: true
period:
begin: "2021-05-05T10:39:55Z"
end: "2021-05-05T11:39:55Z"
unit: Hour
Metric specification from Dynatrace requires one field:
dynatrace.metricSelector
– mandatory, string. You can try out yourmetricSelector
in the Data Explorer tool. In the Custom chart area, click the Try it out button. Then, in the Data Explorer, select the Code tab:
![](/img/dynatrace-2.png)
Dynatrace metricSelector
is a powerful instrument for specifying which metrics you want to read with the GET metric data points. By using metricSelector
, you can transform the resulting set of data points. For more details, go to Metrics API - Metric Selector | Dynatrace documentation.
Querying the Dynatrace server
Nobl9 calls the Dynatrace server every minute to retrieve the raw data.