Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #14330 to 7.x: [Metricbeat] Add Kafka JMX metricsets #14656

Merged
merged 4 commits into from
Nov 21, 2019

Conversation

ChrsMark
Copy link
Member

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:

  • broker port: 0.0.0.0:32769->8779
  • producer port: 0.0.0.0:32770->8775
  • consumer port: 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:

# Metrics collected from a Kafka broker using Jolokia
- module: kafka
  metricsets:
    - broker
  period: 10s
  hosts: ["localhost:32769"]

# Metrics collected from a Java Kafka consumer using Jolokia
- module: kafka
  metricsets:
    - consumer
  period: 10s
  hosts: ["localhost:32771"]

# Metrics collected from a Java Kafka producer using Jolokia
- module: kafka
  metricsets:
    - producer
  period: 10s
  hosts: ["localhost:32770"]

Run Metricbeat and verify that metrics are being collected from all of the 3 metricsets we configured.

When done remove the testing container.


# Credentials file for the service account with authorization to read from
# the subscription.
var.credentials_file: ${path.config}/gcp-service-account-xyz.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related? CI jobs seem to be failing because of this. Run mage fmt update and commit the changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the whole file was removed on #14553 accidentally. Will run the updates, thank you!

Signed-off-by: chrismark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark merged commit be8ea9e into elastic:7.x Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants