Created
March 13, 2026 00:16
-
-
Save jessitron/296cba4344d5bb0d1fb7dcc8a1fd7f58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Send a single dummy event to a Honeycomb dataset with all the fields | |
| # needed for Honeycomb to recognize it as a tracing dataset. | |
| # | |
| # Usage: | |
| # HONEYCOMB_API_KEY=... ./scripts/make-tracing-dataset.sh <dataset-name> | |
| # | |
| # The event uses obviously-fake values so it won't pollute real traces. | |
| set -euo pipefail | |
| DATASET="${1:?Usage: $0 <dataset-name>}" | |
| API_KEY="${HONEYCOMB_API_KEY:?Set HONEYCOMB_API_KEY}" | |
| API_HOST="${HONEYCOMB_API_HOST:-https://api.honeycomb.io}" | |
| # Generate a plausible-looking but clearly fake trace/span ID | |
| FAKE_TRACE_ID="00000000000000000000000000000000" | |
| FAKE_SPAN_ID="0000000000000000" | |
| echo "Sending tracing-bootstrap event to dataset '${DATASET}'..." | |
| HTTP_STATUS=$(curl -s -o /dev/stderr -w "%{http_code}" \ | |
| "${API_HOST}/1/events/${DATASET}" \ | |
| -H "X-Honeycomb-Team: ${API_KEY}" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{ | |
| \"trace.trace_id\": \"${FAKE_TRACE_ID}\", | |
| \"trace.parent_id\": \"${FAKE_SPAN_ID}\", | |
| \"trace.span_id\": \"${FAKE_SPAN_ID}\", | |
| \"name\": \"bootstrap-tracing-dataset\", | |
| \"service.name\": \"${DATASET}\", | |
| \"duration_ms\": 0.1 | |
| }" 2>&1) | |
| echo "" | |
| if [ "$HTTP_STATUS" = "200" ]; then | |
| echo "Success! Dataset '${DATASET}' should now be recognized as a tracing dataset." | |
| echo "(You may need to refresh the Honeycomb UI.)" | |
| else | |
| echo "Got HTTP ${HTTP_STATUS} — something went wrong." | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment