Ingest telemetry
Use the common setup with ingestion enabled and a key carrying telemetry:write and topology:read. This example uses curl, jq, and a current UTC timestamp so the record falls inside the read window.
#!/usr/bin/env bash
set -euo pipefail
: "${CONSTELLATION_API_BASE:?Set the API base URL}"
: "${CONSTELLATION_API_TOKEN:?Set a scoped API key}"
base="${CONSTELLATION_API_BASE%/}"
sample_time="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
sample_id="docs-smoke-$(date -u +%Y%m%dT%H%M%S)-$$"
payload="$(jq -n --arg time "$sample_time" --arg id "$sample_id" '[{
measurement: "ground_station",
time: $time,
tags: {entity_id: $id, entity_type: "ground_station"},
fields: {utilization: 0.61}
}]')"
result="$(curl --fail-with-body --connect-timeout 10 --max-time 30 -sS \
-H "x-api-key: $CONSTELLATION_API_TOKEN" \
-H "Content-Type: application/json" \
--data-binary "$payload" "$base/telemetry")"
printf '%s\n' "$result" | jq .
printf '%s\n' "$result" | jq -e \
'.accepted_count == 1 and .rejected_count == 0' >/dev/null
curl --fail-with-body --connect-timeout 10 --max-time 30 -sS \
-H "x-api-key: $CONSTELLATION_API_TOKEN" \
"$base/topology?measurement=ground_station&freshness_seconds=900" \
| jq --arg id "$sample_id" '.entities[] | select(.entity_id == $id)'
The write should report one accepted record. The read selects that sample's entity. If it is not visible yet, retry only the read after a short delay; do not repeat the write to test visibility.
For batches, enforce both the 1,000-record and 1 MiB HTTP limits. Inspect rejected_count and rejected_indices; resend only corrected rejected records. If a write times out after submission, reconcile it before replaying. See Telemetry and Errors and limits.