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

Enable Fluentd Prometheus plugin #725

Open
kaiohenricunha opened this issue May 8, 2023 · 11 comments
Open

Enable Fluentd Prometheus plugin #725

kaiohenricunha opened this issue May 8, 2023 · 11 comments
Assignees
Labels

Comments

@kaiohenricunha
Copy link
Contributor

kaiohenricunha commented May 8, 2023

Is your feature request related to a problem? Please describe.

It would be a nice feature to have the power to enable Prometheus metrics scraping just like we do with Fluentbit, and how it is done with Fluentd's chart.

Describe the solution you'd like

Being able to easily enable Prometheus metrics scraping.

Additional context

Right now, it is not a straightforward task to integrate fluentd with prometheus when deployed with the fluent-operator. I'm not sure it's even possible.

https://docs.fluentd.org/monitoring-fluentd/monitoring-prometheus

https://github.com/fluent/fluent-plugin-prometheus

@erhudy
Copy link
Contributor

erhudy commented May 18, 2023

This would be great to have, even if it's implemented in a way that basically just takes the configurations from https://docs.fluentd.org/monitoring-fluentd/monitoring-prometheus and puts them behind a single flag in the CRD (like spec.enablePrometheusMetrics).

@benjaminhuo benjaminhuo added the good first issue Good for newcomers label May 23, 2023
@andrecastro
Copy link

This is almost a "must to have" for us to use this operator. Can you prioritize this?

@kaiohenricunha
Copy link
Contributor Author

Has anyone found a workaround for this? Fluentd monitoring is critical.

@erhudy
Copy link
Contributor

erhudy commented Jun 23, 2023

I am going to look at it when I have time.

@erhudy
Copy link
Contributor

erhudy commented Jun 26, 2023

I have published a draft PR at #813 (intentionally broken for the time being). This is lacking tests and some refinements but does work (see below screenshot).

Questions to be answered about the PR:

  • Just a general check that the approach I'm taking is okay.
  • I refactored a few things in the operator while following the setup instructions at https://docs.fluentd.org/monitoring-fluentd/monitoring-prometheus, most notably moving tag to a separate field on the relevant struct and getting rid of the special treatment of the string "tag" (because the examples contained that as a label and the previous code was stripping it)
  • Ideally this would be released alongside updated fluentd images that install fluent-plugin-prometheus by default. I could not find a repo for those Dockerfiles, but I imagine @benjaminhuo knows.

image

@huzhekun
Copy link

are there any plans to also enable such a prometheus metric endpoint for the fluentbit component? (preferably with a service/podmonitor) I found this issue from a while ago asking for the same thing but I believe it was mistakenly closed because the referred config line is related to the prometheus node exporter plugin rather than prometheus metrics of the fluentbit pods themselves. currently because of a lack of fluentbit/fluentd monitoring we are forced to use the fluentbit helm chart directly which does have the feature.

@kaiohenricunha
Copy link
Contributor Author

are there any plans to also enable such a prometheus metric endpoint for the fluentbit component? (preferably with a service/podmonitor) I found this issue from a while ago asking for the same thing but I believe it was mistakenly closed because the referred config line is related to the prometheus node exporter plugin rather than prometheus metrics of the fluentbit pods themselves. currently because of a lack of fluentbit/fluentd monitoring we are forced to use the fluentbit helm chart directly which does have the feature.

I guess you just have to add an annotation to fluentbit:

https://github.com/fluent/fluent-operator/blob/master/charts/fluent-operator/values.yaml#L82

@joshuabaird
Copy link
Collaborator

@erhudy Would love to see your PR completed and merged! I went ahead and opened #966 to add the fluent-plugin-prometheus plugin to the fluentd image.

@erhudy
Copy link
Contributor

erhudy commented Oct 27, 2023

@joshuabaird I am no longer using the fluentd operator. If you would like to take what I have done and reopen a new PR with my changes as a basis, please feel free to take it.

@sugarman402
Copy link

We just encountered into this very same issue, that we would like to monitor fluentd with prometheus, it would be nice to have this feature as the part of the fluent-operator

@vajgi90
Copy link

vajgi90 commented Jun 18, 2024

I agree, it would be great if Fluentd via fluent-operator would be compatible and configurable with Prometheus in the future.

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

Successfully merging a pull request may close this issue.

9 participants