Skip to content

Prometheus exporter failing with 'tls' has invalid keys: insecure #6229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gabrielgiussi opened this issue Oct 4, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@gabrielgiussi
Copy link

Describe the bug
I'm getting an error trying to disable tls in prometheus metrics exporter

2022-10-04 12:55:55.652865 I | collector server run finished with error: failed to get config: cannot unmarshal the configuration: error reading exporters configuration for "prometheus": 1 error(s) decoding:

* 'tls' has invalid keys: insecure

I've also tested putting insecure in the root of the prometheus configuration but was failing with '' has invalid keys: insecure.

What version did you use?
Both opentelemetry-collector-contrib and opentelemetry-collector images in version 0.61.0

What config did you use?

apiVersion: v1
kind: ConfigMap
metadata:
  name: collector-config
data:
  collector.yaml: |
    receivers:
      otlp:
        protocols: 
          grpc:
    processors:
    exporters:
      prometheus:
        endpoint: "0.0.0.0:4318"
        tls:
          insecure: true
        namespace: test-space
        const_labels:
          label1: value1
          "another label": spaced value
        send_timestamps: true
        metric_expiration: 180m
        enable_open_metrics: true
        resource_to_telemetry_conversion:
          enabled: true
    service:
      pipelines:
        traces:
          receivers: [otlp]
          processors: []
          exporters: [logging]
        metrics:
          receivers: [otlp]
          processors: []
          exporters: [prometheus]
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: opentelemetrycollector
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: opentelemetrycollector
  template:
    metadata:
      labels:
        app.kubernetes.io/name: opentelemetrycollector
    spec:
      containers:
        - name: otelcol
          args:
            - --config=/conf/collector.yaml
          image: otel/opentelemetry-collector:0.61.0
          volumeMounts:
            - mountPath: /conf
              name: collector-config
      volumes:
        - configMap:
            items:
              - key: collector.yaml
                path: collector.yaml
            name: collector-config
          name: collector-config          

Additional context
Related issue open-telemetry/opentelemetry-collector-contrib#5377

@gabrielgiussi gabrielgiussi added the bug Something isn't working label Oct 4, 2022
@bogdandrutu
Copy link
Member

@gabrielgiussi on the server side you just need to not set any value for tls, so remove the 2 lines:

        tls:
          insecure: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants