-
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
New module http #4156
New module http #4156
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-module-http]] | ||
== http Module | ||
|
||
Http module is a [Metricbeat](https://www.elastic.co/products/beats/metricbeat) used to call arbitrary HTTP endpoints for which not a dedicated metricbeat is available. | ||
Multiple endpoints can be configured which are polled in a regular interval and the result is shipped to the configured output channel. | ||
|
||
Httpbeat is inspired by the Logstash [http_poller](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html) input filter but doesn't require that the endpoint is reachable by Logstash as the Metricbeat module pushes the data to the configured output channels, e.g. Logstash or Elasticsearch. | ||
This is often necessary in security restricted network setups, where Logstash is not able to reach all servers. Instead the server to be monitored itself has Metricbeat installed and can send the data or a collector server has Metricbeat installed which is deployed in the secured network environment and can reach all servers to be monitored. | ||
|
||
|
||
[float] | ||
=== Example Configuration | ||
|
||
The http module supports the standard configuration options that are described | ||
in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
||
[source,yaml] | ||
---- | ||
metricbeat.modules: | ||
- module: http | ||
metricsets: ["json"] | ||
enabled: false | ||
period: 10s | ||
hosts: ["httpbin.org"] | ||
namespace: "http_json_namespace" | ||
path: "/headers" | ||
---- | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-http-json,json>> | ||
|
||
include::http/json.asciidoc[] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-metricset-http-json]] | ||
include::../../../module/http/json/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-http,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/http/json/_meta/data.json[] | ||
---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Tomcat is started to fetch Jolokia metrics from it | ||
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. I'm thinking if we could use a less "heavy" container for the http testing? 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. Any suggestions? I reused the container Jolokia container as it was already there, so that no additional image needs to be build and an additional to be started. 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. I was thinking of having our own very small web service in go that exposes and http endpoint and sends json to make it clear it is a "dynamic" metricset. Here we have something similar for dropwizard: https://github.com/elastic/beats/tree/master/metricbeat/module/dropwizard/_meta/test Except having a http service will hopefully only be a few lines of code and then in the container |
||
FROM jolokia/java-jolokia:7 | ||
ENV TOMCAT_VERSION 7.0.55 | ||
ENV TC apache-tomcat-${TOMCAT_VERSION} | ||
|
||
HEALTHCHECK CMD curl -f curl localhost:8778/jolokia/ | ||
EXPOSE 8778 | ||
RUN wget http://archive.apache.org/dist/tomcat/tomcat-7/v${TOMCAT_VERSION}/bin/${TC}.tar.gz | ||
RUN tar xzf ${TC}.tar.gz -C /opt | ||
|
||
CMD env CATALINA_OPTS=$(jolokia_opts) /opt/${TC}/bin/catalina.sh run |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- module: http | ||
metricsets: ["json"] | ||
enabled: false | ||
period: 10s | ||
hosts: ["httpbin.org"] | ||
namespace: "http_json_namespace" | ||
path: "/headers" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
== http Module | ||
|
||
Http module is a [Metricbeat](https://www.elastic.co/products/beats/metricbeat) used to call arbitrary HTTP endpoints for which not a dedicated metricbeat is available. | ||
Multiple endpoints can be configured which are polled in a regular interval and the result is shipped to the configured output channel. | ||
|
||
Httpbeat is inspired by the Logstash [http_poller](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html) input filter but doesn't require that the endpoint is reachable by Logstash as the Metricbeat module pushes the data to the configured output channels, e.g. Logstash or Elasticsearch. | ||
This is often necessary in security restricted network setups, where Logstash is not able to reach all servers. Instead the server to be monitored itself has Metricbeat installed and can send the data or a collector server has Metricbeat installed which is deployed in the secured network environment and can reach all servers to be monitored. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
JOLOKIA_HOST=jolokia | ||
JOLOKIA_PORT=8778 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
- key: http | ||
title: "http" | ||
description: > | ||
http Module | ||
fields: | ||
- name: http | ||
type: group | ||
description: > | ||
fields: | ||
- name: request | ||
type: group | ||
description: > | ||
HTTP request information | ||
fields: | ||
- name: header | ||
type: nested | ||
description: > | ||
The HTTP headers sent | ||
- name: method | ||
type: keyword | ||
description: > | ||
The HTTP method used | ||
- name: body | ||
type: keyword | ||
description: > | ||
The HTTP payload sent | ||
- name: response | ||
type: group | ||
description: > | ||
HTTP response information | ||
fields: | ||
- name: header | ||
type: nested | ||
description: > | ||
The HTTP headers received | ||
- name: status_code | ||
type: keyword | ||
description: > | ||
The HTTP status code | ||
- name: body | ||
type: keyword | ||
description: > | ||
The HTTP payload received |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
Package http is a Metricbeat module that contains MetricSets. | ||
*/ | ||
package http |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"@timestamp":"2016-05-23T08:05:34.853Z", | ||
"beat":{ | ||
"hostname":"beathost", | ||
"name":"beathost" | ||
}, | ||
"metricset":{ | ||
"host":"localhost", | ||
"module":"http", | ||
"name":"json", | ||
"rtt":44269 | ||
}, | ||
"http":{ | ||
"json":{ | ||
"example": "json" | ||
} | ||
}, | ||
"type":"metricsets" | ||
} |
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.
Missing "module" after "a Metricbeat"?
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.
also there's an extra "not".
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.
Opps sorry, I intended to comment on #4170. Ignore these.