Dynatrace
Learn how to set up Dynatrace as a health source for CV
Before you begin
This page assumes you have followed the rest of the steps to set up CV. To learn more, go to Configure CV
Add Dynatrace as a health source
This option is available only if you have configured the service and environment as fixed values.
A Health Source is basically a mapping of a Harness Monitored Service to the Service in a deployment environment monitored by an APM or logging tool.
Define Health Source
In Health Sources, click Add. The Add New Health Source settings appear.

In Select health source type, select Dynatrace.
In Health Source Name, enter a name for the Health Source. For example Quickstart.
Under Connect Health Source, click Select Connector.
In Connector settings, you can choose an existing connector or click New Connector to create a new Connector.

After selecting the connector, click Apply Selected. The Connector is added to the Health Source.
In Select Feature, choose one of the following options. Your choice determines which configuration options appear next.
Configuration
Depending on your feature choice, do the following configuration steps.
Click Next. The Configuration settings appear.
8. Next, you will have the choice between using Metric Packs or Custom Metrics.
In Find a Dynatrace service, enter the name of the desired Dynatrace service. This Dynatrace service must be marked as a key request in order to appear in this dropdown menu.
In Select Metric Packs to be monitored, you can select Infrastructure, Performance, or both.
Click Add Metric if you want to add any specific metric to be monitored (optional) or simply click Submit.
If you click Add Metric, click Map Metric(s) to Harness Services.
In Metric Name, enter the name of the metric.
In Group Name, enter the group name of the metric.
Click Query Specifications and mapping. To build your query, do the following:
In Metric, choose the desired metric from the list.
In Select Metric Filter, choose the desired entity from the list. This will filter your metrics using entitySelectors.
Click Fetch Records to retrieve data for the provided query.
In Assign, choose the services for which you want to apply the metric.
If you select Continuous Verification or Service Health, you will need to configure a risk profile. Expand the following block to learn more.
Finally, Click Submit. The Health Source is displayed in the AI Verify (v1) step.
You can add one or more Health Sources for each APM or logging provider.
Click Next. The Configuration settings will appear. You should see one button, + Add Query.
Click + Add Query.
Choose a Query name and click Submit.
Under Define Query, enter your query. This query can also be a runtime input or expression.
After writing your fixed input query, click Validate to ensure your query is valid.
Then click Run Query. The query must be validated first from the previous step.

Next, complete the field mapping for the Timestamp Identifier, Service Instance Identifier, and Message Identifier. To do so, hit the
+button icon and select the relevant field from the log that appears.
Click Submit. The health source is displayed in the AI Verify (v1) step!
Dynatrace Grail Metrics uses Dynatrace Query Language (DQL) to query timeseries metric data from the Dynatrace Grail data lakehouse. You write a timeseries DQL query, validate it, fetch sample records, and then map the metric value column and service instance dimension to Harness for continuous verification and live monitoring.

Map metric to Harness services
Click Next. The Configuration tab opens. Click + Add Metric.
In Metric Name, enter a name for the metric.
In Group Name, select an existing group or type a new one to create it.

Map Metric(s) to Harness Services
Write and validate the query
Expand Query Specifications and mapping and enter your DQL
timeseriesquery in the DQL Query field. The query must start with thetimeseriescommand.Click Validate. When the query is syntactically correct, a Validation Passed confirmation appears below the query field.
Click Fetch Records. Harness runs the query against your Dynatrace environment and shows the raw JSON response inline.

DQL query, validation, and fetch records
Configure metric values and charts
Expand Metric values and charts. Harness auto-populates the fields based on the sample response. Review and confirm the following:
Metric Value JSON Path — the JSONPath to the metric values array in the response (for example,
['avg(custom.app.response.time)'].[0]).Service Instance Identifier — the JSONPath to the dimension that identifies each service instance (for example,
['host']). Required when Continuous Verification is enabled.
Click Build Chart to preview the timeseries chart from your live data. Verify the chart renders correctly before proceeding.

Metric values and charts with Build Chart
Assign and configure risk profile
Expand Assign and select which services this metric applies to:
SLI — uses the metric to track SLO compliance.
Service Health — monitors the metric continuously outside of deployments.
Continuous Verification — gates deployments based on this metric.
If you select Continuous Verification or Service Health, configure the Risk Category and Deviation Compared to Baseline:
Risk Category — select one of Errors, Infrastructure, Performance/Throughput, Performance/Other, or Performance/Response Time.
Deviation Compared to Baseline — select Higher value is higher risk, Lower value is higher risk, or both, depending on what the metric measures.

Assign section with risk category and deviation settings
Configure advanced thresholds (optional)
Expand Advanced (Optional) to configure metric thresholds. There are two threshold types:
Ignore Thresholds — metrics matching these rules are excluded from anomaly flagging during continuous verification.
Fail-Fast Thresholds — metrics matching these rules immediately fail the verification step.
Click + Add Threshold to define rules by metric type, metric name, and criteria.
Click Submit. The health source is displayed in the AI Verify (v1) step.
Sample Dynatrace queries
Latency
Latency trend over time:
timeseries(avg(response.time))Latency distribution:
histogram(response.time)Latency by application version:
avg(response.time) by application.versionLatency by geographical region:
avg(response.time) by geoip.country_nameLatency spike detection:
spike(response.time)Latency comparison between environments:
avg(response.time) by environmentLatency by HTTP method:
avg(response.time) by http.methodLatency by service:
avg(response.time) by service.nameLatency anomaly detection:
anomaly(response.time)Latency percentiles:
percentile(response.time, 50),percentile(response.time, 90),percentile(response.time, 99)
Traffic
Requests per minute trend:
timeseries(count(request) / 60)Requests by HTTP status code:
count(request) by http.status_codeRequests by user agent:
count(request) by useragent.nameRequests by endpoint and HTTP method:
count(request) by endpoint, http.methodRequests by response time range:
histogram(response.time)Requests by geo-location:
count(request) by geoip.country_nameSlow endpoint detection:
top(avg(response.time), 10, endpoint)Requests by hostname:
count(request) by hostnameRequests by service:
count(request) by service.nameRequests by HTTP version:
count(request) by http.version
Errors
Error rate trend over time:
timeseries(count(error) / count(request) * 100)Top error types:
count(error) by errorTypeError rate by geographical region:
count(error) by geoip.country_nameError rate by application version:
count(error) by application.versionError rate by HTTP status code:
count(error) by http.status_codeError rate by service:
count(error) by service.nameError rate by user agent:
count(error) by useragent.nameError spike detection:
spike(count(error))Error anomaly detection:
anomaly(count(error))
Saturation
CPU utilization across hosts:
avg(cpu.usage) by hostMemory utilization across hosts:
avg(memory.usage) by hostDisk utilization across hosts:
avg(disk.usage) by hostNetwork utilization across hosts:
avg(network.usage) by hostCPU utilization by geographical region:
avg(cpu.usage) by geoip.country_nameMemory utilization by geographical region:
avg(memory.usage) by geoip.country_nameDisk utilization by geographical region:
avg(disk.usage) by geoip.country_nameNetwork utilization by geographical region:
avg(network.usage) by geoip.country_name
Last updated
Was this helpful?