otel_mqtt_client 0.2.0
otel_mqtt_client: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:mqtt_client`. Helpers around MqttClient.connect / publishMessage / subscribe with messaging.* semconv spans.
Changelog #
0.2.0 - 2026-08-10 #
Changed #
-
Semantic conventions updated to the current OTel registry: deprecated attribute keys are no longer emitted (
db.system->db.system.name,db.operation->db.operation.name,rpc.system->rpc.system.name, withrpc.servicefolded into a fully-qualifiedrpc.method). -
Dependency floors raised to
dartastic_opentelemetry ^1.1.0-beta.12anddartastic_opentelemetry_api ^1.0.0-rc.1. The previous floors declared compatibility with API versions that predate the semconv enums this package uses and could not actually resolve-and-compile. -
repositoryURL corrected to the canonicalDartasticorg casing so pub.dev repository verification succeeds. -
Attribute keys now come from the API's registry enums (
Messaging.*,ErrorAttributes.*) instead of string literals, and the deprecatedmessaging.operationkey was replaced bymessaging.operation.name(plusmessaging.operation.typewhere a registry value applies, e.g.sendfor publish).
Added #
TracedMqttClientextension onMqttClient—tracedConnect,tracedDisconnect,tracedPublishMessage,tracedSubscribe,tracedUnsubscribemirror themqtt_clientsignatures exactly and wrap each call in the CLIENT span described below.tracedMqttCallAsync<R>({operation, topic, operationType, invoke})— generic async helper around connect/disconnect (which are async).tracedMqttCall<R>— sync helper around publishMessage / subscribe / unsubscribe (which are sync inmqtt_client).- Both emit a CLIENT span named
mqtt <operation> [<topic>]withmessaging.system=mqtt,messaging.operation.name,messaging.operation.type(when applicable) andmessaging.destination.name. - Zone-scoped suppression
(
runWithoutMqttInstrumentation/ async variant). - Example (
example/example.md). - 6 tests.
Note #
package:mqtt_clientspeaks MQTT 3.1/3.1.1, which has no message properties, so there is no W3C trace-context propagation surface; spans carry attributes only and context does not cross the broker.