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

Add queryParameters in prometheus-scaler #4962

Closed
HenriquePiccolo opened this issue Sep 11, 2023 · 0 comments · Fixed by #4957
Closed

Add queryParameters in prometheus-scaler #4962

HenriquePiccolo opened this issue Sep 11, 2023 · 0 comments · Fixed by #4957
Labels
feature-request All issues for new features that have not been committed to help wanted Looking for support from community needs-discussion

Comments

@HenriquePiccolo
Copy link
Contributor

Proposal

I have a Thanos multi-tenancy cluster with soft-tenancy and hard-tenancy, it's separate using header "thanos-tenant" and queryParameter "tenant".

My proposal is to include a parameter in prometheus-scaler, where it's possible passa query parameters using coma to separate.

Use-Case

Expect Behavior

Using the below manifests, Keda should be able to pass query parameters in prometheus scaler

triggers:
- type: prometheus
  metadata:
    # Required fields:
    serverAddress: http://<prometheus-host>:9090
    metricName: http_requests_total # DEPRECATED: This parameter is deprecated as of KEDA v2.10 and will be removed in version 2.12. Note: name to identify the metric, generated value would be `prometheus-http_requests_total`
    query: sum(rate(http_requests_total{deployment="my-deployment"}[2m])) # Note: query must return a vector/scalar single element response
    queryParameters: tenant=123456,key-1=value-1
    threshold: '100.50'
    activationThreshold: '5.5'
    # Optional fields:
    namespace: example-namespace  # for namespaced queries, eg. Thanos
    cortexOrgID: my-org # DEPRECATED: This parameter is deprecated as of KEDA v2.10 in favor of customHeaders and will be removed in version 2.12. Use custom headers instead to set X-Scope-OrgID header for Cortex. (see below)
    customHeaders: X-Client-Id=cid,X-Tenant-Id=tid,X-Organization-Id=oid # Optional. Custom headers to include in query. In case of auth header, use the custom authentication or relevant authModes.
    ignoreNullValues: false # Default is `true`, which means ignoring the empty value list from Prometheus. Set to `false` the scaler will return error when Prometheus target is lost
    unsafeSsl: "false" #  Default is `false`, Used for skipping certificate check when having self-signed certs for Prometheus endpoint  

Is this a feature you are interested in implementing yourself?

Yes

Anything else?

No response

@HenriquePiccolo HenriquePiccolo added feature-request All issues for new features that have not been committed to needs-discussion labels Sep 11, 2023
@HenriquePiccolo HenriquePiccolo changed the title New parameter add in prometheus-scaler Add queryParameters in prometheus-scaler Sep 11, 2023
@tomkerkhove tomkerkhove added the help wanted Looking for support from community label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to help wanted Looking for support from community needs-discussion
Projects
Status: Ready To Ship
Development

Successfully merging a pull request may close this issue.

2 participants