-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[loki-operator] CRD: support podMonitor k8s CRD #7387
Comments
help wanted @periklis , loki-operator module |
“Check out the Grafana Agent. PodLogs CRD is performing the functionality you are looking for. thanks Joel Verezhak. |
I took a deep look at the grafana-agent code https://github.com/grafana/agent/blob/main/pkg/logs/logs.go, which is actually promtail. It's pretty cool. so the question is, if a promtail user only collects logs, is it necessary to replace it with grafana-agent for the CRD feature. |
@liguozhong as per design the Loki operator is not supporting/managing promtail or any log collector. We believe that the Loki Operator is better serving Loki-only installations. This is so because collector have so many config variants and forthcoming trends like OTEL make it hard to specialize on one. Saying this, I totally see the value in a promtail CRD with variants like PodMonitor and ServiceMonitor. I can only see this happening in separate operator though |
@periklis hi , Thanks for the professional advice you shared. So the question becomes, is it possible for us to develop another promtail-operator to support the PodMonitor CRD. Is it possible to have a promtail-operator SIG build this component independently first. This will not distract loki and loki-operator maintainers too much time. |
From experience wring a couple operators till today writing a dedicated promtail-operator should be an easy task. My advice though is to spent some time designing and crafting the various CRDs you need for that purpose. AFAICS above you propose two to three CRDs, a promtail CRD for the deamonset, a PodMonitor to reconcile scrape configs, a ServiceMonitor to reconcile scrape configs. Even starting with two of them, e.g. promtail + servicemonitor/podmonitor, I would advise:
I am glad to help you with reviews on design even on markdown first. |
thanks! @periklis I'd be happy to implement a preliminary version of the promtail+ podMonitor CRD for the community to get an initial progress. |
I recommend to add @cyriltovena @owen-d and @slim-bean to the discussion here. I agree that promtail needs a separate small operator but as said above the competition with so many other log collection offerings , e.g. OTEL, OpenShift's ClusterLoggingOperator, to name some is a thing to consider. I would not object having an operator for promtail/grafana-agent that takes care of the log collection/normalization parts. |
@liguozhong I would be very happy to contribute to the Promtail operator if I can in any way! Have a big interest from my side in enabling this |
oh, that's great, looking forward to your contribution. |
Is your feature request related to a problem? Please describe.
The promtail service discovery module is implemented with reference to the service discovery of prometheus, which achieves great flexibility,
but the configuration is relatively complex and does not conform to the design concept of the k8s environment.
The CRD in k8s is more popular with operater personnel.
So we should implement a podMonitor CRD similar to the prometheus-operator project to simplify the service discovery feature of promtail. And make promtail easier to be integrated into the CICD process in the k8s environment.
Describe the solution you'd like
CRD is simple to read 👍
Describe alternatives you've considered
#7247 introduce reload endoint / signal to promtail. This PR will be useful when the CRD applied.
logging-operator: https://banzaicloud.com/docs/one-eye/logging-operator/configuration/flow/
Logging operator for Kubernetes based on Fluentd and Fluent-bit. not promtail.
if Fluentd and Fluent-bit has some bug, I dont know how to fix it .
https://github.com/banzaicloud/logging-operator
Additional context
Add any other context or screenshots about the feature request here.
podmonitor design:
https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/design.md#podmonitor
podmonitors link:
https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/crds/crd-podmonitors.yaml
#7387 (comment)
The text was updated successfully, but these errors were encountered: