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

Add kafka integration 0.0.2 #428

Merged
merged 13 commits into from May 19, 2020
Merged

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented May 5, 2020

Add kafka packages.

One particularity of the Metricbeat module for Kafka is that it monitors Kafka brokers, producers and consumers. Kafka brokers are monitored using the kafka protocol, and Jolokia for JMX metrics. Producers and consumers and monitored using Jolokia.

Related to these particularities, I have divided the kafka metricsets into three groups after these thoughts:

  • kafka, to monitor the Kafka brokers, it uses the Filebeat module, and the consumergroup, broker and partition metricsets of the Metricbeat module.
  • kafka_java_consumer, to monitor Kafka Java consumers, it uses the consumer metricset of the Kafka module.
  • kafka_java_producer, to monitor Kafka Java producers, it uses the producer metricset of the Kafka module.

This PR includes only a package for kafka, we will have to discuss if we also want kafka_java_consumer and kafka_java_producer as packages or as data sources, or following any other strategy.

Some screenshots:

If we include kafka, kafka_java_consumer, and kafka_java_producer as three different packages, they appear like this (this PR only includes the kafka one):
Captura de pantalla de 2020-05-15 16-17-08

Integration for Kafka brokers. The configuration for the broker metricset has a setting for the jolokia endpoint:
Captura de pantalla de 2020-05-15 16-17-49

Kafka logs can be configured as files inside the Kafka home directory, following the config of the current Filebeat module:
Captura de pantalla de 2020-05-15 16-19-47

.gitignore Outdated Show resolved Hide resolved
@jsoriano jsoriano force-pushed the package-kafka-migrate branch 2 times, most recently from ceb2299 to 4f31ce3 Compare May 7, 2020 15:00
@elasticmachine
Copy link

elasticmachine commented May 8, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

required: false
show_user: true
default:
- 'localhost:8778'
Copy link
Member Author

Choose a reason for hiding this comment

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

This module has some metricsets that need to connect to Kafka, and some others that need to connect to Jolokia. I am defining two "hosts" variables, one for each kind of metricset.

Copy link
Member

Choose a reason for hiding this comment

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

Are there any metricsets that need to connect to both? If not, I think we should specify two different inputs instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, right, makes sense, I didn't think on this possibility, I will give a try, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

How can I define two different inputs for the same module? I have tried with input: kafka_jolokia/metrics, but then it configures metricbeat with module: kafka_jolokia, that doesn't exist. And with input: kafka/jolokia_metrics it doesn't create any configuration.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should leave the main manifest.yml as is (2 inputs: logs and kafka/metrics) and go deeper to datasets. agent/stream/stream.yml.hbs is the configuration of metricbeat that is delivered to the agent. If you want to take a look at integration with 2 stream configurations, you can take a look at "o365".

Copy link
Member Author

Choose a reason for hiding this comment

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

I have pushed the change for the approach with three integrations (not very tested yet).

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the late answer. When you say 3 integrations, you mean 3 inputs? Could you share a screenshot on how it looks now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I think I mean three packages. Screenshots are updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Umm, is it possible to have three different datasources in the same package? Would it work the same as the three packages I am adding now?

Copy link
Member Author

Choose a reason for hiding this comment

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

We had a discussion offline about this, we have decided to go on by now only with the metricsets intended to monitor brokers, so I will remove the consumer and producer metricsets from this PR.

@jsoriano jsoriano marked this pull request as ready for review May 15, 2020 15:47
@jsoriano jsoriano requested review from ruflin and mtojek May 15, 2020 15:47
Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

LGTM. Checked in the UI and looks good. We need to continue the discussion around how to structure this package as a follow up.

@mtojek If this is merged, could you take over the "transition" to package-registry/integrations and cleanup here?


The `broker`, `consumergroup` and `partition` metricsets are tested with Kafka 0.10.2.1, 1.1.0, 2.1.1, and 2.2.2.

<!-- TODO: Add a link to Jolokia "input" in Metricbeat -->
Copy link
Member

Choose a reason for hiding this comment

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

This shows up in the UI, but can also be fixed later.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have fixed this and a couple of typos.

@mtojek
Copy link
Contributor

mtojek commented May 19, 2020

@mtojek If this is merged, could you take over the "transition" to package-registry/integrations and cleanup here?

Yes, once it's merged.

@jsoriano jsoriano merged commit 6d9e27a into elastic:master May 19, 2020
@jsoriano jsoriano deleted the package-kafka-migrate branch May 19, 2020 10:08
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.

None yet

4 participants