Charts: prometheus-operator additionalServiceMonitors attempts to create a ServiceMonitor with an empty name

Created on 10 Dec 2018  路  3Comments  路  Source: helm/charts

https://github.com/helm/charts/blob/9143206f0af35b7010c05b836a0d86aa68f002fa/stable/prometheus-operator/templates/prometheus/servicemonitors.yaml#L9

It appears that this variable does not have a value _or_ it is unclear how to configure it.

My configuration is as follows:

additionalServiceMonitors:
  - selector:
      matchLabels:
        release: proxy-gateway
    namespaceSelector:
      matchNames:
        - default
    endpoints:
      - port: monitoring
        interval: 10s

Most helpful comment

@gajus Hey, I just solved this - although its not stated anywhere in the docs, each additionalServiceMonitor entry requires a name property. So your example would become:

additionalServiceMonitors:
  - name: proxy-gateway-monitor
    selector:
      matchLabels:
        release: proxy-gateway
    namespaceSelector:
      matchNames:
        - default
    endpoints:
      - port: monitoring
        interval: 10s

All 3 comments

I am facing the same issue; adding an additionalServiceMonitor with a configuration similar to the above results in Error: UPGRADE FAILED: Could not get information about the resource: resource name may not be empty

@gajus Hey, I just solved this - although its not stated anywhere in the docs, each additionalServiceMonitor entry requires a name property. So your example would become:

additionalServiceMonitors:
  - name: proxy-gateway-monitor
    selector:
      matchLabels:
        release: proxy-gateway
    namespaceSelector:
      matchNames:
        - default
    endpoints:
      - port: monitoring
        interval: 10s

Thank you for sharing the solution.

Was this page helpful?
0 / 5 - 0 ratings