Cherry-pick #14330 to 7.x: [Metricbeat] Add Kafka JMX metricsets #14656
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #14330 to 7.x branch. Original message:
Implements
kafka.broker
,kafka.consumer
,kafka.producer
metricset of #13366.Depends on:
Manual Testing
Broker metricset
In order to prepare the proper environment to test these metricsets, the quickest way is to reuse the Docker env of the module. This can be achieved by first of all running the integration tests of the module which will take care of bringing up the container with the proper configuration.
To run the tests:
go test -v -tags=integration github.com/elastic/beats/metricbeat/module/kafka/partition
Verify that tests are successful and you can go on to manual testing. After the tests have finished the container is still alive so we can use it for the manual testing too.
Check what are the exported ports from Docker with a
docker ps
:5da9631cfa25 docker.elastic.co/observability-ci/beats-integration-kafka:2.1.1-1 "/run.sh" 23 minutes ago Up 23 minutes (healthy) 2181/tcp, 0.0.0.0:32771->8774/tcp, 0.0.0.0:32770->8775/tcp, 0.0.0.0:32769->8779/tcp, 0.0.0.0:32768->9092/tcp metricbeat_kafka_1
In this example the mapping is:
0.0.0.0:32769->8779
0.0.0.0:32770->8775
0.0.0.0:32771->8774
So we configure the metricsets' hosts accordingly.
Enable the Kafka module and use the following configuration in
modules.d/kafka.yml
:Run Metricbeat and verify that metrics are being collected from all of the 3 metricsets we configured.
When done remove the testing container.