Expose metrics through http endpoint#3717
Merged
urso merged 1 commit intoelastic:masterfrom Apr 4, 2017
Merged
Conversation
|
Contributor
Author
|
@urso For the second http server: That is only the case if |
9637d7c to
ca6f528
Compare
8bd0974 to
8328170
Compare
urso
reviewed
Apr 3, 2017
codecov.yml
Outdated
Contributor
Author
There was a problem hiding this comment.
kind off, because otherwise the PR would fail :-) I will keep this one in ...
urso
reviewed
Apr 3, 2017
filebeat/filebeat.full.yml
Outdated
There was a problem hiding this comment.
can we get rid of mentioning 'metrics' here?
libbeat/api/server.go
Outdated
There was a problem hiding this comment.
alternatively turn rootHandler into a httpHandler function via:
func rootHandler(info common.BeatInfo) func(http.ResponseWriter, *http.Request) {
...
}
The following PR exposes beats metrics through a configurable http endpoint. This allows when enabled to get an insight into a running beat. For security reasons the endpoint is off by default.
**Configuration**
The configuration options are in the `http` namespace. This config naming is borrowed from Logstash. By default the http endpoint is disabled. If enabled the metrics are only exposed on localhost on port 5066.
```
http.enabled: false
http.host: localhost
http.port: 5066
```
**-httpprof ?**
The http endpoint can be enabled also in production if needed. The additional endpoint httpprof endpoint which can be enabled through `-httpprof` still exists but is only recommended for debugging purpose. The httpprof endpoint exposes many more metrics and runtime data then the metrics endpoint.
**Endpoints**
The current implementation has two endpoints:
* `/`: The standard endpoint exposes info about the beat
* `/stats`: Stats exposes all metrics collected by monitoring
The output of the data is in json. The flag `?pretty` can be used to have formatted json as output to make it more human readable. Below is an example of each endpoint.
**/**
```
{
"beat": "metricbeat",
"hostname": "ruflin",
"name": "ruflin",
"uuid": "9d6e0c3a-1677-424c-aead-097e597e09f9",
"version": "6.0.0-alpha1"
}
```
**/stat**
```
{
"beat": {
"memstats": {
"gc_next": 6262080,
"memory_alloc": 3879968,
"memory_total": 479284520
}
},
"libbeat": {
"config": {
"module": {
"running": 0,
"starts": 0,
"stops": 0
},
"reloads": 0
}
},
"metricbeat": {
"system": {
"cpu": {
"events": 7,
"failures": 0,
"success": 7
},
"filesystem": {
"events": 28,
"failures": 0,
"success": 7
},
"fsstat": {
"events": 7,
"failures": 0,
"success": 7
},
"load": {
"events": 7,
"failures": 0,
"success": 7
},
"memory": {
"events": 7,
"failures": 0,
"success": 7
},
"network": {
"events": 70,
"failures": 0,
"success": 7
},
"process": {
"events": 1324,
"failures": 0,
"success": 7
}
}
},
"output": {
"elasticsearch": {
"events": {
"acked": 1445,
"not_acked": 0
},
"publishEvents": {
"call": {
"count": 34
}
},
"read": {
"bytes": 17213,
"errors": 0
},
"write": {
"bytes": 1185991,
"errors": 0
}
},
"events": {
"acked": 1445
},
"kafka": {
"events": {
"acked": 0,
"not_acked": 0
},
"publishEvents": {
"call": {
"count": 0
}
}
},
"logstash": {
"events": {
"acked": 0,
"not_acked": 0
},
"publishEvents": {
"call": {
"count": 0
}
},
"read": {
"bytes": 0,
"errors": 0
},
"write": {
"bytes": 0,
"errors": 0
}
},
"messages": {
"dropped": 0
},
"redis": {
"events": {
"acked": 0,
"not_acked": 0
},
"read": {
"bytes": 0,
"errors": 0
},
"write": {
"bytes": 0,
"errors": 0
}
},
"write": {
"bytes": 1185991,
"errors": 0
}
},
"publisher": {
"events": {
"count": 1450
},
"queue": {
"messages": {
"count": 1450
}
}
}
}
```
**Questions**
* Are these good endpoints paths?
* Which should be our default port?
ruflin
added a commit
to ruflin/beats
that referenced
this pull request
Apr 4, 2017
The metrics endpoint is replaced by the http endpoint in libbeat. See elastic#3717
andrewkroh
pushed a commit
that referenced
this pull request
Apr 4, 2017
* Remove metrics endpoint in winlogbeat The metrics endpoint is replaced by the http endpoint in libbeat. See #3717
ruflin
added a commit
to ruflin/beats
that referenced
this pull request
Apr 28, 2017
The metrics endpoint is replaced by the http endpoing for all beats in 6.0. See elastic#3717
andrewkroh
pushed a commit
that referenced
this pull request
May 1, 2017
The metrics endpoint is replaced by the http endpoint for all beats in 6.0. See #3717
3 tasks
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.
The following PR exposes beats metrics through a configurable http endpoint. This allows when enabled to get an insight into a running beat. For security reasons the endpoint is off by default.
Configuration
The configuration options are in the
httpnamespace. This config naming is borrowed from Logstash. By default the http endpoint is disabled. If enabled the metrics are only exposed on localhost on port 5066.-httpprof ?
The http endpoint can be enabled also in production if needed. The additional endpoint httpprof endpoint which can be enabled through
-httpprofstill exists but is only recommended for debugging purpose. The httpprof endpoint exposes many more metrics and runtime data then the metrics endpoint.Endpoints
The current implementation has two endpoints:
/: The standard endpoint exposes info about the beat/stats: Stats exposes all metrics collected by monitoringThe output of the data is in json. The flag
?prettycan be used to have formatted json as output to make it more human readable. Below is an example of each endpoint./
/stat
Questions