You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Use modulo for cycling through pre-computed arrays
177
183
idx=$((i %100))
178
-
method_idx=$((i %6))
179
-
status_idx=$((i %6))
180
-
service_idx=$((i %5))
181
-
endpoint_idx=$((i %5))
182
-
agent_idx=$((i %3))
183
-
cluster_idx=$((i %3))
184
+
method_idx=$((i %METHODS_LEN ))
185
+
status_idx=$((i %STATUS_CODES_LEN))
186
+
service_idx=$((i %SERVICES_LEN))
187
+
endpoint_idx=$((i %ENDPOINTS_LEN))
188
+
agent_idx=$((i %USER_AGENTS_LEN))
189
+
cluster_idx=$((i %CLUSTERS_LEN))
184
190
185
191
# Direct array access
186
192
trace_id=${TRACE_IDS[$idx]}
@@ -269,8 +275,6 @@ run_ingest() {
269
275
echo"Failed to send batch"
270
276
exit 1
271
277
fi
272
-
273
-
sleep 0.1
274
278
done
275
279
276
280
# Final statistics
@@ -292,11 +296,6 @@ create_sql_filters() {
292
296
"service_health_summary|Service health metrics by severity|SELECT \"service.name\", severity_text, COUNT(*) as count FROM $P_STREAM GROUP BY \"service.name\", severity_text ORDER BY count DESC"
293
297
"api_endpoint_performance|API endpoint request patterns|SELECT \"url.path\", COUNT(*) as request_count, \"service.name\" FROM $P_STREAM GROUP BY \"url.path\", \"service.name\" ORDER BY request_count DESC LIMIT 20"
294
298
"authentication_failures|Monitor auth-related warnings and errors|SELECT * FROM $P_STREAM WHERE \"url.path\" LIKE '%login%' AND severity_text IN ('WARN', 'ERROR') ORDER BY time_unix_nano DESC LIMIT 100"
295
-
"upstream_cluster_analysis|Request distribution across clusters|SELECT \"upstream.cluster\", COUNT(*) as request_count, \"service.name\" FROM $P_STREAM GROUP BY \"upstream.cluster\", \"service.name\" ORDER BY request_count DESC"
296
-
"trace_analysis|Multi-span traces for distributed tracking|SELECT trace_id, COUNT(*) as span_count, \"service.name\" FROM $P_STREAM GROUP BY trace_id, \"service.name\" HAVING span_count > 1 ORDER BY span_count DESC LIMIT 10"
297
-
"user_agent_distribution|Client types and user agent patterns|SELECT \"user_agent.original\", COUNT(*) as usage_count FROM $P_STREAM GROUP BY \"user_agent.original\" ORDER BY usage_count DESC LIMIT 15"
298
-
"source_address_analysis|Request distribution by source IP|SELECT \"source.address\", COUNT(*) as request_count, COUNT(DISTINCT \"service.name\") as services_accessed FROM $P_STREAM GROUP BY \"source.address\" ORDER BY request_count DESC LIMIT 20"
299
-
"severity_timeline|Severity trends over time|SELECT \"severity_text\", COUNT(*) as count, \"service.name\" FROM $P_STREAM GROUP BY \"severity_text\", \"service.name\" ORDER BY count DESC"
300
299
)
301
300
302
301
sql_success_count=0
@@ -316,12 +315,9 @@ create_sql_filters() {
316
315
else
317
316
echo"Failed to create SQL filter: $name"
318
317
fi
319
-
320
-
sleep 0.5
321
318
done
322
319
323
320
echo"Created $sql_success_count SQL filters"
324
-
sleep 3
325
321
}
326
322
327
323
# Create saved filters
@@ -334,11 +330,6 @@ create_saved_filters() {
334
330
"high_latency_requests|High response time requests|SELECT * FROM $P_STREAM WHERE body LIKE '%duration%' LIMIT 500|Ingestion Time,Data,service.name,url.path,upstream.cluster,body|service.name"
335
331
"upstream_cluster_health|Upstream cluster performance|SELECT * FROM $P_STREAM WHERE upstream.cluster IS NOT NULL LIMIT 500|Ingestion Time,Data,upstream.cluster,service.name,severity_text,destination.address|upstream.cluster"
336
332
"api_endpoint_monitoring|API endpoint usage patterns|SELECT * FROM $P_STREAM WHERE url.path IS NOT NULL LIMIT 500|Ingestion Time,Data,url.path,service.name,severity_text,source.address|url.path"
337
-
"trace_correlation_view|Correlated traces for distributed tracking|SELECT * FROM $P_STREAM WHERE trace_id IS NOT NULL AND span_id IS NOT NULL LIMIT 500|Ingestion Time,Data,trace_id,span_id,service.name,url.path|trace_id"
338
-
"user_agent_analysis|Client types and patterns|SELECT * FROM $P_STREAM WHERE user_agent.original IS NOT NULL LIMIT 500|Ingestion Time,Data,user_agent.original,source.address,url.path,service.name|user_agent.original"
339
-
"network_monitoring|Network traffic and server interactions|SELECT * FROM $P_STREAM WHERE source.address IS NOT NULL LIMIT 500|Ingestion Time,Data,source.address,destination.address,service.name,severity_text,url.path|source.address"
340
-
"service_overview|Comprehensive service activity view|SELECT * FROM $P_STREAM LIMIT 500|Ingestion Time,Data,service.name,url.path,source.address,destination.address,upstream.cluster|service.name"
341
-
"recent_activity|Most recent system activity|SELECT * FROM $P_STREAM ORDER BY time_unix_nano DESC LIMIT 500|Ingestion Time,Data,service.name,severity_text,url.path,source.address|severity_text"
342
333
)
343
334
344
335
saved_success_count=0
@@ -366,8 +357,6 @@ create_saved_filters() {
366
357
else
367
358
echo"Failed to create saved filter: $name"
368
359
fi
369
-
370
-
sleep 0.5
371
360
done
372
361
373
362
echo"Created $saved_success_count saved filters"
@@ -457,8 +446,6 @@ create_alerts() {
457
446
echo"Failed to create Alert 3 (Trace ID null)"
458
447
echo"Response: $response3"
459
448
fi
460
-
461
-
sleep 1
462
449
}
463
450
464
451
# Main alerts function
@@ -470,7 +457,6 @@ run_alerts() {
470
457
471
458
if [[ $?-eq 0 &&-n"$target_id" ]];then
472
459
echo"Target creation successful, proceeding with alerts..."
473
-
sleep 2
474
460
475
461
# Create alerts using the target ID
476
462
create_alerts "$target_id"
@@ -834,7 +820,6 @@ run_dashboards() {
834
820
835
821
if [[ $?-eq 0 &&-n"$dashboard_id" ]];then
836
822
echo"Dashboard creation successful, proceeding with tiles..."
0 commit comments