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 scaler: support list of custom headers and custom auth #4206

Closed
prashant-shahi opened this issue Feb 7, 2023 · 1 comment
Closed
Labels
feature-request All issues for new features that have not been committed to needs-discussion

Comments

@prashant-shahi
Copy link
Contributor

prashant-shahi commented Feb 7, 2023

Proposal

Provide support for custom headers to be included in each queries in Prometheus scalar.

New prometheus scaler configuration being the customHeaders metadata:

Sample:

kind: ScaledObject
metadata:
  name: prometheus-scaledobject
spec:
  triggers:
  - type: prometheus
    metadata:
      customHeaders: X-Client-Id=cid,X-Tenant-Id=tid,X-Organization-Id=oid
      authModes: "custom"
    authenticationRef:
      name: keda-prom-creds
---
kind: Secret
metadata:
  name: keda-prom-secret
data:
  customAuthHeader: "X-AUTH-TOKEN"
  customAuthValue: "auth-token"
---
kind: TriggerAuthentication
metadata:
  name: keda-prom-creds
spec:
  secretTargetRef:
    - parameter: customAuthHeader
      name: keda-prom-secret
      key: customAuthHeader
    - parameter: customAuthValue
      name: keda-prom-secret
      key: customAuthValue

Use-Case

Custom headers can be helpful for various reasons:

  • identification of tenant or organization in cloud environment
  • identifier for the client or customer

Custom auth header can be useful for authentication and authorization purposes with any custom header name and value.

Is this a feature you are interested in implementing yourself?

Yes

Anything else?

Apart from authentication part, I see that only x-Scope-OrgID header is available, which is specific to querying multi tenant Cortex or Mimir.

That could be supported via customHeaders metadata as well.

@prashant-shahi prashant-shahi added feature-request All issues for new features that have not been committed to needs-discussion labels Feb 7, 2023
@prashant-shahi prashant-shahi changed the title prometheus scaler: support list of custom headers prometheus scaler: support list of custom headers and custom auth Feb 7, 2023
@zroubalik
Copy link
Member

Done

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 needs-discussion
Projects
Status: Done
Development

No branches or pull requests

2 participants