-
Notifications
You must be signed in to change notification settings - Fork 11
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
Rust MQTT telemetry #182
Rust MQTT telemetry #182
Conversation
Generics management where a pain in some cases when you just don't have another context to link to the span you want, as the call would require to specify the optional type you pass (e.g. `None::<MyType<P,A,I,N>>') Remove the optional parameter from the `get_span` function and add another one `get_linked_span` which as a non optional argument where the context can be extracted from Signed-off-by: Nicolas Buffon <[email protected]>
Signed-off-by: Nicolas Buffon <[email protected]>
Signed-off-by: Nicolas Buffon <[email protected]>
Signed-off-by: Nicolas Buffon <[email protected]>
262ac32
to
5751495
Compare
Add the OTLP W3C context as user property in MQTT message on publish Signed-off-by: Nicolas Buffon <[email protected]>
5751495
to
bb116dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor comment.
No test.
rust/src/transport/telemetry.rs
Outdated
pub(crate) fn get_reception_mqtt_span(publish: &Publish) -> BoxedSpan { | ||
let tracer = global::tracer("iot3.core"); | ||
|
||
let topic = from_utf8(&publish.topic.to_vec()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let topic = from_utf8(&publish.topic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tests all working as described.
One comment, though: copycat
reports several informational messages that look like errors:
INFO [libits::client::application::pipeline] Cannot trace exchange, missing gateway component name in node configuration
Signed-off-by: Nicolas Buffon <[email protected]>
Message reception and emission are automatically traced by the SDK if the feature is enabled This can now be tested using the copycat example by initializing the tracer in the example Signed-off-by: Nicolas Buffon <[email protected]>
bb116dd
to
20f183c
Compare
This is because of the old KPI logging system which requires the Information message to be received once first, and test.mosquitto.org obviously does not send one |
What's new
Closes #124
How to test
Start a Jaeger/OTLP collector image
Create the test script
(or download it as txt test_copycat.txt)
Listen to MQTT messages with MQTTv5 properties
Edit the
examples/config.ini
file to fill the telemetry section with the following contentStart the copycat example with the telemetry feature
Launch the test script
=> Several reception must be logged
=> One message publication must be logged
The published message should be carrying the W3C context (logged by mosquitto_sub command)
The test scripts did prompt asking for a trace parent, answer it using the published message's one
Check the spans content on the local jaeger interface
=> You must see 8 traces
=> The 7th (the second most recent) must have a link to another span