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
  • Loading branch information
ozangunalp committed Feb 20, 2024
1 parent 060ff77 commit 59c3f49
Show file tree
Hide file tree
Showing 2 changed files with 27 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

Check warning on line 2075 in docs/src/main/asciidoc/kafka.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'Kafka Streams'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'Kafka Streams'.", "location": {"path": "docs/src/main/asciidoc/kafka.adoc", "range": {"start": {"line": 2075, "column": 33}}}, "severity": "INFO"}
----


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

0 comments on commit 59c3f49

Please sign in to comment.