jaegertracing / jaeger

CNCF Jaeger, a Distributed Tracing Platform
https://www.jaegertracing.io/
Apache License 2.0
20.58k stars 2.45k forks source link

[Feature]: spm additional query parameter required for prometheus #4221

Open rbaumgar opened 1 year ago

rbaumgar commented 1 year ago

Requirement

I am using a global prometheus for spm where I need to add a specific query parameter to get data. Currently no parameter is available to define an additional query parameter. I only found --query.base-path which does not fit.

Problem

spm sends only e.g. "/api/v1/query?query=up", but I need to send "/api/v1/query?query=up&mykey=myvalue" otherwise I don't get any data.

Proposal

please provide another parameter, eg. --query.additional-parameter.

Open questions

No response

hkailantzis commented 10 months ago

That would be great, as in my case we're using Thanos, and query parameter is a hard requirement for us (like the namespace), and can't alter this requirement, as I don't have access to that component. For the Bearer token I use the ---prometheus.token-file cli flag, which is basically a secret token generated by an appopriate SA (for all-in-one), and I'm mounting it using:

extraSecretMounts:
    - name: prometheus-token
      mountPath: /tls
      secretName: jaeger-all-in-one-token
      readOnly: true

this, plus RoleBinding of ClusterRole type:

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: jaeger
  namespace: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: <ClusterRoleName>
subjects:
- kind: ServiceAccount
  name: jaeger-all-in-one
  namespace: default

but I'm getting an error which I can't make anything out of it, so I'm assuming is because of the missing required namespace parameter..., but not 100% sure...

msg":"HTTP handler, Internal Server Error","error":"failed executing metrics query: bad_response: readObjectStart: expect { or n, but found B, error found in #1 byte of ...|Bad Request|..., bigger context ...|Bad Request. The request or configuration is malfor|..."

cc @rbaumgar

rbaumgar commented 10 months ago

@hkailantzis I don't know what is required in your environment. In OpenShift you have two ports available

hkailantzis commented 10 months ago

@rbaumgar, is the 9092 case actually, where a namespace parameter is required...which is not supported by jaeger SPM as the moment right ?

rbaumgar commented 10 months ago

@hkailantzis correct! I don't want to use a cluster role for SPM...

prakrit55 commented 10 months ago

@yurishkuro, I want to try it out