in_docker: first implementation#790
Conversation
a9746b6 to
7c4b24e
Compare
|
hi, thanks for your work on this. would you please specify how it operate and the plans to query metrics per containers ? |
|
Hi Eduardo,
Configuration is very simple (as mentioned in previous comment) like |
|
thanks, this looks definitely very good to be included in the next major version. Let's keep working in the implementation:
now from a dev cycle I recommend:
|
Thanks.
Short id (12 char long) is appended to the record
Done.
I created my current branch in_docker from master.
Although I tried fixing some alerts by starting the binary using following command: Can you please guide my how to run tests with valgrind or point me to some resource? |
4726915 to
0f6837b
Compare
|
Valgrind can be used to test memory issues, it will slowdown the problem but is good to find problems when developing, I normally do: just make sure that when exiting with ctrl-c there are not problems reported. |
Thanks Eduardo. I have pushed my changes to the same branch. |
a9eb762 to
bd65371
Compare
|
thanks. I think would be good to have the container name, from a data analysis the container id/hash is not enough |
I considered this as well, but wasn't able to get container name from any of the cgroup pseudo files or anything similar to this. Although |
cd33cb5 to
594ed2b
Compare
|
@edsiper I've added container name to the record as well . user@hostname:~/fluent-bit/build$ sudo valgrind --leak-check=full ./bin/fluent-bit --config=/home/user/confi
g.yaml
==21178== Memcheck, a memory error detector
==21178== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==21178== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==21178== Command: ./bin/fluent-bit --config=/home/user/config.yaml
==21178==
Fluent-Bit v0.13.0
Copyright (C) Treasure Data
[2019/01/03 16:34:02] [ info] [engine] started
[0] docker.0: [1546533243.095125318, {"id"=>"b2e0d9268755", "name"=>"redis-1", "cpu_used"=>124548762542, "mem_used"=>2043904, "mem_limit"=
>4294963200}]
[1] docker.0: [1546533243.101521258, {"id"=>"be8144fe5cd8", "name"=>"redis-2", "cpu_used"=>124716612528, "mem_used"=>1761280, "mem_limit"=
>4294963200}]
[2] docker.0: [1546533244.001340963, {"id"=>"b2e0d9268755", "name"=>"redis-1", "cpu_used"=>124549692866, "mem_used"=>2043904, "mem_limit"=
>4294963200}]
[3] docker.0: [1546533244.001373850, {"id"=>"be8144fe5cd8", "name"=>"redis-2", "cpu_used"=>124717779757, "mem_used"=>1761280, "mem_limit"=
>4294963200}]
[4] docker.0: [1546533245.001376290, {"id"=>"b2e0d9268755", "name"=>"redis-1", "cpu_used"=>124550795330, "mem_used"=>2043904, "mem_limit"=
>4294963200}]
[5] docker.0: [1546533245.001409345, {"id"=>"be8144fe5cd8", "name"=>"redis-2", "cpu_used"=>124718936079, "mem_used"=>1761280, "mem_limit"=
>4294963200}]
[6] docker.0: [1546533246.005077304, {"id"=>"b2e0d9268755", "name"=>"redis-1", "cpu_used"=>124552048887, "mem_used"=>2043904, "mem_limit"=
>4294963200}]
[7] docker.0: [1546533246.005109867, {"id"=>"be8144fe5cd8", "name"=>"redis-2", "cpu_used"=>124719879755, "mem_used"=>1761280, "mem_limit"=
>4294963200}]
^C[engine] caught signal
[2019/01/03 16:34:11] [ info] [input] pausing docker.0
==21178==
==21178== HEAP SUMMARY:
==21178== in use at exit: 0 bytes in 0 blocks
==21178== total heap usage: 527 allocs, 527 frees, 962,633 bytes allocated
==21178==
==21178== All heap blocks were freed -- no leaks are possible
==21178==
==21178== For counts of detected and suppressed errors, rerun with: -v
==21178== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) |
|
thanks. To start merging this we need a few changes:
|
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
4be294a to
2285386
Compare
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
2285386 to
665e309
Compare
@edsiper I have fixed these. But my tests are failing because no dockers are running on build machine and no dockers means no output. How should I handle this? |
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
|
can you emulate some running dockers through file system static files ? e,g: tests/runtime/data/... |
There are certain paths which are defined as macros in |
|
I reviewed the latest changes and looks good, the only thing we need to show in a different way is the CPU metrics, ideally in % from 0-100 instead of the current value. |
|
ping. note: please also rebase on top of master. |
|
Showing percentage from 0-100% makes sense instead of current value. I will need to change the logic a bit. Will update once done. |
|
@ashutoshdhundhara @edsiper what is the status of this PR? |
|
waiting for the latest changes requested. |
|
Unfortunately this branch is non-trival (but not impossible) to rebase onto master. One thing that has changed in the meanwhile is the It looks like a bit of work to have this suitable for merging to the mainline. |
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com> Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
|
first of all my apologies for the very long delay on this. I've just merged your new plugin and this one will be part of v1.3 release (this week), I've made small changes to adjust to the new internal API and now is fully compatible. I've merged this plugin manually through d19be0d (you remain the author of the plugin in the commit). Since the plugin is ready I am closing this PR. thanks for your contribution!!! |
|
Plugin merged manually, closing PR. |
|
I'm not able to retrieve the metrics using this input whilst running fluentbit agent as a docker container, should i be mounting to the cgroup path for this to work ? |
"I'm currently mounting path to /sys/fs/cgroup/ to get this working in a docker container" |
* out_http: remove successful_response_code Signed-off-by: Takahiro Yamashita <nokute78@gmail.com> * in_http: add successful_response_code Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
This is for #319.
Just a draft. Also attaching a sample output. Am I moving in right direction?
Config: