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

Prometheus metrics at Path level inside rules #6206

Open
1 task done
som-kanade opened this issue Jun 13, 2024 · 0 comments
Open
1 task done

Prometheus metrics at Path level inside rules #6206

som-kanade opened this issue Jun 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@som-kanade
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

We have prometheus global plugin setup on kong ingress controller running on k8s cluster
There are multiple paths defined inside rules (Example attached below)
When i try to get to metrics at each path level that is not available but metrics are available at route level

`kongHttpRoute:
enabled: true
routes:
- rules:
name: apis
annotations:
konghq.com/methods: "GET,POST,OPTIONS"
konghq.com/plugins: validate-customer-session, strip-prefix, prometheus
paths:
- type: RegularExpression
path: /service-name/api/v1/status
method: GET
- type: RegularExpression
path: /service-name/api/v1/health
method: POST
backendRefs: ads-service
port: 80

kongPlugin:
enabled: true
plugins:
- kongPluginName: validate-customer-session
config:
appendRiderId: false
authenticationBasePath: https://<domain_url>
authenticationValidateApiPath: /auth/v1/session-id/
- kongPluginName: strip-prefix
config:
count: 1
regex: /service-name
- kongPluginName: prometheus
config:
status_code_metrics: true
bandwidth_metrics: true
upstream_health_metrics: true
latency_metrics: true
per_consumer: true`

    Metrics available currently > 

kong_http_requests_total{code="200", container="proxy", endpoint="status", exported_service="httproute..-apis.0", instance="", job="kic-gateway-proxy", namespace="infrastructure", pod="", route="httproute..-auth-apis.0.1", service="kic-gateway-proxy", source="service"}

PS : Our kong is already above 3.x.x.

Expected Behavior

Expecting metrics at Path like for above example

kong_http_requests_total should be available for both API Paths of above routes

  1. kong_http_requests at /service-name/api/v1/status level
  2. kong requests at /service-name/api/v1/health level

How can this be achieved

Steps To Reproduce

Run kong ingress controller in k8s 
Enable prometheus plugin 
query prometheus metrics at Path level with the metric  <kong_http_requests_total>

Kong Ingress Controller version

> 3.x.x

Kubernetes version

1.26

Anything else?

Followed documentation for prometheus plugin with no luck

@som-kanade som-kanade added the bug Something isn't working label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant