Dennis-Mircea opened a new pull request, #1102:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1102
…ional metric reporters
<!--
*Thank you very much for contributing to the Apache Flink Kubernetes
Operator - we are happy that you want to help us improve the project. To help
the community review your contribution in the best possible way, please go
through the checklist below, which will get the contribution into a shape in
which it can be best reviewed.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [JIRA
issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are
made for typos in JavaDoc or documentation files, which need no JIRA issue.
- Name the pull request in the form "[FLINK-XXXX] [component] Title of the
pull request", where *FLINK-XXXX* should be replaced by the actual issue
number. Skip *component* if you are unsure about which is the best component.
Typo fixes that have no associated JIRA issue should be named following
this pattern: `[hotfix][docs] Fix typo in event time introduction` or
`[hotfix][javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
- Fill out the template below to describe the changes contributed by the
pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean
verify` passes. You can read more on how we use GitHub Actions for CI
[here](https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/development/guide/#cicd).
- Each pull request should address only one issue, not mix up code from
multiple issues.
- Each commit in the pull request has a meaningful commit message
(including the JIRA id)
- Once all items of the checklist are addressed, remove the above text and
this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
## What is the purpose of the change
This pull request rewrites the `Metrics and Logging` documentation page of
the Flink Kubernetes Operator to make the operator's metric surface
discoverable and unambiguous, extends the operator image with two additional
metric reporter plugins (Dropwizard, OpenTelemetry), and clarifies in code that
every Flink `metrics.*` key is honoured by the operator under the
`kubernetes.operator.metrics.*` prefix.
## Brief change log
- **Documentation rewrite**
(`docs/content/docs/operations/metrics-logging.md` + Chinese translation):
- Expanded the `Scope` section with a new `How Metric Identifiers Are
Built` subsection explaining the difference between *scope components* and
*logical scope*, and how non-labeling (SLF4J/JMX/Graphite) vs. labeling
(Prometheus/Datadog/InfluxDB) reporters assemble metric identifiers. Added
concrete Prometheus and SLF4J/JMX examples for System / Namespace / Resource
scopes.
- Added a new `Operator Custom Resource Metrics` table following the Flink
metrics reference styling, grouped by `Scope / Resource type / Metrics /
Description / Type`, covering `FlinkDeployment`, `FlinkSessionJob`,
`FlinkBlueGreenDeployment` and `FlinkStateSnapshot` across System / Namespace /
Resource scopes (including autoscaler counters, version / resource-usage
gauges, blue-green `Failures` counter, snapshot state gauges).
- Reordered and introduced per-topic subsections with high-level
explanatory paragraphs: `FlinkDeployment Version and Resource Usage`,
`FlinkDeployment / FlinkSessionJob Lifecycle metrics`,
`FlinkBlueGreenDeployment Lifecycle metrics`, `FlinkDeployment /
FlinkSessionJob JobStatus Tracking`, `FlinkBlueGreenDeployment JobStatus
Tracking`, `FlinkStateSnapshot State Tracking`, and `Scaling metrics`.
- Added the new `Scaling metrics` subsection with a high-level paragraph
and an alphabetically sorted `<ScalingMetric>` table (previously not
documented).
- Converted the `Kubernetes Client Metrics` and `Kubernetes client metrics
by Http Response Code` tables to the same `<table class="table
table-bordered">` styling used by the other operator metric tables, with the
metric names sorted alphabetically.
- `JOSDK Metrics`: linked to the upstream [JOSDK metrics
documentation](https://javaoperatorsdk.io/docs/documentation/operations/metrics/)
and clarified that those metrics are subject to the same scope/reporter rules.
- `Metric Reporters`: updated the bundled-reporters list (adds Dropwizard
and OpenTelemetry), added an `Operator-scoped Metric Configuration` subsection
explaining the `kubernetes.operator.metrics.*` → `metrics.*` prefix stripping
at startup, and a `Configuring Reporters on a FlinkDeployment` example
clarifying that `spec.flinkConfiguration` uses the plain `metrics.reporter.*`
prefix.
- **Image / packaging** (`flink-kubernetes-operator/pom.xml`): added
`flink-metrics-dropwizard` and `flink-metrics-otel` to the
`maven-dependency-plugin` `artifactItems` so both plugins end up under
`/opt/flink/plugins/` in the operator image.
- **Code clarification** (`KubernetesOperatorMetricOptions.java`): expanded
the class-level javadoc to state that only operator-specific toggles and
`k8soperator.*` scope formats are declared here, and that Flink `metrics.*`
keys are honoured when prefixed with `kubernetes.operator.` (stripped and
forwarded by `OperatorMetricUtils#createMetricConfig`). Reporter options are
intentionally not redeclared as typed `ConfigOption`s.
## Verifying this change
<!--
Please make sure both new and modified tests in this PR follows the
conventions defined in our code quality guide:
https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
-->
This change is a documentation / packaging / javadoc change without any new
runtime logic.
- Documentation: built the docs site locally and visually reviewed the
rewritten page (scope examples, tables, hint blocks, navigation).
- Image: built the operator image and verified that
`/opt/flink/plugins/flink-metrics-dropwizard` and
`/opt/flink/plugins/flink-metrics-otel` are present.
- Regression: configured an operator with
`kubernetes.operator.metrics.reporter.prom.factory.class=...` and confirmed
metrics are exposed on the configured port (no behaviour change expected).
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changes to the `CustomResourceDescriptors`:
no
- Core observer or reconciler logic that is regularly executed: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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]