From c8f8ef873c7b047a84c54cdf53005ae1e688225d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Boudereau?= Date: Tue, 27 Feb 2024 12:49:03 +0100 Subject: [PATCH] add metrics attributes to metrics.sh --- _DRAFT/OTEL-example/metrics.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/_DRAFT/OTEL-example/metrics.sh b/_DRAFT/OTEL-example/metrics.sh index 056ba279..153bc455 100644 --- a/_DRAFT/OTEL-example/metrics.sh +++ b/_DRAFT/OTEL-example/metrics.sh @@ -1,5 +1,5 @@ #! /bin/sh -curl -X POST -H 'Content-Type: application/json' -i localhost:4318/v1/metrics \ +curl -v -X POST -H 'Content-Type: application/json' http://localhost:4318/v1/metrics \ -d "{ \"resourceMetrics\": [{ \"resource\": { @@ -8,6 +8,12 @@ curl -X POST -H 'Content-Type: application/json' -i localhost:4318/v1/metrics \ \"value\": { \"stringValue\": \"hello-world\" } + }, + { + \"key\": \"hello\", + \"value\": { + \"stringValue\": \"world\" + } }], \"droppedAttributesCount\": 0 }, @@ -19,7 +25,12 @@ curl -X POST -H 'Content-Type: application/json' -i localhost:4318/v1/metrics \ \"aggregationTemporality\": 2, \"dataPoints\": [{ \"asDouble\": 1, - \"attributes\": [], + \"attributes\": [{ + \"key\": \"hello-dp\", + \"value\": { + \"stringValue\": \"world\" + } + }], \"startTimeUnixNano\": $(date +%s%N), \"timeUnixNano\": $(date +%s%N) }],