Set up Grafana for Leapwork Performance

This guide shows you how to connect Leapwork Performance to Grafana Cloud so you can visualize performance test metrics in Grafana dashboards.

Use it when you want to monitor latency, throughput, and error rates across runs.

Before you begin

Make sure you have:

  • A Grafana Cloud account with a Graphite stack

  • A Grafana Cloud access policy token with metrics:write permission

  • A Leapwork Performance company with access to Settings → App Monitoring

  • At least one completed run in Leapwork Performance (for validation)

Note: Leapwork Performance currently supports Grafana integrations only when using the Graphite data source.

Create a Grafana access policy and token

  1. Open Administration → Users and access → Cloud access policies in Grafana Cloud.

  2. Select Create access policy.

  3. Enter a descriptive name, such as Leapwork Performance metrics publish.

  4. Add at least metrics:write. Optionally, add metrics:read.

  5. Save the policy.

  6. Under the new policy, select Add token.

  7. Copy the full token immediately. You cannot view it again.

Note: If you create a token under a predefined read-only policy, it will not include metrics:write. Leapwork Performance requires metrics:write to publish data.

Find the Graphite connection details

In your Grafana Cloud stack details or the Graphite setup page, locate these values:

Detail

Example

Graphite datasource URL

https://graphite-prod-43-prod-ap-south-1.grafana.net/graphite

Graphite ingest URL

https://graphite-prod-43-prod-ap-south-1.grafana.net/graphite/metrics

Graphite username / instance ID

3140687

Note: The datasource URL ends with /graphite. Leapwork Performance must use the ingest endpoint, which ends with /graphite/metrics.

Add the Grafana connection in Leapwork Performance

  1. Open Settings → App Monitoring in Leapwork Performance.

  2. Select the Grafana provider tile.

  3. Enter the connection details using the values from the previous section.

  4. Save the connection.

Recommended field values:

Field

Value

Provider

Grafana

Connection name

Primary Grafana

Graphite ingest URL

https://<stack>.grafana.net/graphite/metrics

Graphite username

Your Graphite instance ID

Access token

Your Grafana Cloud token

Metric namespace

lp.run_results

Default tags

Optional. For example, env:prod,team:perf

Enable automatic publishing

true

Example stored configuration:

{
  "endpoint": "https://graphite-prod-43-prod-ap-south-1.grafana.net/graphite/metrics",
  "username": "3140687",
  "apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "defaultTags": ["env:prod", "team:perf"],
  "metricNamespace": "lp.run_results"
}

Understand how publishing works

Leapwork Performance publishes data to Grafana automatically when a run reaches a terminal state: Finished, Stopped, or Failed.

The backend checks whether the company has an enabled Grafana connection. If it does, Leapwork Performance sends Graphite metric points to the configured ingest endpoint.

Example endpoint:

https://graphite-prod-43-prod-ap-south-1.grafana.net/graphite/metrics

For large payloads, Leapwork Performance publishes in batches:

  • Each batch contains up to 500 metric points.

  • Each batch includes retry handling.

  • Success and failure are logged per batch.

Metric catalog

Leapwork Performance publishes the following metric groups.

Per-step terminal metrics

These metrics are emitted for each step in each selected track item after the run completes.

Metric

Description

lp.run_results.requests_sent

Total requests sent for the step

lp.run_results.errors

Total failed requests for the step

lp.run_results.bytes_sent

Total request body bytes sent

lp.run_results.bytes_received

Total response bytes received

lp.run_results.latency.min_ms

Minimum latency in milliseconds

lp.run_results.latency.avg_ms

Average latency in milliseconds

lp.run_results.latency.median_ms

Median latency in milliseconds

lp.run_results.latency.p90_ms

P90 latency in milliseconds

lp.run_results.latency.p95_ms

P95 latency in milliseconds

lp.run_results.latency.p99_ms

P99 latency in milliseconds

lp.run_results.latency.max_ms

Maximum latency in milliseconds

Run-level summary metrics

These metrics are emitted once per run from weighted summary data.

Metric

Description

lp.run_results.run.latency.avg_ms

Weighted run-wide average latency

lp.run_results.run.latency.p90_ms

Weighted run-wide P90 latency

lp.run_results.run.latency.p95_ms

Weighted run-wide P95 latency

lp.run_results.run.latency.p99_ms

Weighted run-wide P99 latency

lp.run_results.run.peak_throughput

Peak throughput for the run

lp.run_results.run.error_rate_pct

Run-wide error rate percentage

lp.run_results.run.runtime_seconds

Run duration in seconds

lp.run_results.run.peak_load

Peak virtual users for the run

Track-item summary metrics

These metrics are emitted from aggregated track-item statistics.

Metric

Description

lp.run_results.track_item.total_sequences_run

Total sequences completed

lp.run_results.track_item.throughput

Throughput for the run or track item

lp.run_results.track_item.current_virtual_users

Current virtual users

lp.run_results.track_item.alive_agents

Number of alive agents

lp.run_results.track_item.running_sequences

Sequences still running

lp.run_results.track_item.vum_used

Virtual User Minutes (VUM) consumed

Historical timeseries metrics

These metrics are emitted from historical run_data graph points. Use them to visualize a run over time in Grafana.

Metric

Description

lp.run_results.timeseries.requests_per_second

Requests over time for a track item

lp.run_results.timeseries.latency.avg_ms

Average latency over time for a track item

Status-code breakdown metrics

These metrics are emitted from aggregated step status-code counts.

Metric

Description

lp.run_results.status_code.count

Count of responses for a specific HTTP status code

Tags added to metrics

Leapwork Performance attaches Graphite tags to metrics so you can filter, group, and build dashboards.

Base tags

These tags appear on most or all published metrics.

Tag

Description

run_id

Leapwork Performance run ID

run_status

Terminal run status

company_id

Leapwork Performance company ID

company_name

Company name

project_id

Project ID

project_name

Project name

timeline_asset_id

Timeline asset ID

timeline_name

Timeline title

run_name

Timeline name plus UTC timestamp

Step-level tags

These tags appear on per-step metrics.

Tag

Description

track_item_id

Track item ID

step_id

Step ID

step_title

Step title

track_item_selected

Whether the track item was selected for the run

Track-item and status-code tags

These tags appear where applicable.

Tag

Description

geo_location

Track item geo location

status_code

HTTP status code, such as 200 or 500

Default tags

Any default tags you configure in the connection settings are also attached. For example:

  • env=prod

  • team=perf

Example metric points

Per-step metric example

name: lp.run_results.latency.p95_ms
value: 821
time: 1713701900
tags:
  run_id=r8_ynth
  run_status=finished
  company_id=v_smt_rpx
  company_name=leapwork
  project_id=abc123
  project_name=new_project
  timeline_asset_id=new_timeline
  timeline_name=new_timeline
  run_name=new_timeline_24042026083945
  track_item_id=track1
  step_id=step_login
  step_title=login
  track_item_selected=true
  geo_location=northeurope
  env=prod
  team=perf

Run summary metric example

name: lp.run_results.run.peak_throughput
value: 642
time: 1713701900
tags:
  run_id=r8_ynth
  run_status=finished
  company_id=v_smt_rpx
  company_name=leapwork
  project_id=abc123
  project_name=new_project
  timeline_asset_id=new_timeline
  timeline_name=new_timeline
  run_name=new_timeline_24042026083945

Status-code metric example

name: lp.run_results.status_code.count
value: 638
time: 1713701900
tags:
  run_id=r8_ynth
  run_status=finished
  company_id=v_smt_rpx
  project_id=abc123
  timeline_name=new_timeline
  track_item_id=track1
  step_id=step_login
  step_title=login
  status_code=200
  geo_location=northeurope

Validate that Leapwork Performance is publishing

Check Leapwork Performance logs

Look for these log entries in LeapworkPerformanceRunner:

Success:

  • Published Grafana batch ...

  • Published ... Grafana metric points for run ... across ... batches

Failure:

  • Grafana publish failed with status ...

  • Failed to publish run ... to Grafana

Check Grafana Explore

  1. Open Explore in Grafana.

  2. Select the Graphite data source (not Prometheus).

  3. Run the following query:

seriesByTag('name=lp.run_results.run.latency.p95_ms')

Check the time range

If a query returns no data:

  1. Confirm the Graphite data source is selected.

  2. Widen the time range to Last 24 hours.

  3. Retry the query.

Query metrics in Grafana

Open Explore and select the Graphite data source.

Run-level queries

seriesByTag('name=lp.run_results.run.latency.p95_ms')
seriesByTag('name=lp.run_results.run.latency.p99_ms')
seriesByTag('name=lp.run_results.run.peak_throughput')

Filter by run

seriesByTag('name=lp.run_results.run.latency.p95_ms', 'run_id=u5t4tc5h')

Filter by timeline

seriesByTag('name=lp.run_results.run.latency.p95_ms', 'timeline_name=new_timeline')

Filter by run name

seriesByTag('name=lp.run_results.run.latency.p95_ms', 'run_name=new_timeline_24042026083945')

Per-step queries

seriesByTag('name=lp.run_results.latency.p95_ms')
seriesByTag('name=lp.run_results.latency.p95_ms', 'step_id=8li77l9u')

Timeseries queries

seriesByTag('name=lp.run_results.timeseries.requests_per_second')
seriesByTag('name=lp.run_results.timeseries.latency.avg_ms')

Status-code queries

seriesByTag('name=lp.run_results.status_code.count', 'status_code=401')

Create a Grafana dashboard

Create the dashboard

  1. Open Dashboards in Grafana.

  2. Select New dashboard.

  3. Select Add visualization.

  4. Choose the Graphite data source.

  5. Name the dashboard, for example Leapwork Performance Dashboard.

Widget 1: Run P95 latency

  • Panel type: Time series

  • Query: seriesByTag('name=lp.run_results.run.latency.p95_ms')

Widget 2: Run P99 latency

  • Panel type: Time series

  • Query: seriesByTag('name=lp.run_results.run.latency.p99_ms')

Widget 3: Run peak throughput

  • Panel type: Stat or Time series

  • Query: seriesByTag('name=lp.run_results.run.peak_throughput')

Widget 4: Run error rate

  • Panel type: Stat or Time series

  • Query: seriesByTag('name=lp.run_results.run.error_rate_pct')

Widget 5: Track-item requests per second

  • Panel type: Time series

  • Query: seriesByTag('name=lp.run_results.timeseries.requests_per_second')

Widget 6: Track-item latency over time

  • Panel type: Time series

  • Query: seriesByTag('name=lp.run_results.timeseries.latency.avg_ms')

Widget 7: Status-code breakdown

  • Panel type: Table, Bar chart, or Stat

  • Query: seriesByTag('name=lp.run_results.status_code.count', 'status_code=401')

Use query-level filters for more targeted results:

  • run_id

  • run_name

  • timeline_name

  • run_status

  • project_name

  • company_name

  • step_id

  • step_title

  • geo_location

Examples:

seriesByTag('name=lp.run_results.latency.p95_ms', 'run_id=u5t4tc5h')
seriesByTag('name=lp.run_results.latency.p95_ms', 'timeline_name=new_timeline', 'run_status=finished')

Understand Grafana table behavior

Grafana Graphite tables behave differently from relational query tables. Keep the following in mind:

  • Graphite queries return time series, not relational rows.

  • Building tables usually requires transformations such as Rows to fields, Reduce, Join by field, Labels to fields, and Organize fields.

  • Rows to fields pivots metrics into columns but often collapses to a single row.

Tip: For stable dashboards, use separate panels for major metric groups. For per-step tables, use fewer columns per panel.

Troubleshooting

Grafana connection is missing endpoint

Symptom: Error message Grafana connection is missing endpoint.

Cause: No Graphite ingest URL is saved in the connection.

Fix: Set the endpoint to https://<stack>.grafana.net/graphite/metrics.

Grafana connection is missing username

Symptom: Error message Grafana connection is missing username.

Cause: The Graphite username or instance ID was not saved.

Fix: Copy the User value from the Grafana Cloud Graphite setup page and save it in Leapwork Performance.

Grafana connection is missing apiKey

Symptom: Error message Grafana connection is missing apiKey.

Cause: No access token is saved in the connection.

Fix: Create a token under a policy with metrics:write and save it in the connection.

Content-type error

Symptom: Error unknown content-type "application/json; charset=utf-8".

Cause: The request included an unexpected charset parameter.

Fix: Leapwork Performance now sends application/json without charset. Rebuild or restart LeapworkPerformanceRunner if you are on an older build.

Query returns no data

Symptom: A Grafana Explore query shows no results.

Check:

  1. Confirm the Graphite data source is selected (not Prometheus).

  2. Verify the endpoint ends with /graphite/metrics.

  3. Confirm the username is the Graphite instance ID.

  4. Verify the token has metrics:write permission.

  5. Check Leapwork Performance logs for successful Grafana publish entries.

  6. Confirm the query uses the correct namespace, for example lp.run_results.

  7. Widen the time range to Last 24 hours.