Skip to content

Conversation

ion-elgreco
Copy link
Contributor

@ion-elgreco ion-elgreco commented Sep 1, 2025

Description
Allows references secrets in the ext_proc env vars as a value: secretKeyRef {"name":"secret_name", "key": "secret_key"}

Complete example:

OTEL_EXPORTER_OTLP_HEADERS=secretKeyRef {"name":"secret_name", "key": "secret_key"}

This should also enable layering secrets with k8s, so you can configure you values.yaml this way for aigw, where secret_key is just the plain secret and then OTEL_EXPORTER_OTLP_HEADERS adds Bearer as prefix, while taking $SECRET_HEADER from the env var:

extProc:
  extraEnvVars:
    - name: OTEL_EXPORTER_OTLP_ENDPOINT
      value: http://phoenix-svc.phoenix.svc.cluster.local:6006
    - name: SECRET_HEADER
      value: "secretKeyRef {\"name\":\"secret_name\", \"key\": \"secret_key\"}"
    - name: OTEL_EXPORTER_OTLP_HEADERS
      value: "Bearer $SECRET_HEADER"

cc @codefromthecrypt, @mathetake

@ion-elgreco ion-elgreco requested a review from a team as a code owner September 1, 2025 16:01
@ion-elgreco ion-elgreco force-pushed the feat/secret-key-ref-support-ext_proc branch from ba9c418 to ea2db0c Compare September 1, 2025 16:01
Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, did you consider alternatives like

  1. Introduce another flag dedicated for secretRef
  2. Add support for valueFrom at extraEnvVars of helm level to match the Kubernetes API
  3. Pass the secretRefs from the helm into the new dedicated flag for secretRef
  4. Pass the secretRef as-is into the pod template

That way, we could avoid conflating everything in the comma separate stuff like the current one. Manual parsing like this seems an error-prone and looks clunky to be honest.

wdyt?

@codefromthecrypt
Copy link
Contributor

ps thanks for working on this

@ion-elgreco
Copy link
Contributor Author

Thanks, did you consider alternatives like

  1. Introduce another flag dedicated for secretRef
  2. Add support for valueFrom at extraEnvVars of helm level to match the Kubernetes API
  3. Pass the secretRefs from the helm into the new dedicated flag for secretRef
  4. Pass the secretRef as-is into the pod template

That way, we could avoid conflating everything in the comma separate stuff like the current one. Manual parsing like this seems an error-prone and looks clunky to be honest.

wdyt?

I didn't want to change to much beyond what I did now, since I didn't know how big of a change was acceptable.

Option 2 would definetely solve the error prone issue, because we would know how valueFrom gets converted into a string and decoded again.

The main issue is we have to go through this string structure, not sure if i'ts possible otherwise since I don't know the codebase well enough, but can definetly work another approach

@mathetake
Copy link
Member

@ion-elgreco let me know if you have any intent to continue this PR or cool with closing this one since it's been a while since last activity

@ion-elgreco
Copy link
Contributor Author

@mathetake yes, I would like to but have to find some time

@ion-elgreco ion-elgreco marked this pull request as draft October 12, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: update with instructions on how to authenticate Phoenix (for genai traces)

4 participants