Quick update: I dug into the history and found this was originally
proposed in PR #19684 <https://github.com/apache/flink/pull/19684> (2022)
for FLINK-33994 — closed by stale-bot
in Oct 2025 without ever receiving a committer review, despite
multiple users including a Datadog support engineer requesting it.
No design objections were raised on that PR.

That suggests the gap is reviewer attention, not technical
disagreement. PR #27432 <https://github.com/apache/flink/pull/27432> picks
up the same change with tests + docs;
would really appreciate a metrics-area committer's eyes here.

On 2026/05/18 07:59:30 Thierno BARRY via dev wrote:
> Hi all,
>
> I'd like to propose a small change to the Datadog HTTP metric reporter:
> fall back to a `*DD_API_KEY*` environment variable when the `*apikey*`
> configuration property is not set.
>
> *Motivation*
>
> For users running Flink on Kubernetes via the Flink Operator, the current
> API-key configuration is hard to use securely. `flink-conf.yaml` is
mounted
> from a read-only ConfigMap, so injecting secrets via the existing
> `FLINK_PROPERTIES` mechanism fails — the Docker entrypoint tries to append
> to the read-only file and the pod crashes.
>
> Reading the Datadog API key from an environment variable lets operators
> inject it via the standard Kubernetes Secret + `envFrom` pattern (e.g.
> through the External Secrets Operator), without any filesystem writes or
> operator-side workarounds.
>
> *Proposed behavior*
>
> Resolution order in `*DatadogHttpReporterFactory#getApiKey*`:
>
>    1. `DD_API_KEY` environment variable (if set and non-empty)
>    2. `apikey` configuration property (if set and non-empty)
>    3. null
>
> The env var winning over config is deliberate: it lets operators override
> config at deploy time without rewriting `flink-conf.yaml`, which is the
> whole point of supporting env vars in this context. A prior reviewer
(David
> Radley) suggested this ordering on the PR, and I agree it's the right
shape.
>
> Fully backward compatible — existing deployments that only set `*apikey*`
> continue to work unchanged.
>
> *Scope*
>
> The change is small: factory + tests + EN/ZH docs, ~140 LOC, no new
> dependencies. Tests don't use Mockito or reflection (per Flink testing
> guidelines) — env lookup is injected as a `Function<String, String>` and
> tests pass a lambda.
>
> *Jira*: https://issues.apache.org/jira/browse/FLINK-36456
> *PR*: https://github.com/apache/flink/pull/27432
>
> The PR has been open since January and I've been unable to get a
> metrics-area committer's attention through the normal channels. Looking
for
> a thumbs-up here on the approach so review can proceed — happy to adjust
> the design (e.g. flip the precedence, or scope the env var to a different
> name) based on feedback.
>
> Thanks,
> Thieno
>

Reply via email to