Skip to content

Commit

Permalink
HPCC-30470 Change2
Browse files Browse the repository at this point in the history
- Adds JLog output config feature flags
- Change jlog exporter to be more jlib centric
- Replace lock w/ std:atomic bool
- Suppress empty json elemets
- Remove CSpan toLog
- Remove toLog unittest
- Remove log output at CSPan start/end
- Updates tracing README
- Adds jlog config sample
- Defaults tracing to jlog

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Nov 30, 2023
1 parent abb9f7b commit 599163b
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 281 deletions.
42 changes: 24 additions & 18 deletions helm/examples/tracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@ All configuration options detailed here are part of the HPCC Systems Helm chart,
- 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: true)
- exporter - Defines The type of exporter in charge of forwarding span data to target back-end
- type - (defalt: NONE) "OTLP-HTTP" | "OTLP-GRCP" | "OS" | "NONE"
- type - (defalt: NONE) "OTLP-HTTP" | "OTLP-GRCP" | "OS" | "JLog" | "NONE"
- JLog
- logSpanDetails - Log span details such as description, status, kind
- logParentInfo - Log the span's parent info such as ParentSpanId, and TraceState
- logAttributes - Log the span's attributes
- logEvents - Log the span's events
- logLinks - Log the span's links
- logResources - Log the span's resources such as telemetry.sdk version, name, language
- OTLP-HTTP
- endpoint - (default localhost:4318) Specifies the target OTLP-HTTP backend
- timeOutSecs - (default 10secs)
- consoleDebug - (default false)
- endpoint - (default localhost:4318) Specifies the target OTLP-HTTP backend
- timeOutSecs - (default 10secs)
- consoleDebug - (default false)
- OTLP-GRCP
- endpoint: (default localhost:4317) The endpoint to export to. By default the OpenTelemetry Collector's default endpoint.
- useSslCredentials - By default when false, uses grpc::InsecureChannelCredentials; If true uses sslCredentialsCACertPath
- sslCredentialsCACertPath - Path to .pem file to be used for SSL encryption.
- timeOutSeconds - (default 10secs) Timeout for grpc deadline
- endpoint: (default localhost:4317) The endpoint to export to. By default the OpenTelemetry Collector's default endpoint.
- useSslCredentials - By default when false, uses grpc::InsecureChannelCredentials; If true uses sslCredentialsCACertPath
- sslCredentialsCACertPath - Path to .pem file to be used for SSL encryption.
- timeOutSeconds - (default 10secs) Timeout for grpc deadline
- processor - Controls span processing style. One by one as available, or in batches.
- type - (default: simple) "simple" | "batch"
- type - (default: simple) "simple" | "batch"

### Sample configuration
Below is a sample helm values block directing the HPCC tracing framework to process span information serially, and export the data over OTLP/HTTP protocol to localhost:4318 and output export debug information to console:
Expand All @@ -49,16 +56,16 @@ helm install myTracedHPCC hpcc/hpcc -f otlp-http-collector-default.yaml
## Tracing information
HPCC tracing information includes data needed to trace requests as they traverse over distributed components, and detailed information pertaining to important request subtasks in the form of span information. Each trace and all its related spans are assigned unique IDs which follow the Open Telemetry standard.

The start and end of spans are reported to HPCC component logs regardless of any exporter related configuration.
Tracing information can be exported to various Open Telemetry compatible endpoints including HPCC component logs, or OTLP collectors, etc. By default, tracing information is configured to be exported to HPCC component logs.

Sample span reported as log event:
```console
000000A3 MON EVT 2023-10-10 22:12:23.827 24212 25115 Span start: {"Type":"Server","Name":"propagatedServerSpan","GlobalID":"IncomingUGID","CallerID":"IncomingCID","LocalID":"JDbF4xnv7LSWDV4Eug1SpJ","TraceID":"beca49ca8f3138a2842e5cf21402bfff","SpanID":"4b960b3e4647da3f"}

000000FF MON EVT 2023-10-10 22:12:24.927 24212 25115 Span end: {"Type":"Server","Name":"propagatedServerSpan","GlobalID":"IncomingUGID","CallerID":"IncomingCID","LocalID":"JDbF4xnv7LSWDV4Eug1SpJ","TraceID":"beca49ca8f3138a2842e5cf21402bfff","SpanID":"4b960b3e4647da3f"}
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" } }"
```

Each log statement denotes the time of the tracing event (start or stop), the span type, name, trace and span id, and any HPCC specific attribute such as legacy GlobalID (if any), HPCC CallerID (if any), LocalID (if any).
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).
The span info logged can be expanded to include span resources, events, and other details (see configuration details).

Spans exported via exporters will contain more detailed information such as explicit start time, duration, and any other attribute assigned to the span by the component instrumentation.

Expand All @@ -79,21 +86,20 @@ Sample exported span data:
"hpcc.callerid":"IncomingCID",
"hpcc.globalid":"IncomingUGID"
},
"Events":{
},
"Links":{
},
"Events":{},
"Links":{},
"Resources":{
"service.name":"unknown_service",
"telemetry.sdk.version":"1.9.1",
"telemetry.sdk.name":"opentelemetry",
"telemetry.sdk.language":"cpp"
},
"InstrumentedLibrary":"esp"

}
```

## Directory Contents

- 'otlp-http-collector-default.yaml' - Sample tracing configuration targeting OTLP/HTTP trace collector
- 'otlp-grcp-collector-default.yaml' - Sample tracing configuration targeting OTLP/GRCP trace collector
- 'jlog-collector-fulloutput.yaml' - Sample tracing configuration targeting HPCC component logs
10 changes: 10 additions & 0 deletions helm/examples/tracing/jlog-collector-fulloutput.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
global:
tracing:
exporter:
type: JLog
logSpanDetails: true
logParentInfo: true
logAttributes: true
logEvents: true
logLinks: true
logResources: true
Loading

0 comments on commit 599163b

Please sign in to comment.