-
Notifications
You must be signed in to change notification settings - Fork 577
Description
Component(s)
collector
What happened?
Description
The service for monitoring used to be created with a port number defined in .spec.config.service.telemetry.metrics.address.
> kubectl get opentelemetrycollectors.opentelemetry.io logs -o yaml | yq .spec.config.service.telemetry
metrics:
address: 0.0.0.0:8889
> kubectl get svc logs-collector-monitoring -o yaml | yq .spec.ports
- name: monitoring
port: 8889
protocol: TCP
targetPort: 8889However, the service monitoring isn't created with the new metrics readers config, for example, .spec.config.service.telemetry.readers[].pull.exporter.prometheus.port.
> kubectl get opentelemetrycollectors.opentelemetry.io logs -o yaml | yq .spec.config.service.telemetry
metrics:
level: detailed
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8889
> kubectl get svc logs-collector-monitoring -o yaml
...
ports:
- name: monitoring
port: 8888
protocol: TCP
targetPort: 8888Thus, if the metrics port is set other than 8888, then a monitoring service no longer works correctly.
Steps to Reproduce
Define a port to expose an internal telemetry metrics other than 8888.
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: logs
spec:
...
config:
service:
telemetry:
metrics:
level: detailed
readers:
- pull:
exporter:
prometheus:
host: '0.0.0.0'
port: 8889Then deploy the manifest and see a service created with monitoring.
Expected Result
The monitoring service is created with a port number defined in the config.
Actual Result
The monitoring service is created with a port number 8888.
Kubernetes Version
v1.32.3
Operator version
v0.126.0
Collector version
v0.126.0
Environment information
Environment
Operator is deployed by a helm chart (https://open-telemetry.github.io/opentelemetry-helm-charts, opentelemetry-operator: v0.90.0
Log output
Additional context
helm chart values is nothing to do with this bug. But I just add here for reference
manager:
collectorImage:
repository: /path/to/otel-collector
resources:
limits:
memory: 1Gi
requests:
cpu: 100m
memory: 512Mi