Skip to content
Swarmetry

Run and analyse tests

Observability

Metric outputs, dashboards, APM traces.

Project tab Observability (project Owners write, others read; plan feature integrations / APM).

Observability

Metric outputs and dashboards

Send the metrics of every run of the project to your own stack, in addition to Swarmetry's store. Three built-in outputs: Prometheus remote write, InfluxDB (versions 1, 2 and 3) and OpenTelemetry. Configure the endpoint, then Test. Credentials are never typed here: pick the name of a project secret, resolved when the run starts and passed to the test engine through its environment only. If a named secret no longer exists the run fails with a clear error.

Every run is tagged testid=run-<number>-<id>, also on every generator of a distributed run, and each generator adds its own sw_runner tag: the series of two generators never overwrite each other in your store. To get the figures of a whole run, sum over sw_runner (the ready dashboards do).

Test sends what a run sends, with nothing in it (an empty write, an empty export), and says what is wrong: the address does not answer, the address answers "not found" (wrong URL or path, missing database, receiver switched off), the credential is refused, or the credential is accepted but may not write.

Output How to connect it
Prometheus remote write The remote write URL of your receiver (on a Prometheus server, the remote write receiver must be enabled). Basic or bearer authentication. Tenant: for a multi-tenant Mimir or Cortex, your tenant id, sent in the X-Scope-OrgID header. Minimum TLS version: TLS 1.3 unless you choose 1.2, for an endpoint that only accepts TLS 1.2 (Test tells you). The series are marked stale when the run ends, so your charts stop at the end of the run.
InfluxDB 1 The server address, the database, and a user with its password if the server asks for one.
InfluxDB 2 The same form, through the version 1 write API that InfluxDB 2 accepts: Basic authentication, your user name, and a secret holding an API token as the password. Database is the database name mapped to your bucket (a DBRP mapping).
InfluxDB 3 The same form: Basic authentication, any user name (it is ignored), and a secret holding the database token as the password. Create the database first.
OpenTelemetry The address of your collector (host:port), over gRPC or HTTP/protobuf. The metrics path is for HTTP only: /v1/metrics unless you change it (the OTLP receiver of a Prometheus server listens on /api/v1/otlp/v1/metrics). A credential goes in the header you name, for example Authorization, with a secret holding the whole value (Bearer <token>).

Not supported: SigV4 request signing (Amazon Managed Service for Prometheus), client certificates and, for OpenTelemetry, a private certificate authority: without plaintext, the collector must present a certificate signed by a public authority.

Native histograms (a setting of the Prometheus output, through the API or the assistant): latencies are then sent as one native histogram per metric instead of percentile series. Your receiver must accept native histograms (a Prometheus server before version 3.8 needs --enable-feature=native-histograms; other receivers may not support them). The ready dashboard reads both forms.

Dashboards: download the ready dashboard of each output and import it in your dashboard tool, then add the annotations integration (the URL of your dashboard tool and a token stored as a secret) to get one annotation per run (start to end, number, scenario, verdict) on your dashboards. The token must be a service account token with the Editor role: creating an annotation needs it, and a Viewer token is refused. Test creates a test annotation and deletes it.

APM traces

Add an APM connection so that Swarmetry can show the server-side trace of a request:

Backend What you get
Tempo, Jaeger, OTLP-JSON URL the trace drawn as a waterfall in Swarmetry
Datadog, New Relic, Dynatrace, Elastic a link to the trace in your tool

Test sends one request with the connection's credential: Tempo answers a tag search (a wrong token or a missing tenant fails), Jaeger its list of services, Prometheus its build information, an OTLP-JSON URL a test trace (a "not found" answer passes only when it is JSON; otherwise the address is probably wrong). Datadog, New Relic, Dynatrace and Elastic connections only build links and send nothing, so they have no Test button.

Link template (Datadog, New Relic, Dynatrace, Elastic, or any tool): there is no preset per tool, because the vendors publish no stable address format for a trace. Use your own address: open one trace in your tool, copy the address from the browser, and replace the trace id in it with {traceId}. You can also put the time window in it with {startMs} and {endMs} (Unix milliseconds) or {startIso} and {endIso} (ISO 8601): the request ± 5 minutes, or the run. A part after # is accepted. The link only opens in your browser; Swarmetry never calls it.

Multi-tenant Tempo: enter your tenant id in Tenant (Tempo and OTLP-JSON connections). Swarmetry sends it in the X-Scope-OrgID header of every request (trace lookups and Test), next to the authentication you chose (bearer token, basic or another header). A tenant id is 1 to 150 of A-Z a-z 0-9 ! - _ . * ' ( ); to read several tenants at once, separate them with | (up to 10): Tempo answers such cross-tenant queries unless they are turned off on your Tempo. The tenant is an identifier, not a secret: it is shown in the list of connections. If a connection sends the tenant through the header authentication named X-Scope-OrgID (the way before the Tenant field), it keeps working; to add a token, put the tenant in Tenant and choose the bearer, basic or other header authentication.

Enable tracing in the test configuration: the requests of the test carry a W3C traceparent and the trace id is kept as an exemplar of the metric. With a sampling rate below 100 %, only the sampled requests (the ones your tracing backend is asked to record) are kept as exemplars, so every View trace opens a recorded trace; a low rate gives fewer requests in the Slowest requests panel.

On the run page, the Slowest requests panel lists exemplars; click a point on the latency chart to narrow it to that moment, then open a trace: facts about the request (phases, endpoint percentiles), the waterfall with self time per span and error spans, and links to your APM. The assistant can explain a slow request from the same facts.

Trace waterfall

System under test metrics

Add Prometheus-compatible queries (PromQL) for your system (CPU, queue depth...). They are drawn on the run charts over the run window, in the same pointer group, so you can see the server side next to the client latency.

Multi-tenant Mimir or Cortex: enter your tenant id in the Tenant field of the Prometheus connection. It is sent in the X-Scope-OrgID header of every query and of Test, next to the token or password. Several tenants separated by | work only if your Mimir has tenant federation enabled; otherwise Test shows Mimir's refusal.

When a query fails, its chart says why. "Prometheus refused the query" means the query itself is wrong (fix it). "Prometheus did not finish the query" means it timed out or was stopped on a busy server: the query may be correct, try again or shorten the time range. A query that returns native histograms cannot be drawn as a line: wrap it in a function that returns numbers, for example histogram_quantile(0.95, sum(rate(http_request_duration_seconds[5m]))) or histogram_count(rate(http_request_duration_seconds[5m])).