Skip to content

Commit

Permalink
feat(Traefik Hub): use Traefik Proxy otlp config
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur authored May 21, 2024
1 parent cb2a98d commit a910db4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 108 deletions.
20 changes: 0 additions & 20 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
61 changes: 0 additions & 61 deletions traefik/tests/deployment-hub-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 0 additions & 27 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a910db4

Please sign in to comment.