Exposed Metrics
The exporter exposes a /metrics HTTP endpoint for Prometheus.
All metrics are cached. A background goroutine updates them. Prometheus gets the cached data instantly when it scrapes the endpoint. This prevents timeouts.
All metrics include the service label from your config.yaml. This helps you filter metrics by application.
Metric Reference
| Metric Name | Type | Labels | Description |
|---|---|---|---|
synthetic_http_status_code | Gauge | service, endpoint | The HTTP status code for the API endpoints (like 200 or 404). It returns -1 if the network fails. |
synthetic_ssl_cert_expiry_timestamp_seconds | Gauge | service, endpoint | The TLS certificate expiration date as a Unix timestamp (in seconds). It returns -1 if there is no certificate. |
synthetic_ui_step_duration_seconds | Gauge | service, scenario, step, action | The time in seconds it took to finish a UI step. |
synthetic_ui_journey_success | Gauge | service, scenario | Returns 1 if the whole UI scenario passed. Returns 0 if any step failed. |
synthetic_ui_journey_errors_total | Counter | service, scenario, step, error_type_name | The total number of errors. It increases when a step fails. It includes your custom error_type_name label. |
Example Scrape Output
An example response from curl http://localhost:10050/metrics:
# HELP synthetic_http_status_code HTTP response status code returned by the API endpoint.
# TYPE synthetic_http_status_code gauge
synthetic_http_status_code{endpoint="https://my-e-commerce-app.example.com/api/health",service="my-e-commerce-app"} 200
# HELP synthetic_ssl_cert_expiry_timestamp_seconds Unix timestamp of the TLS certificate expiration date.
# TYPE synthetic_ssl_cert_expiry_timestamp_seconds gauge
synthetic_ssl_cert_expiry_timestamp_seconds{endpoint="https://my-e-commerce-app.example.com/api/health",service="my-e-commerce-app"} 1.7839584e+09
# HELP synthetic_ui_step_duration_seconds Elapsed time in seconds for each UI journey step.
# TYPE synthetic_ui_step_duration_seconds gauge
synthetic_ui_step_duration_seconds{action="goto",scenario="Login Flow",step="navigate_to_login",service="my-e-commerce-app"} 1.204
synthetic_ui_step_duration_seconds{action="fill",scenario="Login Flow",step="fill_username",service="my-e-commerce-app"} 0.087
synthetic_ui_step_duration_seconds{action="click",scenario="Login Flow",step="click_login_button",service="my-e-commerce-app"} 0.341
# HELP synthetic_ui_journey_success 1 if the full UI journey completed without errors, 0 otherwise.
# TYPE synthetic_ui_journey_success gauge
synthetic_ui_journey_success{scenario="Login Flow",service="my-e-commerce-app"} 1
# HELP synthetic_ui_journey_errors_total Total number of UI journey failures, labelled by the step's error_type_name.
# TYPE synthetic_ui_journey_errors_total counter
synthetic_ui_journey_errors_total{error_type_name="navigation_failed",scenario="Login Flow",step="navigate_to_login",service="my-e-commerce-app"} 0How to use these metrics (PromQL)
You can use PromQL to build alerts and dashboards with these metrics.
Example 1: Alerting on Journey Failure
If synthetic_ui_journey_success is 0, the scenario is failing.
synthetic_ui_journey_success == 0Example 2: Calculating Error Rates
To check how often an error happens over time (like a login failure), use the rate() function on the error counter:
rate(synthetic_ui_journey_errors_total{error_type_name="login_failed"}[$__rate_interval]) > 0(Note: We use Grafana's [$__rate_interval] variable instead of a fixed [5m]. This prevents missing data when you zoom out in Grafana.)
Example 3: Alerting on expiring SSL Certificates
To alert if an SSL certificate expires in less than 7 days (604800 seconds):
(synthetic_ssl_cert_expiry_timestamp_seconds - time()) < 604800TIP
We recommend using our official Grafana Dashboard to see these metrics. Read the Grafana Dashboard page to learn how to import it.
