Test with curl (no SDK)

Embed
Preview of the card
<a href="https://watchtowerops.net/docs/onboarding-curl"><img src="https://watchtowerops.net/docs/_api/public/orgs/aa5959cb-1a0b-4a9a-bc9a-913e7ac31cd9/spaces/b7aac181-9916-4805-b253-becc5fd2ca62/pages/9f175d34-83e7-4019-b4c0-dc6dd8432992/social-card.svg?v=3e7ae33eec8b" alt="Test with curl (no SDK)" width="600" height="315"></a>

Check the endpoint and the ingestion key before instrumenting anything: each command below posts one record over OTLP/HTTP JSON, and the "waiting for the first event" check completes when it arrives. The key needs the scope of the signal (ingest:traces, ingest:logs, ingest:metrics). A 200 with {} (or a partialSuccess object) means the gateway accepted it; 401 is a wrong key, 403 a missing scope. The onboarding page also has a Send test event button that does the same from the server side.

Traces (one span named hello-watchtower):

NOW=$(date +%s)000000000
curl -sS https://ingest.example.com/v1/traces -H 'Content-Type: application/json' -H 'x-watchtower-key: wti_YOUR_KEY' --data-binary @- <<EOF
{"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"curl-test"}}]},"scopeSpans":[{"spans":[{"traceId":"5b8efff798038103d269b633813fc60c","spanId":"eee19b7ec3c1b174","name":"hello-watchtower","kind":2,"startTimeUnixNano":"$NOW","endTimeUnixNano":"$NOW"}]}]}]}
EOF

Logs (one INFO record in the same trace):

NOW=$(date +%s)000000000
curl -sS https://ingest.example.com/v1/logs -H 'Content-Type: application/json' -H 'x-watchtower-key: wti_YOUR_KEY' --data-binary @- <<EOF
{"resourceLogs":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"curl-test"}}]},"scopeLogs":[{"logRecords":[{"timeUnixNano":"$NOW","severityNumber":9,"severityText":"INFO","body":{"stringValue":"hello-watchtower"},"traceId":"5b8efff798038103d269b633813fc60c","spanId":"eee19b7ec3c1b174"}]}]}]}
EOF

Metrics (one gauge point):

NOW=$(date +%s)000000000
curl -sS https://ingest.example.com/v1/metrics -H 'Content-Type: application/json' -H 'x-watchtower-key: wti_YOUR_KEY' --data-binary @- <<EOF
{"resourceMetrics":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"curl-test"}}]},"scopeMetrics":[{"metrics":[{"name":"hello_watchtower","gauge":{"dataPoints":[{"timeUnixNano":"$NOW","asDouble":1}]}}]}]}]}
EOF

Delete the test records like any other data, or let retention expire them. Do not set wt.* attributes; the gateway deletes them.

Updated