Make use of consumer_lag in dashboard#14863
Merged
ChrsMark merged 9 commits intoelastic:masterfrom Dec 4, 2019
Merged
Conversation
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
mtojek
approved these changes
Dec 1, 2019
Contributor
mtojek
left a comment
There was a problem hiding this comment.
There is a typo in the PR title and description. I'm raising it just to prevent from any copy-paste bugs.
BTW. do you plan to update PNG screenshots?
Signed-off-by: chrismark <chrismarkou92@gmail.com>
b52307b to
b7dee38
Compare
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
ChrsMark
added a commit
to ChrsMark/beats
that referenced
this pull request
Dec 5, 2019
(cherry picked from commit dd99d7e)
This was referenced Dec 5, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR updates the
Kafka Consumer Group Lag vs Time [Metricbeat Kafka] ECSvisualisation to make use of theconsumer_lagfield added on #14822.This may resolve_ #3608
Manual Testing
Note: Manual testing can be tricky since this requires an actual Kafka setup with consumer/producers.
An easy way to manual test this is to make use of the container we provide for the integration tests.
Start a Kafka service using the testing container: https://github.com/elastic/beats/blob/master/metricbeat/module/kafka/_meta/Dockerfile
One can run the tests in order to bring up the container like
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_1Kafka Module configuration
In Kafka module configuration make use of the testing creds -> https://github.com/elastic/beats/blob/master/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go#L38
The config should look like:
Where
0.0.0.0:32784comes from the port mapping of Docker like:0.0.0.0:32784->9092/tcp, usedocker psto see which the mapped port to the host network.Sample producer/consumer pairs
In order to populate consumer lag data
execinto the Kafka container and spawn 2 pairs of consumer/producer like:Producer:
{ while sleep 1; do echo message; done } | KAFKA_OPTS="-Djava.security.auth.login.config=/kafka/bin/jaas-kafka-client-producer.conf" /kafka/bin/kafka-console-producer.sh --topic test2 --broker-list localhost:9091 --producer.config /kafka/bin/sasl-producer.propertieshttps://github.com/elastic/beats/blob/master/metricbeat/module/kafka/_meta/run.sh#L76
Consumer:
KAFKA_OPTS="-Djava.security.auth.login.config=/kafka/bin/jaas-kafka-client-consumer.conf" /kafka/bin/kafka-console-consumer.sh --topic=test2 --bootstrap-server=localhost:9091 --consumer.config /kafka/bin/sasl-producer.propertieshttps://github.com/elastic/beats/blob/master/metricbeat/module/kafka/_meta/run.sh#L82
After that the data in the dashboard is expected to be populated accordingly.