Skip to content
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

Feat/prometheus-exporter : Add prometheus exporter and grafana dashboard for mailcow. #6314

Open
wants to merge 4 commits into
base: staging
Choose a base branch
from

Conversation

Hassanzadeh-sd
Copy link

@Hassanzadeh-sd Hassanzadeh-sd commented Feb 17, 2025

Contribution Guidelines

What does this PR include?

Short Description

This PR adds a Prometheus exporter and Grafana dashboard for mailcow. Key changes:

  • Prometheus Exporter: Collects mailcow metrics for monitoring. Requires enabling the mailcow API and generating an API key.
  • /metrics Endpoint: Exposes metrics for Prometheus to scrape.
  • Grafana Dashboard: Visualizes key mailcow metrics for easy monitoring.

How to use:

  • Enable the Mailcow API and create a read-only API key.
  • Configure the exporter with your mailcow host and API key.
  • Import the provided Grafana dashboard to visualize the metrics.

This makes it easier to monitor your Mailcow instance with Prometheus and Grafana.

Affected Containers

nothing it is an override compose file.

Did you run tests?

What did you test?

I tested the Prometheus exporter and Grafana dashboard integration with my own Mailcow services. I verified that:

  • The exporter successfully collected metrics from the mailcow API.
  • The metrics were exposed correctly via the /metrics endpoint.
  • Prometheus could scrape the metrics endpoint without errors.
  • The Grafana dashboard visualized the collected metrics accurately and effectively.

The exporter and dashboard have been running in my environment and functioning as expected since testing.

What were the final results? (Awaited, got)

All tests passed successfully. I expected the exporter to accurately collect and expose mailcow metrics in Prometheus format, and the Grafana dashboard to visualize these metrics effectively. The outcome matched my expectations, providing a functional monitoring solution for mailcow.

@Hassanzadeh-sd
Copy link
Author

@DerLinkman

Hello again,

I have restructured my pull request as per your suggestions and in accordance with the contribution guidelines. I appreciate your feedback, and I would be grateful if you could take a moment to review the changes.

Thank you for your assistance!

@DerLinkman
Copy link
Member

Hi,

first of all, PR looks fine so far, thanks for that.

But i don't know how i should feel regarding the position of this PR.

Don't get me wrong i appreciate the work you did but the explainations on how to setup the stuff should better be put into our docs instead.

The prometheus exporter in an override.yml example file can be kept that is good. But the readme file on how to setup as well as the grafana dashboard template .json i don't feel it's not the right position.

What do you think?

@DerLinkman
Copy link
Member

Maybe you can add a seperate Docs section similar to the CheckMK stuff here:

https://docs.mailcow.email/third_party/checkmk/u_e-checkmk/

@Hassanzadeh-sd
Copy link
Author

Hassanzadeh-sd commented Feb 18, 2025

thanks for your feedback, I removed my docs file in my pr branch and, I'll migrate them to docs.mailcow and send my new pr on that project asap.

@Hassanzadeh-sd
Copy link
Author

Hassanzadeh-sd commented Feb 18, 2025

@DerLinkman
I have seprated the documentation in to mailcow docs project and this is that PR:

mailcow/mailcow-dockerized-docs#812

@MAGICCC
Copy link
Member

MAGICCC commented Feb 18, 2025

Hi,

first of all, PR looks fine so far, thanks for that.

But i don't know how i should feel regarding the position of this PR.

Don't get me wrong i appreciate the work you did but the explainations on how to setup the stuff should better be put into our docs instead.

The prometheus exporter in an override.yml example file can be kept that is good. But the readme file on how to setup as well as the grafana dashboard template .json i don't feel it's not the right position.

What do you think?

Actually I second that it should be in the docs so users can install it when they want it. I gonna check it on the weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants