Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

[mqtt-exporter] Issues with metrics/serviceMonitor #1736

Open
reefland opened this issue Aug 10, 2022 · 1 comment
Open

[mqtt-exporter] Issues with metrics/serviceMonitor #1736

reefland opened this issue Aug 10, 2022 · 1 comment

Comments

@reefland
Copy link

reefland commented Aug 10, 2022

Details

Helm chart name and version:

Issue when working with mqtt-exporter.

What steps did you take and what happened:

Possible missing section? mqtt-exporter section below indicates to check @default -- See values.yaml

metrics:
  # -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
  # @default -- See values.yaml
  enabled: false
  serviceMonitor:
    # -- Interval at which Prometheus should scrape metrics
    interval: 30s
    # -- Timeout after which the scrape is ended
    scrapeTimeout: 10s
    # -- Additional labels for the Kubernetes `ServiceMonitor` object
    labels: {}

When I review the common/values.yaml there is nothing about metrics or serviceMonitor in it, seems like there should be.

What did you expect to happen:

Expected to see metrics section within the common values.yaml

Anything else you would like to add:

The mqtt-exporter chart, creates a service for no clear reason I could see, I assume that is for the serviceMonitor. This seems incorrect. a PodMonitor should be used for applications that do not require a service. It's not clear if a PodMonitor is supported since the metrics section is missing.

When I curl against the serviceMonitor, I get data back but there is really nothing about MQTT included:

$ k get svc -n mosquitto
NAME                               TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)          AGE
mosquitto-mqtt                     LoadBalancer   10.43.57.103   192.168.10.222   1883:31162/TCP   7h14m
mosquitto-exporter-mqtt-exporter   ClusterIP      10.43.23.150   <none>           9000/TCP         84m

$ curl -s http://10.43.23.150:9000/metrics
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 95.0
python_gc_objects_collected_total{generation="1"} 296.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 43.0
python_gc_collections_total{generation="1"} 3.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="10",patchlevel="5",version="3.10.5"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 2.471936e+07
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 1.6093184e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.66009557928e+09
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 1.39
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 7.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
# HELP mqtt_message_total Counter of received messages
# TYPE mqtt_message_total counter

There is nothing about the broker, clients connected, etc. which I assume there should be?

The exporter is connected and subscribed to the broker:

$ k logs mosquitto-exporter-mqtt-exporter-6dd9f8c77d-hg5n4 -n mosquitto
INFO:mqtt-exporter:subscribing to "#"
@reefland reefland added the bug label Aug 10, 2022
@bjw-s
Copy link
Contributor

bjw-s commented Aug 10, 2022

Thanks for taking the time to write up this issue. Exposing metrics / serviceMonitor is not a feature of the common library though, so this repo is not the correct place for it. I've moved it over to the charts repo, where it might be better suited.

@bjw-s bjw-s transferred this issue from k8s-at-home/library-charts Aug 10, 2022
@bjw-s bjw-s changed the title Missing metrics section from common values.yaml ?!? [mqtt-explorer] Issues with metrics/serviceMonitor Aug 10, 2022
@bjw-s bjw-s removed the bug label Aug 10, 2022
@bjw-s bjw-s changed the title [mqtt-explorer] Issues with metrics/serviceMonitor [mqtt-exporter] Issues with metrics/serviceMonitor Aug 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants