From a910db40fc9f3889a221003ca674242a2458744c Mon Sep 17 00:00:00 2001 From: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> Date: Tue, 21 May 2024 08:50:04 +0200 Subject: [PATCH] feat(Traefik Hub): use Traefik Proxy otlp config --- traefik/templates/_podtemplate.tpl | 20 ------ traefik/tests/deployment-hub-config_test.yaml | 61 ------------------- traefik/values.yaml | 27 -------- 3 files changed, 108 deletions(-) diff --git a/traefik/templates/_podtemplate.tpl b/traefik/templates/_podtemplate.tpl index c9f3cbe9a..e9bc49c40 100644 --- a/traefik/templates/_podtemplate.tpl +++ b/traefik/templates/_podtemplate.tpl @@ -668,26 +668,6 @@ {{- end }} {{- end }} {{- end }} - {{- if .metrics.opentelemetry.enabled }} - - "--hub.metrics.opentelemetry" - {{- range $field, $value := .metrics.opentelemetry }} - {{- if has $field (list "address" "explicitBoundaries" "grpc" "insecure" "path" "pushInterval") -}} - {{- with $value }} - - "--hub.metrics.opentelemetry.{{ $field }}={{ $value }}" - {{- end -}} - {{- end }} - {{- end }} - {{- range $name, $value := .metrics.opentelemetry.headers }} - - "--hub.metrics.opentelemetry.headers.{{ $name }}={{ $value }}" - {{- end }} - {{- range $field, $value := .metrics.opentelemetry.tls }} - {{- if has $field (list "ca" "cert" "insecureSkipVerify" "key") -}} - {{- with $value }} - - "--hub.metrics.opentelemetry.tls.{{ $field }}={{ $value }}" - {{- end }} - {{- end }} - {{- end }} - {{- end }} {{- with .platformUrl }} - "--hub.platformUrl={{ . }}" {{- end -}} diff --git a/traefik/tests/deployment-hub-config_test.yaml b/traefik/tests/deployment-hub-config_test.yaml index 2b89fa6cb..0c9b2e3b8 100644 --- a/traefik/tests/deployment-hub-config_test.yaml +++ b/traefik/tests/deployment-hub-config_test.yaml @@ -80,67 +80,6 @@ tests: - notContains: path: spec.template.spec.containers[0].args content: "--hub.apimanagement" - - it: should be possible to enable and configure opentelemetry parameters (and ignore extra) - set: - hub: - metrics: - opentelemetry: - enabled: true - address: "address" - explicitBoundaries: "0.1,0.3,1.2,5.0" - grpc: true - headers: - foo: bar - foo2: bar2 - insecure: true - path: "path" - pushInterval: "2m" - tls: - ca: "ca" - cert: "cert" - insecureSkipVerify: true - key: "key" - test: "dontexist" - asserts: - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.address=address" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.explicitBoundaries=0.1,0.3,1.2,5.0" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.grpc=true" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.headers.foo=bar" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.headers.foo2=bar2" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.path=path" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.pushInterval=2m" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.tls.cert=cert" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.tls.ca=ca" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.tls.insecureSkipVerify=true" - - contains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.tls.key=key" - - notContains: - path: spec.template.spec.containers[0].args - content: "--hub.metrics.opentelemetry.test=test" - it: should be possible to specify platformUrl set: hub: diff --git a/traefik/values.yaml b/traefik/values.yaml index 70297f676..2fd9282b5 100644 --- a/traefik/values.yaml +++ b/traefik/values.yaml @@ -1024,33 +1024,6 @@ hub: # -- Certificate of the WebHook admission server. Default: "hub-agent-cert". secretName: - metrics: - opentelemetry: - # -- Set to true to enable OpenTelemetry metrics exporter of Traefik Hub. - enabled: - # -- Address (host:port) of the collector endpoint. Default: "localhost:4318". - address: - # -- Boundaries of latency metrics. Default: " 0.005000, 0.010000, 0.025000, 0.050000, 0.100000, 0.250000, 0.500000, 1.000000, 2.500000, 5.000000, 10.000000 " - explicitBoundaries: - # -- Enables gRPC for the OpenTelemetry collector. Default: false. - grpc: - # -- Additional headers to send to the collector. Default: {}. - headers: - # -- Enable insecure schemes on metric endpoints. Default: false. - insecure: - # -- Collector endpoint path. Default: "". - path: - # -- Interval between metric exports. Default: "10s". - pushInterval: - tls: - # -- Path to the certificate authority used for the secured connection. - ca: - # -- Path to the public certificate used for the secure connection. - cert: - # -- Path to the private key used for the secure connection. - key: - # -- When insecureSkipVerify is set to true, the TLS connection accepts any certificate presented by the server. Default: false. - insecureSkipVerify: ratelimit: redis: # -- Enable Redis Cluster. Default: true.