Send a test span to a destination
POST https://weights.fyi/run/v1/trace-sinks/<sink_id>/test
Authorization: Bearer <token> scope: manage- Available since
- 2026-10-08, when the service went live on weights.fyi/run.
- Answer time
- synchronous, within 10 s whatever your end does: the call waits for your destination's answer up to the delivery deadline and then reports what happened.
Sends one test span to a destination now and tells you what came back. Use it right after you add a destination, and whenever its last_error makes you doubt it: it answers in seconds with your end's status code, or with the reason no answer came, which is much quicker than waiting for real spans to fail and back off.
The test span is a real delivery of the destination's kind: OpenTelemetry JSON posted to the address with /v1/traces added for otlp_http and mlflow, or one signed JSON line for a webhook, with every header you set. It is named weights.sink_test, carries the attribute weights.test set to true, and is not part of any job. It goes through the same checks as every delivery, the public-address check included. It is sent whether or not the destination is enabled, so you can test a destination while your Tracing and tracking option is still off. The test leaves no trace of its own. The span is not stored and does not appear in your traces, and the destination's delivery record, delivered, last_ok_at and last_error, is left to real deliveries, so a failed test does not mark a working destination as failing, and a passing test does not hide an error that real deliveries still meet.
Request
| Name | Where | Required | Meaning |
|---|---|---|---|
Authorization | header | yes | Bearer and your token. The token needs the manage scope. |
sink_id | path | yes | The destination's number, the id that GET /v1/trace-sinks lists. |
No body is needed.
Return value
200 OK with the outcome. A destination that refused the test still answers 200 here; the outcome is in the fields.
| Field | Meaning |
|---|---|
ok | true when your end answered with a 2xx status, false otherwise. |
status | The HTTP status your end answered with, or null when no answer came. |
latency_ms | How long the delivery took, in milliseconds. |
error | null on success; otherwise a short code: http_401 and the like for a status your end answered, redirect_302_not_followed for a redirect, deadline_exceeded when no answer came within 10 s, connection_refused, connection_reset, tls_verify_failed, unresolvable_host or address_not_public. |
sent_to | The address the span was posted to; for the OpenTelemetry kinds, your URL with /v1/traces added. |
Errors
| Status | Code | When it happens | What to do |
|---|---|---|---|
401 | unauthorized, invalid_token, token_revoked, token_expired | No token, or one that does not work (any more). | Use a valid token. |
403 | scope_required, account_suspended | The token lacks manage, or the account is suspended. | Use a token with manage. |
404 | sink_not_found | There is no such destination in your account. | Check the number with GET /v1/trace-sinks. |
Examples
curl -s -X POST https://weights.fyi/run/v1/trace-sinks/SINK_ID/test -H "Authorization: Bearer $WEIGHTS_API_KEY"A collector that took the span:
{"ok": true, "status": 200, "latency_ms": 84.2, "error": null, "sent_to": "https://collector.example.org/v1/traces"}The same collector with a token it no longer accepts:
{"ok": false, "status": 401, "latency_ms": 61.7, "error": "http_401", "sent_to": "https://collector.example.org/v1/traces"}History
- 2026-10-08: live with the service; every test returns by the delivery deadline, whatever the destination does.
See also
- POST /v1/trace-sinks to add a destination, and GET /v1/trace-sinks for its delivery record.
- Tracing and exports, the topic.