-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsend-trace.sh
executable file
·52 lines (49 loc) · 1.21 KB
/
send-trace.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
readonly EPOCH_DATE="$(date +%s)"
read -r -d "" SPAN <<END_SPAN
{"resourceSpans":[{
"resource":{
"attributes":[
{"key":"service.name","value":{"stringValue":"Some Service"}}
]
},
"scopeSpans":[{
"scope":{},
"spans":[
{
"traceId":"0000000000000000ffffff${EPOCH_DATE}",
"spanId":"ffffff${EPOCH_DATE}",
"parentSpanId":"",
"name":"some-service-span",
"kind":"SPAN_KIND_SERVER",
"startTimeUnixNano":"${EPOCH_DATE}000000000",
"endTimeUnixNano":"${EPOCH_DATE}010000000",
"attributes":[
{"key":"net.peer.port","value":{"intValue":"4444"}}
],
"status":{
"code":"STATUS_CODE_OK"
}
},
{
"traceId":"0000000000000000ffffff${EPOCH_DATE}",
"spanId":"fffffa${EPOCH_DATE}",
"parentSpanId":"",
"name":"some-service-span",
"kind":"SPAN_KIND_SERVER",
"startTimeUnixNano":"${EPOCH_DATE}020000000",
"endTimeUnixNano":"${EPOCH_DATE}030000000",
"attributes":[
{"key":"net.peer.port","value":{"intValue":"4444"}}
],
"status":{
"code":"STATUS_CODE_OK"
}
}
]
}]
}]
}
END_SPAN
set -x
curl -v "http://localhost:4318/v1/traces" -H "Content-type: application/json" --data-raw "$SPAN"