-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Jolokia discovery autodiscover provider #7141
Changes from 1 commit
705b816
36b93f7
13b327a
8dfdcff
85ef757
dd660f6
9ac6b30
41c6e10
49064dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Filebeat supports templates for inputs and modules: | ||
|
||
["source","yaml",subs="attributes"] | ||
------------------------------------------------------------------------------- | ||
filebeat.autodiscover: | ||
providers: | ||
- type: jolokia | ||
interfaces: | ||
- name: lo | ||
templates: | ||
- condition: | ||
contains: | ||
jolokia.server.product: "kafka" | ||
config: | ||
- module: kafka | ||
log: | ||
enabled: true | ||
var.paths: | ||
- /var/log/kafka/*.log | ||
------------------------------------------------------------------------------- | ||
|
||
This configuration starts a jolokia module that collects logs of kafka if it is | ||
running. Discovery probes are sent using the local interface. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,57 @@ contain variables from the autodiscover event. They can be accessed under data n | |
|
||
include::../../{beatname_lc}/docs/autodiscover-kubernetes-config.asciidoc[] | ||
|
||
[float] | ||
===== Jolokia (experimental) | ||
|
||
The Jolokia autodiscover provider uses Jolokia Discovery to find agents running | ||
in your host or your network. | ||
|
||
Jolokia Discovery mechanism is supported by any Jolokia agent since version | ||
1.2.0, it is enabled by default when Jolokia is included in the application as | ||
a JVM agent, but disabled in other cases as the OSGI or WAR (Java EE) agents. | ||
In any case, this feature is controlled with two properties: | ||
|
||
* `discoveryEnabled`, to enable the feature | ||
* `discoveryAgentUrl`, if set, this is the URL announced by the agent when | ||
being discovered, setting this parameter implicitely enables the feature | ||
|
||
There are multiple ways of setting these properties, and they can vary from | ||
application to application, please refer to the documentation of your | ||
application to find the more suitable way to set them in your case. | ||
|
||
Jolokia Discovery is based on UDP multicast requests. Agents join the multicast | ||
group 239.192.48.84, port 24884, and discovery is done by sending queries to | ||
this group. You have to take into account that UDP traffic between Metricbeat | ||
and the Jolokia agents has to be allowed. Also notice that this multicast | ||
address is in the 239.0.0.0/8 range, that is reserved for private use within an | ||
organization, so it can only be used in private networks. | ||
|
||
These are the available fields on every event: | ||
|
||
* jolokia.agent.id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these fields also added to each event indirectly created through auto discovery? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, they are added, I think that by the Autodiscover framework. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything under |
||
* jolokia.agent.version | ||
* jolokia.secured | ||
* jolokia.server.product | ||
* jolokia.server.vendor | ||
* jolokia.server.version | ||
* jolokia.url | ||
|
||
The configuration of this provider consists in a set of network interfaces, as | ||
well as a set of templates as in other providers. The network interfaces will be | ||
the ones used for discovery probes, they have these settings: | ||
|
||
* `name`: the name of the interface (e.g. `br0`), it can contain a wildcard | ||
at as suffix to apply the same settings to multiple network interfaces of | ||
the same type (e.g. `br*`). | ||
* `interval`: time between probes (defaults to 10s) | ||
* `grace_period`: time since the last reply to consider a instance stopped | ||
(defaults to 30s) | ||
* `probe_timeout`: max time to wait for responses since a probe is sent | ||
(defaults to 1s) | ||
|
||
include::../../{beatname_lc}/docs/autodiscover-jolokia-config.asciidoc[] | ||
|
||
[[configuration-autodiscover-hints]] | ||
=== Hints based autodiscover | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Metricbeat supports templates for modules: | ||
|
||
["source","yaml",subs="attributes"] | ||
------------------------------------------------------------------------------- | ||
metricbeat.autodiscover: | ||
providers: | ||
- type: jolokia | ||
interfaces: | ||
- name: br* | ||
interval: 5s | ||
grace_period: 10s | ||
- name: en* | ||
templates: | ||
- condition: | ||
contains: | ||
jolokia.server.product: "tomcat" | ||
config: | ||
- module: jolokia | ||
metricsets: ["jmx"] | ||
hosts: "${data.jolokia.url}" | ||
namespace: test | ||
jmx.mappings: | ||
- mbean: "java.lang:type=Runtime" | ||
attributes: | ||
- attr: Uptime | ||
field: uptime | ||
------------------------------------------------------------------------------- | ||
|
||
This configuration starts a jolokia module that collects the uptime of each | ||
`tomcat` instance discovered. Discovery probes are sent using all interfaces | ||
starting with `br` and `en`, for the `br` interfaces the `interval` and | ||
`grace_period` is reduced to 5 and 10 seconds respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Event.BusEvent should have comment or be unexported