[ 
https://issues.apache.org/jira/browse/FLINK-33994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18083238#comment-18083238
 ] 

Thierno BARRY commented on FLINK-33994:
---------------------------------------

[~martijnvisser] In your January 2024 comment you raised two concerns about the 
previous attempt (PR [#19684|https://github.com/apache/flink/pull/19684]): no 
tests, and that it changed behavior rather than adding a properly configured 
option. I've picked up the same ask in PR 
[#27432|https://github.com/apache/flink/pull/27432] and tried to address both:
 * Tests: 6 unit tests covering env-var-only, config-only, precedence, empty 
fallback, and SPI wiring. No Mockito and no reflection (per Flink's testing 
guidelines) -- env lookup is injected as a Function<String, String> so tests 
pass a lambda.
 * Additive, not behavior-changing: the env var doesn't replace the existing 
pathway. If apikey is set in config, behavior is unchanged. The env var only 
kicks in as a documented option (EN + ZH docs updated, JavaDoc spells out 
resolution order). Resolution order: DD_API_KEY env var, then apikey config 
property, then null.

The env-var-wins ordering was suggested by [~davidrad] on the PR, motivated by 
GitOps deployments where operators need to inject the secret at deploy time 
without rewriting flink-conf.yaml from a read-only ConfigMap.

I started a [DISCUSS] thread on dev@ for broader visibility: 
[https://lists.apache.org/thread/6c5zmh6k2rx13717t059hphvv9bdwoc4]

Would you have a few minutes to take another look when convenient?

PR: [https://github.com/apache/flink/pull/27432]

> Use Datadog api key from environment variables if not set in conf
> -----------------------------------------------------------------
>
>                 Key: FLINK-33994
>                 URL: https://issues.apache.org/jira/browse/FLINK-33994
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Metrics
>            Reporter: Sweta Kalakuntla
>            Priority: Major
>         Attachments: Capture d’écran 2026-05-25 à 09.04.31.png
>
>
> Add a way to set Datadog API key from the environment variables. This way 
> during deployment, there is way to set the value from secrets/vault instead 
> of hardcoding key into code.
> Someone has created PR :
> [https://github.com/apache/flink/pull/19684/files] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to