MongoDB-Cowboys / Monalize

Monaliza is a tool for scanning and analyzing MongoDB database for any performance issues, which lead to high CPU consumption.
GNU General Public License v3.0
28 stars 6 forks source link

Dockerized version #7

Closed ralexrdz closed 1 year ago

ralexrdz commented 1 year ago

Is there a Dockerized example of this library?

I would like to use it on mongo docker containers

ku9nov commented 1 year ago

Actually, the location of your database doesn't matter. All you need is access to it from the server or local machine and the presence of MongoDB Database Tools on that machine. You can install them from here: https://www.mongodb.com/docs/database-tools/installation/installation/.

However, since data collection occurs in three stages, we are missing the last two stages here. The simplest option for you would be to install it directly in a container and run it there, but I am not sure which specific Docker images you are using, and there may be issues with installing dependencies.

It is also possible to run an Ubuntu container alongside the installed Mongo and dependencies, mounting the MongoDB log file to it.

There are many options, and they are not all straightforward. Therefore, I have decided to address this issue in the near future, improve the application, and add support for extracting data from Docker containers.

ku9nov commented 1 year ago

Hello, @ralexrdz

You can find the updated version with Docker log reading support here: https://github.com/MongoDB-Cowboys/Monalize/tree/feature/complex_upgrade I attempted to directly implement native Docker container log reading using the Golang module, but unfortunately, the MongoDB container returns logs with binary data, which took me a lot of time to process. So, this feature might be implemented a little later. Currently, a similar approach to the previous one is being used through the shell.

Please pay attention to the updated README and changelog file. Now, to correctly process logs in Docker, you need to pass the container name.

The full release will be slightly delayed, but for now, this functionality should be sufficient for you. Let me know about the results and any issues that arise.

ku9nov commented 1 year ago

Added Docker support, check CHANGELOG.md and README.md.

New version 1.2.0 is released.