From eb7fbc1c5af85166fb92b7c8f06adf77cbca13e1 Mon Sep 17 00:00:00 2001 From: Helio Frota <00hf11@gmail.com> Date: Mon, 13 Jan 2025 15:33:03 -0300 Subject: [PATCH] feat: working with OTEL collector --- .github/workflows/lint-test.yaml | 2 +- .github/workflows/release.yaml | 3 +- charts/trustify-infrastructure/Chart.lock | 7 +++-- charts/trustify-infrastructure/Chart.yaml | 4 +++ charts/trustify-infrastructure/values.yaml | 29 +++++++++++++++++++ .../templates/helpers/_infrastructure.tpl | 2 ++ 6 files changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 5584883..ef9cb82 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -31,7 +31,7 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v4.2.0 with: - version: v3.13.0 + version: v3.13.3 # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and # yamllint (https://github.com/adrienverge/yamllint) which require Python diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c029330..7e47b6c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,9 +26,10 @@ jobs: - name: Install Helm uses: azure/setup-helm@v4.2.0 with: - version: v3.13.0 + version: v3.13.3 - run: | + helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts helm repo add jaeger https://jaegertracing.github.io/helm-charts - name: Run chart-releaser diff --git a/charts/trustify-infrastructure/Chart.lock b/charts/trustify-infrastructure/Chart.lock index 3a88ba3..08967f1 100644 --- a/charts/trustify-infrastructure/Chart.lock +++ b/charts/trustify-infrastructure/Chart.lock @@ -8,5 +8,8 @@ dependencies: - name: jaeger repository: https://jaegertracing.github.io/helm-charts version: 3.3.3 -digest: sha256:1af1b7a450ff013caa7b815c14fe1a34040770a01aa765ff8b15cd41e840ad27 -generated: "2024-12-17T10:22:56.132130532+01:00" +- name: opentelemetry-collector + repository: https://open-telemetry.github.io/opentelemetry-helm-charts + version: 0.110.3 +digest: sha256:3f19b3ab66618999059dc55e5c21f4ea9f14197b9510db96214d57fd23900ef0 +generated: "2025-01-14T08:55:44.404252021-03:00" diff --git a/charts/trustify-infrastructure/Chart.yaml b/charts/trustify-infrastructure/Chart.yaml index 9cd1e91..ac47f8d 100644 --- a/charts/trustify-infrastructure/Chart.yaml +++ b/charts/trustify-infrastructure/Chart.yaml @@ -34,3 +34,7 @@ dependencies: repository: https://jaegertracing.github.io/helm-charts version: 3.3.3 condition: jaeger.enabled + - name: opentelemetry-collector + repository: https://open-telemetry.github.io/opentelemetry-helm-charts + version: 0.110.3 + condition: opentelemetry-collector.enabled diff --git a/charts/trustify-infrastructure/values.yaml b/charts/trustify-infrastructure/values.yaml index 3454093..2aa0459 100644 --- a/charts/trustify-infrastructure/values.yaml +++ b/charts/trustify-infrastructure/values.yaml @@ -27,3 +27,32 @@ keycloakPostInstall: oidc: clients: {} + +opentelemetry-collector: + image: + repository: "otel/opentelemetry-collector-contrib" + enabled: true + nameOverride: otelcol + mode: deployment + presets: + kubernetesAttributes: + enabled: true + service: + type: ClusterIP + config: + receivers: + otlp: + protocols: + grpc: + endpoint: "infrastructure-otelcol:4317" + exporters: + otlp: + endpoint: "infrastructure-jaeger-collector:4317" + tls: + insecure: true + service: + pipelines: + traces: + exporters: [otlp] + processors: [batch] + receivers: [otlp] diff --git a/charts/trustify/templates/helpers/_infrastructure.tpl b/charts/trustify/templates/helpers/_infrastructure.tpl index 4dbe009..8c99301 100644 --- a/charts/trustify/templates/helpers/_infrastructure.tpl +++ b/charts/trustify/templates/helpers/_infrastructure.tpl @@ -44,6 +44,8 @@ Arguments (dict): value: parentbased_traceidratio - name: OTEL_TRACES_SAMPLER_ARG value: "0.1" +- name: OTEL_EXPORTER_OTLP_ENDPOINT + value: "http://infrastructure-otelcol:4317" {{- end }} {{- end }}