Skip to main content

Send one metric

Use emit for the first metric. It validates identity and field types, escapes line protocol for you, and writes to the configured local socket:

constellation-agent emit ground_station \
--entity-id GS-001 \
--tag site=primary \
--field lat=34.2 \
--field lon=-118.2 \
--field snr=12.7 \
--field locked=true

Expected output:

written to local socket; parsing and remote delivery are unconfirmed

That message is deliberately precise: the local write succeeded, but remote delivery is asynchronous. The next step proves the complete path.

Every metric needs:

  • one measurement, such as ground_station or link;
  • a non-empty entity_id, which becomes its topology identity;
  • at least one field.

Validate without sending​

Use --print to inspect the encoded line:

constellation-agent emit ground_station \
--entity-id GS-001 \
--field lat=34.2 \
--field lon=-118.2 \
--field snr=12.7 \
--print

Field syntax controls type: 12.7 is a float, 42i an integer, true a Boolean, and '"001"' a string. Run constellation-agent emit --help for the full command surface.

Send canonical JSON​

printf '%s\n' '{
"measurement": "ground_station",
"tags": {"entity_id": "GS-001", "site": "primary"},
"fields": {"lat": 34.2, "lon": -118.2, "snr": 12.7, "locked": true}
}' | constellation-agent emit --json

emit is for smoke tests and shell automation. A high-rate publisher should keep one direct socket connection open; that comes after verification.

Next: Verify it.