Skip to content

Commit

Permalink
reduced Kamon startup warnings and logs
Browse files Browse the repository at this point in the history
* made loading of "otel-trace-reporter" configurable and by default, don't load it
* introduce new env var `DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED` which can in
  addition to `DITTO_TRACING_ENABLED` be used to just switch off OTEL reporting of traces

Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
  • Loading branch information
thjaeckle committed Oct 9, 2023
1 parent f3ed2ea commit 90c5602
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deployment/helm/ditto/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ description: |
A digital twin is a virtual, cloud based, representation of his real world counterpart
(real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc).
type: application
version: 3.4.0 # chart version is effectively set by release-job
version: 3.4.1 # chart version is effectively set by release-job
appVersion: 3.4.0-M1
keywords:
- iot-chart
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/ditto/templates/connectivity-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ spec:
{{- end }}
- name: DITTO_TRACING_ENABLED
value: "{{ .Values.global.tracing.enabled }}"
- name: DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED
value: "{{ .Values.global.tracing.otelTraceReporterEnabled }}"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ tpl .Values.global.tracing.otelExporterOtlpEndpoint . }}"
- name: DITTO_TRACING_SAMPLER
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/ditto/templates/gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ spec:
{{- end }}
- name: DITTO_TRACING_ENABLED
value: "{{ .Values.global.tracing.enabled }}"
- name: DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED
value: "{{ .Values.global.tracing.otelTraceReporterEnabled }}"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ tpl .Values.global.tracing.otelExporterOtlpEndpoint . }}"
- name: DITTO_TRACING_SAMPLER
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/ditto/templates/policies-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ spec:
{{- end }}
- name: DITTO_TRACING_ENABLED
value: "{{ .Values.global.tracing.enabled }}"
- name: DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED
value: "{{ .Values.global.tracing.otelTraceReporterEnabled }}"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ tpl .Values.global.tracing.otelExporterOtlpEndpoint . }}"
- name: DITTO_TRACING_SAMPLER
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/ditto/templates/things-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ spec:
{{- end }}
- name: DITTO_TRACING_ENABLED
value: "{{ .Values.global.tracing.enabled }}"
- name: DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED
value: "{{ .Values.global.tracing.otelTraceReporterEnabled }}"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ tpl .Values.global.tracing.otelExporterOtlpEndpoint . }}"
- name: DITTO_TRACING_SAMPLER
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/ditto/templates/thingssearch-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ spec:
{{- end }}
- name: DITTO_TRACING_ENABLED
value: "{{ .Values.global.tracing.enabled }}"
- name: DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED
value: "{{ .Values.global.tracing.otelTraceReporterEnabled }}"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ tpl .Values.global.tracing.otelExporterOtlpEndpoint . }}"
- name: DITTO_TRACING_SAMPLER
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/ditto/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ global:
tracing:
# enabled whether tracing (via OpenTelemetry) is enabled
enabled: false
# otelTraceReporterEnabled whether reporting traces via the OLTP endpoint should be activated
otelTraceReporterEnabled: false
# otelExporterOtlpEndpoint the OTLP endpoint to report traces to
otelExporterOtlpEndpoint: "http://localhost:4317"
# sampler the tracing sampler to use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,13 @@ processed and the tracing data is exported in [OpenTelemetry](https://openteleme
kamon-opentelemetry library.

Adjust the following environment variables to configure the Ditto services to produce traces:
* `DITTO_TRACING_ENABLED`: determines whether tracing is enabled (default:`false`)
* `DITTO_TRACING_ENABLED`: determines whether tracing is enabled (default: `false`)
* `DITTO_TRACING_SAMPLER`: defines the used sampler
* `always`: report all traces
* `never`: don't report any trace (default)
* `random`: randomly decide using the probability defined in the `DITTO_TRACING_RANDOM_SAMPLER_PROBABILITY` environment variable
* `adaptive`: keeps dynamic samplers for each operation while trying to achieve a set throughput goal (`DITTO_TRACING_ADAPTIVE_SAMPLER_THROUGHPUT`)
* `DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED`: whether reporting traces via the OLTP endpoint should be activated (default: `false`)
* `OTEL_EXPORTER_OTLP_ENDPOINT`: the OTLP endpoint where to report the gathered traces (default: `http://localhost:4317`)

## DevOps commands
Expand Down
8 changes: 7 additions & 1 deletion internal/utils/config/src/main/resources/ditto-kamon.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# To be included in kamon.conf of all services.

kamon {
show-aspectj-missing-warning = false
init {
hide-banner = yes
attach-instrumentation = no
}

metric {
tick-interval = 10s
Expand Down Expand Up @@ -68,6 +71,9 @@ kamon {
# otherwise we cannot run with OpenJDK Java Docker Images
process-metrics.enabled = no
host-metrics.enabled = no
otel-trace-reporter.enabled = no
otel-trace-reporter.enabled = ${?DITTO_TRACING_ENABLED}
otel-trace-reporter.enabled = ${?DITTO_TRACING_OTEL_TRACE_REPORTER_ENABLED}
}

trace {
Expand Down

0 comments on commit 90c5602

Please sign in to comment.