Skip to content

Commit

Permalink
HPCC-30470 Change3
Browse files Browse the repository at this point in the history
- Reinstatest span start/end log config options
- Updates outdated README export sample
- Replaces JLog helm config option w/ all caps version
- Defaults logspanstart/finish false
- Provides new spanstatustostring method
- Removes spanstatus map
- Labels all static methods as such
- Groups JLogSpanExporter members together
- Removes error condition logging
- Conforms to Otel naming style of span data
- Encodes JSON payload
- Ensures JSON array syntax for span events
- Exposes CSpan->addEvent with attributes option
- Reintegrates unittest w/ cspan->tolog

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Dec 1, 2023
1 parent 1ab4685 commit e4ab937
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 75 deletions.
63 changes: 40 additions & 23 deletions helm/examples/tracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ All configuration options detailed here are part of the HPCC Systems Helm chart,
- disabled - (default: false) disables tracking and reporting of internal traces and spans
- alwaysCreateGlobalIds - If true, assign newly created global ID to any requests that do not supply one.
- optAlwaysCreateTraceIds - If true components generate trace/span ids if none are provided by the remote caller.
- logSpanStart - If true, generate a log entry whenever a span is started (default: false)
- logSpanFinish - If true, generate a log entry whenever a span is finished (default: false)
- exporter - Defines The type of exporter in charge of forwarding span data to target back-end
- type - (defalt: NONE) "OTLP-HTTP" | "OTLP-GRCP" | "OS" | "JLog" | "NONE"
- JLog
Expand Down Expand Up @@ -58,8 +60,7 @@ Tracing information can be exported to various Open Telemetry compatible endpoin

Sample span reported as log event:
```console

0000015D MON EVT 2023-11-30 16:27:54.648 8 210 UNK "{ "Name": "HTTPRequest", "TraceId": "2df78ee79efad958f14d23ce6f8d8efb", "SpanId": "8d1da51fff39bb5b", "Start": 1701361674647713804, "Duration": 873300, "Attributes": {"http.request.method": "GET","hpcc.globalid": "JJcnsgDMP2vsjVtKH5wxSh" } }"
00000165 MON EVT 2023-12-01 17:19:07.270 8 688 UNK "{ "name": "HTTPRequest", "trace_id": "891070fc4a9ef5a3751c19c555d7d4a8", "span_id": "23a47b5bb486ce58", "start": 1701451147269962337, "duration": 652093, "Attributes": {"http.request.method": "GET","hpcc.localid": "JJmSnTeFWTQL8ft9DcbYDK","hpcc.globalid": "JJmSnTedcRZ99RtnwWGwPN" } }""
```

Each log statement includes a timestamp denoting the span start time, and a duration along with the span name, trace and span id, and any HPCC specific attribute such as legacy GlobalID (if any), HPCC CallerID (if any), LocalID (if any).
Expand All @@ -70,29 +71,45 @@ Spans exported via exporters will contain more detailed information such as expl
Sample exported span data:
```json
{
"Name":"propagatedServerSpan",
"TraceId":"beca49ca8f3138a2842e5cf21402bfff",
"SpanId":"6225221529c24252",
"kind":"Server",
"ParentSpanId":"4b960b3e4647da3f",
"Start":1696983526105561763,
"Duration":1056403,
"Description":"",
"Status":"Unset",
"TraceState":"hpcc=4b960b3e4647da3f",
"Attributes":{
"hpcc.callerid":"IncomingCID",
"hpcc.globalid":"IncomingUGID"
"name": "HTTPRequest",
"trace_id": "53f47047517e9dd9f5ad8c318b4b4fe0",
"span_id": "b9489283b66c1073",
"start": 1701456073994968800,
"duration": 1002426,
"Attributes": {
"http.request.method": "GET",
"hpcc.localid": "JJmvRRBJ1QYU8o4xe1sgxJ",
"hpcc.globalid": "JJmvRRBjnJGY6vgkjkAjJc"
},
"events": [
{
"name": "Acquiring lock",
"time_stamp": 1701456073995175400,
"Attributes": {
"lock_name": "resourcelock"
}
},
"Events":{},
"Links":{},
"Resources":{
"service.name":"unknown_service",
"telemetry.sdk.version":"1.9.1",
"telemetry.sdk.name":"opentelemetry",
"telemetry.sdk.language":"cpp"
{
"name": "Got lock, doing work...",
"time_stamp": 1701456073995269400,
"Attributes": {
"lock_name": "resourcelock"
}
},
"InstrumentedLibrary":"esp"
{
"name": "Release lock",
"time_stamp": 1701456073996269400,
"Attributes": {
"lock_name": "resourcelock"
}
}
],
"resources": {
"service.name": "unknown_service",
"telemetry.sdk.version": "1.9.1",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.language": "cpp"
}
}
```

Expand Down
4 changes: 2 additions & 2 deletions helm/hpcc/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@
"properties": {
"type": {
"type": "string",
"enum": ["OTLP-HTTP", "OTLP-GRCP", "OS", "JLog", "NONE"],
"enum": ["OTLP-HTTP", "OTLP-GRCP", "OS", "JLOG", "NONE"],
"description": "The type of exporter in charge of forwarding span data to target back-end"
}
}
Expand All @@ -1144,7 +1144,7 @@
"logSpanFinish": {
"type": "boolean",
"description": "If true, generate a log entry whenever a span is finished",
"default": true
"default": false
}
},
"additionalProperties": { "type": ["integer", "string", "boolean"] }
Expand Down
Loading

0 comments on commit e4ab937

Please sign in to comment.