Comments (9)
looks good
from mqtt-exporter.
Sure, I'll have a look
from mqtt-exporter.
It seems by default there is no client_id generated. See here
if client_id == "" or client_id is None:
if protocol == MQTTv31:
self._client_id = base62(uuid.uuid4().int, padding=22)
else:
self._client_id = b""
Also, I did not find a clean way to get the client id, as it is a private attribute of client object.
Do you need to have the client id auto generated, or do you want to specify it manually?
from mqtt-exporter.
I would specify it manually using an ENV variable... if the variable is not present the client_id can be auto generated
from mqtt-exporter.
ok, I'll add the possibility to specify the client id, and I'll expose it in the metrics if existing.
If the variable is not present the client_id can be auto generated
According the documentation, when client-id is empty, this is up to the MQTT broker to generate it. But the broker does not seem to send back the client-id to the client. In debug mode, client._client_id remains empty even during message processing.
If I force the client-id auto generation on client side, I would have to handle all possible issues such as client id already used.
from mqtt-exporter.
Yes just leave the id empty and let the server auto generate something...
from mqtt-exporter.
But the broker does not seem to send back the client-id to the client.
Confirmed here: eclipse/paho.mqtt.python#237 (comment) :
No, if the server generate the clientid then it is not send to client.`
It looks like the behavior is fixed in MQTT v5: eclipse/paho.mqtt.python#237 (comment)
But default protocol in python MQTT client library is MQTT3.1.1.
I'll try with an option to choose the MQTT 5 version. If it is working, we will be able to get back the id generated by the broker and to expose it in Prometheus.
from mqtt-exporter.
would it work for you? #26.
Feel free to test.
I still need to add some functional tests before merging it.
from mqtt-exporter.
Code merged
from mqtt-exporter.
Related Issues (20)
- LOG_LEVEL HOT 2
- Shelly metrics reporting as zero HOT 5
- exporter does not produce any device metric HOT 5
- Feature Request: zwavejs2mqtt support HOT 18
- ZIGBEE2MQTT_AVAILABILITY not working HOT 16
- Actions: Docker image tags HOT 5
- Doesn't support Shelly 3EM format very well HOT 5
- Tag docker images with release version number HOT 5
- Once unavailable always unavailable even after becoming available in zigbee2mqtt HOT 9
- Support esphome format HOT 12
- ValueError: Invalid metric name with '/' HOT 9
- Pin dependencies version
- crash loop with google coral metric HOT 11
- Hubitat support HOT 16
- emporiavue2/esphome support HOT 2
- HomeAssistant HOT 3
- Shelly Plus H&T topic format not working with exporter HOT 5
- Attach additional labels from message user properties HOT 1
- UserProperty attribute exception HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqtt-exporter.