-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 gateway metrics (Nginx) #9522
Comments
Hey, i enabled monitoring in the helm chart but getting targetDown for
Alerts:
This is using alertmanager with prometheus, any ideas on what values do i need to configure nginx-exporter for loki-gateway pod in kubernetes? Cheers |
Took a look at the rendered CRD's
Its just a serviceMonitor pointing to a broken service endpoint so we can safely delete for the moment:
|
Seems like But this endpoint is defined for loki-gateway deployment template:
IMO the dirty way is to set |
Looks like previously in 2.x helm charts the endpoint name was just And now it's changed for |
Suffering from the same issue. A bit nicer workaround: the serviceMonitor contains a check where the label values.yaml
|
In our case before the upgrade to v3 (chart: v5.20.0) we didn't have prometheus scraping of the gateway pods likely because the port names didn't match.
After upgrading to v3 (v6.6.1) we got monitoring of gateway pods (the gateway pods got
What is the best practice here? Is it possible to add an option to disable authentication only for metrics endpoint in the gateway-nginx via helm-chart? Or is adding auth credentials for prometheus scraping a preferred option here? |
@akorp the issue is not auth, the issue is that /metrics is not handled, having auth enabled just fails the request with a 401 instead of 404. This commit introduced the change seemingly as a drive-by: 79b876b#diff-d79225d50b6c12d41bceaed705a35fd5b5fff56f829fbbe5744ce6be632a0038 I think the port rename should be reverted. Until then @Pionerd's workaround is probably the best. |
@DanielCastronovo How is this completed? |
Still seems to be an issue here as well. Worked-around using: gateway:
service:
labels:
prometheus.io/service-monitor: "false" |
Not completed still an issue. Please reopen. Probably the closed it because they move their monitoring to this new even less complete meta monitoring chart..... |
same issue. |
Same. Please reopen. |
I recently upgraded to v6.10.0 of the helm chart and experienced this same issue. I worked around it by deploying nginx-prometheus-exporter along side nginx in the loki-gateway deployment. This how I did it: loki chart values snippet gateway:
nginxConfig:
serverSnippet: |
location = /stub_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
location = /metrics {
proxy_pass http://127.0.0.1:9113/metrics;
}
extraContainers:
- name: nginx-exporter
securityContext:
allowPrivilegeEscalation: false
image: nginx/nginx-prometheus-exporter:1.3.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9113
name: http-exporter
resources:
limits:
memory: 128Mi
cpu: 500m
requests:
memory: 64Mi
cpu: 100m |
Thanks for this, I too just ran into this with the chart upgrade. |
We wouldn't get much details from nginx anyway as the pod is nginx OSS, so let's forget about metrics Ref: grafana/loki#9522 (comment)
We wouldn't get much details from nginx anyway as the pod is nginx OSS, so let's forget about metrics for this component Ref: grafana/loki#9522 (comment) Signed-off-by: Thomas P. <[email protected]>
We wouldn't get much details from nginx anyway as the pod is nginx OSS, so let's forget about metrics for this component Ref: grafana/loki#9522 (comment) Signed-off-by: Thomas P. <[email protected]>
Is there an open issue for this? Maybe the title of this one is not sufficient |
To add to the answer of @vrivellino patches:
- target:
kind: Deployment
labelSelector: app.kubernetes.io/name=loki,app.kubernetes.io/component=gateway
patch: |-
- op: add
path: /spec/template/spec/initContainers
value:
- name: nginx-exporter
image: public.ecr.aws/nginx/nginx-prometheus-exporter:1.4
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
# Makes this a native sidecar container
restartPolicy: Always
ports:
- containerPort: 9113
name: http-exporter
resources:
requests:
memory: 100Mi
cpu: 50m
limits:
memory: 100Mi
cpu: 50m
|
Is your feature request related to a problem? Please describe.
I'm not be able to view if Loki Gateway (Nginx) is fully operational.
Only logs.
Describe the solution you'd like
Enable nginx exporter + service monitor + create a dashboard + alert
The text was updated successfully, but these errors were encountered: