Skip to content

Commit

Permalink
HPCC-30401 JTrace optionally suppress trace/span IDs
Browse files Browse the repository at this point in the history
- Copies global.tracing to component helm values
- Revises logic to create otel span
-- Span created if per-span flag set
-- or global/component config flag set
-- or serverSpan receives valid remote parent
- Adds cppunit (cannot test scenario where no span created yet)

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Nov 9, 2023
1 parent b39f52f commit e1c7fba
Show file tree
Hide file tree
Showing 16 changed files with 122 additions and 57 deletions.
15 changes: 14 additions & 1 deletion helm/hpcc/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,18 @@ logging:
{{- end -}}
{{- end -}}

{{/*
Generate local tracing info, merged with global
Pass in dict with root and me
*/}}
{{- define "hpcc.generateTracingConfig" -}}
{{- $tracing := deepCopy (.me.tracing | default dict) | mergeOverwrite dict (.root.Values.global.tracing | default dict) -}}
{{- if not (empty $tracing) }}
tracing:
{{ toYaml $tracing | indent 2 }}
{{- end -}}
{{- end -}}

{{/*
Generate local metrics configuration, merged with global
Pass in dict with root and me
Expand Down Expand Up @@ -1304,8 +1316,9 @@ data:
{{ $configMapName }}.yaml:
version: 1.0
sasha:
{{ toYaml (omit .me "logging") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
{{- if hasKey .me "plane" }}
{{- $sashaStoragePlane := .me.plane | default (include "hpcc.getFirstPlaneForCategory" (dict "root" .root "category" "sasha")) }}
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/templates/dafilesrv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ data:
{{ .me.name }}.yaml:
version: 1.0
dafilesrv:
{{ toYaml (omit .me "logging" "env") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
global:
{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }}
{{- end -}}
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/templates/dali.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ data:
{{ $dali.name }}.yaml: |
version: 1.0
dali:
{{ toYaml (omit $dali "logging" "services" "env") | indent 6 }}
{{ toYaml (omit $dali "logging" "tracing" "services" "env") | indent 6 }}
dataPath: {{ include "hpcc.getPlanePrefix" (dict "root" $ "planeName" $daliStoragePlane) }}
{{- include "hpcc.generateLoggingConfig" $commonCtx | indent 6 }}
{{- include "hpcc.generateTracingConfig" $commonCtx | indent 6 }}
{{- include "hpcc.generateMetricsConfig" $commonCtx | indent 6 }}
{{ include "hpcc.generateVaultConfig" (dict "root" $ "secretsCategories" $daliSecretsCategories ) | indent 6 }}
foreignAccess: {{ include "hpcc.isForeignAccessConfigured" (dict "root" $ "me" .) | default "false" }}
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/templates/dfuserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ data:
{{ .me.name }}.yaml:
version: 1.0
dfuserver:
{{ toYaml (omit .me "logging" "env") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
global:
{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }}
{{- end -}}
Expand Down
6 changes: 4 additions & 2 deletions helm/hpcc/templates/eclagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ data:
{{ .me.name }}.yaml:
version: 1.0
eclagent:
{{ toYaml (omit .me "logging" "env") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
{{ $apptype }}:
{{ toYaml (omit .me "logging" "env") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
global:
{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }}
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/templates/eclccserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ data:
{{ .me.name }}.yaml:
version: 1.0
eclccserver:
{{ toYaml (omit .me "logging") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
queues:
{{ include "hpcc.generateConfigMapQueues" .root | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/templates/eclscheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ data:
{{ .me.name }}.yaml:
version: 1.0
eclscheduler:
{{ toYaml (omit .me "logging" "env") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
queues:
{{ include "hpcc.generateConfigMapQueues" .root | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/templates/esp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ data:
{{ .me.name }}.yaml:
version: 1.0
esp:
{{ toYaml (omit .me "logging" "metrics" "env") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing" "metrics" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
{{- include "hpcc.generateMetricsConfig" . | indent 6 }}
{{- if and .root.Values.certificates .root.Values.certificates.enabled }}
{{- $externalCert := (ne (include "hpcc.isVisibilityPublic" (dict "root" .root "visibility" .me.service.visibility)) "") -}}
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/templates/localroxie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ data:
{{ .me.name }}.yaml:
version: 1.0
roxie:
{{ toYaml (omit .me "logging" "env") | indent 6 }}
{{ toYaml (omit .me "logging" "tracing" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" . | indent 6 }}
{{- include "hpcc.generateTracingConfig" . | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
global:
{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }}
Expand Down
6 changes: 4 additions & 2 deletions helm/hpcc/templates/roxie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data:
{{- include "hpcc.addTLSServiceEntries" (dict "root" $root "service" $service "component" $component "visibility" $service.visibility "remoteClients" $service.remoteClients "trustClients" $service.trustClients "includeTrustedPeers" true "incluedRoxieAndEspServices" true) | indent 6 }}
{{- end }}
{{- end }}
{{ toYaml ( omit .me "logging" "topoServer" "encryptInTransit" "env" "services") | indent 6 }}
{{ toYaml ( omit .me "logging" "tracing" "topoServer" "encryptInTransit" "env" "services") | indent 6 }}
numChannels: {{ .numChannels }}
topologyServers: "{{ .toponame }}:{{ .topoport }}"
heartbeatInterval: {{ .heartbeatInterval }}
Expand All @@ -60,6 +60,7 @@ data:
encryptInTransit: {{ $mtlsEnabled }}
{{ end -}}
{{- include "hpcc.generateLoggingConfig" (dict "root" .root "me" .me) | indent 6 }}
{{- include "hpcc.generateTracingConfig" (dict "root" .root "me" .me) | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
global:
{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }}
Expand All @@ -73,8 +74,9 @@ data:
{{ .toponame }}.yaml:
version: 1.0
toposerver:
{{ toYaml ( omit .toposerver "logging" "env") | indent 6 }}
{{ toYaml ( omit .toposerver "logging" "tracing" "env") | indent 6 }}
{{- include "hpcc.generateLoggingConfig" (dict "root" .root "me" .toposerver) | indent 6 }}
{{- include "hpcc.generateTracingConfig" (dict "root" .root "me" .toposerver) | indent 6 }}
global:
{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }}
{{- end -}}
Expand Down
6 changes: 5 additions & 1 deletion helm/hpcc/templates/thor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Pass in dict with root and me
{{- $thorAgentScope := dict "name" .thorAgentName "replicas" .thorAgentReplicas "maxActive" .me.maxGraphs | merge (pick .me "keepJobs") }}
{{- $eclAgentResources := .me.eclAgentResources | default dict -}}
{{- $hthorScope := dict "name" $hthorName "jobMemorySectionName" "eclAgentMemory" | merge (pick .me "multiJobLinger" "maxGraphStartupTime") | merge (dict "resources" (deepCopy $eclAgentResources)) }}
{{- $thorScope := omit .me "eclagent" "thoragent" "hthor" "logging" "env" "eclAgentResources" "eclAgentUseChildProcesses" "eclAgentReplicas" "thorAgentReplicas" "eclAgentType" }}
{{- $thorScope := omit .me "eclagent" "thoragent" "hthor" "logging" "tracing" "env" "eclAgentResources" "eclAgentUseChildProcesses" "eclAgentReplicas" "thorAgentReplicas" "eclAgentType" }}
{{- $misc := .root.Values.global.misc | default dict }}
{{- $postJobCommand := $misc.postJobCommand | default "" }}
{{- $eclAgentJobName := printf "%s-job-_HPCC_JOBNAME_" $eclAgentType }}
Expand All @@ -51,20 +51,24 @@ data:
thor:
{{ toYaml $thorScope | indent 6 }}
{{- include "hpcc.generateLoggingConfig" (dict "root" .root "me" $thorScope) | indent 6 }}
{{- include "hpcc.generateTracingConfig" (dict "root" .root "me" $thorScope) | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
{{ $eclAgentType }}: # hthor or roxie
{{ toYaml $hthorScope | indent 6 }}
platform:
type: "thor"
width: {{ mul ($thorScope.numWorkers | default 1) ( $thorScope.channelsPerWorker | default 1) }}
{{- include "hpcc.generateLoggingConfig" (dict "root" .root "me" $hthorScope ) | indent 6 }}
{{- include "hpcc.generateTracingConfig" (dict "root" .root "me" $hthorScope ) | indent 6 }}
{{ include "hpcc.generateVaultConfig" . | indent 6 }}
eclagent: # main agent Q handler
{{ toYaml $eclAgentScope | indent 6 }}
{{- include "hpcc.generateLoggingConfig" (dict "root" .root "me" $eclAgentScope) | indent 6 }}
{{- include "hpcc.generateTracingConfig" (dict "root" .root "me" $eclAgentScope) | indent 6 }}
thoragent: # Thor graph handler
{{ toYaml $thorAgentScope | indent 6 }}
{{- include "hpcc.generateLoggingConfig" (dict "root" .root "me" $thorAgentScope) | indent 6 }}
{{- include "hpcc.generateTracingConfig" (dict "root" .root "me" $thorAgentScope) | indent 6 }}
type: thor
global:
{{ include "hpcc.generateGlobalConfigMap" .root| indent 6 }}
Expand Down
4 changes: 4 additions & 0 deletions helm/hpcc/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,10 @@
"alwaysCreateGlobalIds": {
"type": "boolean",
"description": "If true, allocate global ids to any requests that do not supply one"
},
"alwaysCreateTraceIds": {
"type": "boolean",
"description": "If true, components generate trace/span ids to aid in unit of worktracing"
}
},
"additionalProperties": { "type": ["integer", "string", "boolean"] }
Expand Down
3 changes: 2 additions & 1 deletion helm/hpcc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ global:
# logging sets the default logging information for all components. Can be overridden locally
logging:
detail: 80

tracing:
alwaysCreateTraceIds: true
## resource settings for stub components
#stubInstanceResources:
# memory: "200Mi"
Expand Down
Loading

0 comments on commit e1c7fba

Please sign in to comment.