I am trying my hands on MetricBeat and have been able to send the host system metrics to an Elastic Search cluster. But, I am facing issues with sending docker containers metrics by metric beat. Also, I am not really sure as to how should I run metric beat (as a separate docker container or as a standalone application) for my use case.
My use case is: I have a host machine (on cloud), and I have multiple docker containers (of applications) running on a single host. Now, I want to send the docker metrics as well as the host metrics to an elastic search cluster (set up across different machines) . Now, I have a few questions:
Is it possible to configure different docker containers in metricbeat.yml file?
Is it better if I run metric beat as a docker container as compared to a application on the host machine? If yes, will I have to link all the different application containers and the host so that it is able to send the docker container metrics and the system metrics? (I am facing issues with running metric beat like this)
What do you mean by that? The docker module monitors all containers of one docker host / machine. So the answer is I think yes.
Both is possible and has its pros and cons. It also depends if you have access to your docker host or not. Running it in a container will probably make it easier to update to you have to mount the correct socket etc. For the system metrics, you refer to the ones of the host machine?
So, I have been trying to run metricbeat in a docker container and I am facing problems with this. Is there any official docker image for the metricbeat? Secondly, I am not sure how the metric sets for different modules (docker & system) have to be passed while running the metric beat docker container. I did refer to the page "Running metricbeat in a container", but I still face some issues while running it. I tried using the following https://hub.docker.com/r/fairus/metricbeat/ but have the following errors while running it.
WARN Can not index event (status=400): {"type":"mapper_parsing_exception","reason":"failed to parse [system.process.cpu.start_time]","caused_by":{"type":"illegal_argument_exception","reason":"Invalid format: "05:28" is malformed at ":28""}
I know, this is a third party Dockerfile and it's difficult to comment on it without getting into it's details. Can you maybe point me in the right direction for using it with a docker container?
The docker module was just added to metricbeat a few days ago and is still under heavy development. It is on our todo list to add better documentation for it. Currently it is best to follow the docs from dockbeat (found here: https://github.com/Ingensi/dockbeat) as this is where the module is coming from Please be aware that you are running a snapshot build and we are more then happy to get feedback on it, but there will be breaking changes.
Currently there are not official docker images for beats. As the image is 2 months old that you provided I assume it is not up-to-date and does not have the docker module inside. I strongly recommend do build your own image at the moment or to make it simpler for your, run it directly on the host itself.
@ruflin, alright. I will use it as a standalone application on the host for the time being. But just a quick clarification, any docker file for metric beats which are using metric beat 5.0.0-beta1 version won't have support for the docker module, right?
Docker module will probably be in the 5.1 releases
cgroups for container monitoring is arleady in the 5.0 releases but is marked experimental
What do you mean by monitoring an other container? If you install metricbeat in each container then you can monitor all the containers. Or you can use cgroups.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.