Skip to content

Commit

Permalink
Disable messaging observation by default for backwards compatibility
Browse files Browse the repository at this point in the history
Fixes #38889

(cherry picked from commit 1921c45)
  • Loading branch information
ozangunalp authored and gsmet committed Feb 20, 2024
1 parent bdac5c7 commit d4e9086
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
25 changes: 21 additions & 4 deletions docs/src/main/asciidoc/kafka.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2048,14 +2048,31 @@ mp.messaging.incoming.data.tracing-enabled=false
If the xref:telemetry-micrometer.adoc[Micrometer extension] is present,
then Kafka producer and consumer clients metrics are exposed as Micrometer meters.

Per channel metrics are also exposed as Micrometer meters.
The number of messages produced or received per channel, acknowledgments and duration of processing are exposed.
=== Channel metrics

The messaging meters can be disabled:
Per channel metrics can also be gathered and exposed as Micrometer meters.
Following metrics can be gathered per channel, identified with the _channel_ tag:

* `quarkus.messaging.message.count` : The number of messages produced or received
* `quarkus.messaging.message.acks` : The number of messages processed successfully
* `quarkus.messaging.message.failures` : The number of messages processed with failures
* `quarkus.messaging.message.duration` : The duration of the message processing.

For backwards compatibility reasons channel metrics are not enabled by default and can be enabled with:

[IMPORTANT]
====
The https://smallrye.io/smallrye-reactive-messaging/latest/concepts/observability/[message observation]
depends on intercepting messages and therefore doesn't support channels consuming messages with
a custom message type such as `IncomingKafkaRecord`, `KafkaRecord`, `IncomingKafkaRecordBatch` or `KafkaRecordBatch`.
The message interception, and observation, still work with channels consuming the generic `Message` type,
or custom payloads enabled by https://smallrye.io/smallrye-reactive-messaging/latest/concepts/converters/[converters].
====

[source, properties]
----
quarkus.micrometer.binder.messaging.enabled=false
smallrye.messaging.observation.enabled=true
----


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ public void transform(AnnotationsTransformer.TransformationContext ctx) {
});
}

@BuildStep
public void disableObservation(BuildProducer<RunTimeConfigurationDefaultBuildItem> runtimeConfigProducer) {
runtimeConfigProducer.produce(
new RunTimeConfigurationDefaultBuildItem("smallrye.messaging.observation.enabled", "false"));
}

@BuildStep
public void enableHealth(ReactiveMessagingBuildTimeConfig buildTimeConfig,
BuildProducer<HealthBuildItem> producer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ mp.messaging.outgoing.request-reply.topic=request
mp.messaging.outgoing.request-reply.reply.batch=true

quarkus.micrometer.binder.messaging.enabled=true
smallrye.messaging.observation.enabled=true

0 comments on commit d4e9086

Please sign in to comment.