Prometheus Metrics
The Testkube API Server in the Testkube Agent exposes a /metrics
endpoint that can be consumed by Prometheus, Grafana, etc.
Depending on if the Agent is deployed in Standalone or Connected mode, it will expose metrics either for local executions or for executions performed in the associated Environment.
Currently, the following metrics are exposed, grouped by category:
Test Workflows
Executions
testkube_testworkflow_executions_count
- The total number of test workflow executions.name
- workflow nameresult
- workflow execution resultlabels
- workflow labelstestworkflow_uri
- workflow URItriggered_by
- workflow trigger sourcetags
- workflow tags
testkube_testworkflow_executions_duration_ms
- The duration of test workflow executions.name
- workflow nameresult
- workflow execution resultlabels
- workflow labelstestworkflow_uri
- workflow URItriggered_by
- workflow trigger sourcetags
- workflow tags
testkube_testworkflow_aborts_count
- The total number of test workflows aborted by type events.result
- workflow execution result
Execution Steps
testkube_testworkflow_execution_steps_duration_ms
- The duration of test workflow execution steps.workflow_name
- workflow namestep_name
- execution step namestatus
- execution step status
testkube_testworkflow_execution_steps_count
- The total number of test workflow execution steps.workflow_name
- workflow namestep_name
- execution step namestatus
- execution step status
testkube_testworkflow_execution_steps_start_time_ms
- The start time of test workflow execution steps.workflow_name
- workflow namestep_name
- execution step namestatus
- execution step status
testkube_testworkflow_execution_steps_finish_time_ms
- The finish time of test workflow execution steps.workflow_name
- workflow namestep_name
- execution step namestatus
- execution step status
Lifecycle (CRUD)
testkube_testworkflow_creations_count
- The total number of test workflows created by type events.result
- creation result
testkube_testworkflow_updates_count
- The total number of test workflows updated by type events.result
- update result
testkube_testworkflow_deletes_count
- The total number of test workflows deleted events.result
- deletion result
Templates
testkube_testworkflowtemplate_creations_count
- The total number of test workflow template created by type events.result
- creation result
testkube_testworkflowtemplate_updates_count
- The total number of test workflow template updated by type events.result
- update result
testkube_testworkflowtemplate_deletes_count
- The total number of test workflow template deleted events.result
- deletion result
Triggers
testkube_testtriggers_creations_count
- The total number of test trigger created events.result
- creation result
testkube_testtriggers_updates_count
- The total number of test trigger updated events.result
- update result
testkube_testtriggers_deletes_count
- The total number of test trigger deleted events.result
- deletion result
testkube_testtriggers_bulk_updates_count
- The total number of test trigger bulk update events.result
- bulk update result
testkube_testtriggers_bulk_deletes_count
- The total number of test trigger bulk delete events.result
- bulk deletion result
testkube_testtrigger_event_count
- The total number of test trigger events.name
- test trigger nameresource
- related resourceeventType
- type of event (create, update, delete, etc.)causes
- event causes
Webhooks
testkube_webhook_executions_count
- The total number of webhook executions.name
- webhook nameeventType
- webhook event typeresult
- webhook execution result
Tests
Tests and Test Suites are deprecated and will eventually be removed from Testkube - Read More
testkube_test_executions_count
- The total number of test executions.type
- test typename
- test nameresult
- test execution resultlabels
- test labelstest_uri
- test URI
testkube_test_creations_count
- The total number of tests created by type events.type
- test typeresult
- creation result
testkube_test_updates_count
- The total number of tests updated by type events.type
- test typeresult
- update result
testkube_test_aborts_count
- The total number of tests aborted by type events.type
- test typeresult
- test execution result
testkube_test_executions_duration_ms
- The duration of test executions.type
- test typename
- test nameresult
- test execution resultlabels
- test labelstest_uri
- test URI
Test Suites
testkube_testsuite_executions_count
- The total number of test suite executions.name
- test suite nameresult
- test suite execution resultlabels
- test suite labelstestsuite_uri
- test suite URI
testkube_testsuite_creations_count
- The total number of test suites created events.result
- creation result
testkube_testsuite_updates_count
- The total number of test suites updated events.result
- update result
testkube_testsuite_aborts_count
- The total number of test suites aborted by type events.result
- test suite execution result
testkube_testsuite_executions_duration_ms
- The duration of test suite executions.name
- test suite nameresult
- test suite execution resultlabels
- test suite labelstestsuite_uri
- test suite URI
Note: as the metrics also include labels with the associated test name (see below), no metrics are produced unless some tests were run since the last api-server restart
# HELP testkube_test_executions_count The total number of test executions
# TYPE testkube_test_executions_count counter
testkube_test_executions_count{name="test-website",result="passed",type="curl-container/test"} 1
Installation
If a Prometheus operator is not installed, please follow the steps here: https://grafana.com/docs/grafana-cloud/quickstart/prometheus_operator/.
Then, add a ServiceMonitor
custom resource to your cluster which will scrape metrics from our
Testkube API server:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: testkube-api-server
labels:
app: prometheus
spec:
endpoints:
- interval: 10s
port: http
selector:
matchLabels:
app.kubernetes.io/name: api-server
If you're installing Testkube manually with our Helm chart, you can pass the prometheus.enabled
value to the install command.
Grafana Dashboard
To use the Grafana dashboard, import this JSON definition:
https://github.com/kubeshop/testkube/blob/main/assets/grafana-dasboard.json