Myracle opened a new pull request, #27576: URL: https://github.com/apache/flink/pull/27576
## What is the purpose of the change This pull request adds HTTP Basic Authentication support for the PrometheusPushGatewayReporter. This enables users to connect Flink metrics reporting to secured PushGateway instances that require authentication. Many production deployments secure their PushGateway endpoints with authentication to prevent unauthorized metrics submission. Without this feature, users would need to configure network-level security (firewalls, VPNs) to protect the PushGateway, which is often more complex and less flexible than application-level authentication. ## Brief change log - Added `username` and `password` configuration options to `PrometheusPushGatewayReporterOptions` for specifying HTTP Basic Auth credentials - Updated `PrometheusPushGatewayReporter` to configure `BasicAuthHttpConnectionFactory` when both credentials are provided - Updated `PrometheusPushGatewayReporterFactory` to read credentials from configuration and emit a warning log when only one of username/password is configured (incomplete configuration) - Added unit tests to cover all authentication scenarios (no auth, partial auth with warning, complete auth) - Updated documentation (both English and Chinese) with configuration examples and security recommendations ## Verifying this change This change added tests and can be verified as follows: - Added `PrometheusPushGatewayReporterTest#testBasicAuthNotEnabledWithoutCredentials` - verifies reporter creation without credentials - Added `PrometheusPushGatewayReporterTest#testBasicAuthNotEnabledWithOnlyUsername` - verifies warning log when only username is configured - Added `PrometheusPushGatewayReporterTest#testBasicAuthNotEnabledWithOnlyPassword` - verifies warning log when only password is configured - Added `PrometheusPushGatewayReporterTest#testBasicAuthEnabledWithBothCredentials` - verifies reporter creation with complete credentials ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): **no** (uses existing `simpleclient_pushgateway` dependency which already includes `BasicAuthHttpConnectionFactory`) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: **yes** (added new configuration options `username` and `password` to `PrometheusPushGatewayReporterOptions` which is annotated with `@PublicEvolving`) - The serializers: **no** - The runtime per-record code paths (performance sensitive): **no** - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: **no** - The S3 file system connector: **no** ## Documentation - Does this pull request introduce a new feature? **yes** - If yes, how is the feature documented? **docs** (updated `docs/content/docs/deployment/metric_reporters.md` and `docs/content.zh/docs/deployment/metric_reporters.md`) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
