Skip to content

Commit 673052b

Browse files
fix: alert query for null trace id in sample dataset (#1382)
- Updated the alert for "Trace ID null" to correctly detect JSON null values instead of empty strings in the "trace_id" column. - Renamed the alert from "Trace ID or Span ID null" to "Trace ID null" for clarity.
1 parent 1d4e858 commit 673052b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

resources/ingest_demo_data.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,8 @@ create_alerts() {
436436
echo "Response: $response2"
437437
fi
438438

439-
# Alert 3: Trace ID or Span ID null
440-
alert3_json="{\"severity\":\"high\",\"title\":\"Trace ID or Span ID null\",\"stream\":\"$P_STREAM\",\"alertType\":\"threshold\",\"aggregates\":{\"aggregateConfig\":[{\"aggregateFunction\":\"count\",\"conditions\":{\"operator\":null,\"conditionConfig\":[{\"column\":\"trace_id\",\"operator\":\"is null\",\"value\":\"\"}]},\"column\":\"trace_id\",\"operator\":\">\",\"value\":0}]},\"evalConfig\":{\"rollingWindow\":{\"evalStart\":\"5h\",\"evalEnd\":\"now\",\"evalFrequency\":1}},\"targets\":[\"$target_id\"]}"
441-
439+
# Alert 3: Trace ID null
440+
alert3_json="{\"severity\":\"high\",\"title\":\"Trace ID null\",\"stream\":\"$P_STREAM\",\"alertType\":\"threshold\",\"aggregates\":{\"aggregateConfig\":[{\"aggregateFunction\":\"count\",\"conditions\":{\"operator\":null,\"conditionConfig\":[{\"column\":\"trace_id\",\"operator\":\"is null\",\"value\":null}]},\"column\":\"trace_id\",\"operator\":\">\",\"value\":0}]},\"evalConfig\":{\"rollingWindow\":{\"evalStart\":\"5h\",\"evalEnd\":\"now\",\"evalFrequency\":1}},\"targets\":[\"$target_id\"]}"
442441
response3=$(curl_with_retry "$P_URL/api/v1/alerts" "POST" "$alert3_json" "application/json" 3)
443442
if [[ $? -eq 0 ]]; then
444443
echo "Alert 3 (Trace ID null) created successfully"

0 commit comments

Comments
 (0)