Skip to content

feat: Micrometer configuration in the KafkaProxy CRD#99

Open
SamBarker wants to merge 2 commits intokroxylicious:mainfrom
SamBarker:feat/020-micrometer-crd
Open

feat: Micrometer configuration in the KafkaProxy CRD#99
SamBarker wants to merge 2 commits intokroxylicious:mainfrom
SamBarker:feat/020-micrometer-crd

Conversation

@SamBarker
Copy link
Copy Markdown
Member

Summary

  • Proposes adding a structured micrometer field to the KafkaProxy spec to close the configuration gap between operator-managed and standalone proxy deployments
  • Covers standardBinders (JVM/process metrics) and commonTags (static deployment-wide metric tags) with CRD-level schema validation
  • Documents the static-only limitation of commonTags (per-pod values like AZ require future runtime enhancement)

Test plan

  • Review proposal for completeness against runtime's MicrometerDefinition model
  • Verify the structured schema covers all StandardBindersHook binder names
  • Confirm rejected alternatives adequately justify design decisions

🤖 Generated with Claude Code

@SamBarker SamBarker requested a review from a team as a code owner April 13, 2026 14:23
Comment thread proposals/020-micrometer-configuration-in-kafkaproxy-crd.md Outdated
Micrometer configuration is a proxy-wide, infrastructure concern — it affects what metrics the
proxy process emits and has implications for Prometheus scrape targets and dashboard
provisioning. It belongs on `KafkaProxy` (infrastructure admin) rather than
`VirtualKafkaCluster` (developer).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I could imagine a future enhancement that allows commonTags to be also defined at the virtualCluster level. This is out of scope for this proposal and would obviously need a operand change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah I can see that we would want to control tags at that level as well, but its not a thread I want to go near today.

Copy link
Copy Markdown
Member

@k-wall k-wall left a comment

Choose a reason for hiding this comment

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

LGTM

Proposes a structured micrometer field on the KafkaProxy spec to close
the configuration gap between operator-managed and standalone proxies.
Covers standardBinders and commonTags with CRD-level validation.

Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
@SamBarker SamBarker force-pushed the feat/020-micrometer-crd branch from 0adcfae to b203464 Compare April 28, 2026 04:23
Rework commonTags into a structured object with two sub-fields:
- static: deployment-wide key-value pairs
- fromLabels: map of tag name to label key, resolved per-pod via
  the Kubernetes downward API and CommonTagsHook env var interpolation

Also clarifies that validation failures surface as Accepted: False
with reason Invalid on the KafkaProxy status.

Assisted-by: Claude claude-sonnet-4-6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
#### `commonTags.fromLabels`: per-pod values via label promotion

Some tag values — such as availability zone — differ per pod and cannot be resolved at reconcile time because the proxy config file is shared across all replicas.
`commonTags.fromLabels` maps tag names (valid Prometheus label names) to Kubernetes label keys on the `KafkaProxy` CR, which the operator promotes into per-pod metric tags.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some labels on the pods may come from other sources (e.g.SSA).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Without giving the proxy the ability to query K8s apis we can't really capture any other source other than KafkaProxy as that's the only one the reconciler can configure the downwards api to populate env vars for.

Comment thread proposals/020-micrometer-configuration-in-kafkaproxy-crd.md
k-wall added a commit to k-wall/design that referenced this pull request Apr 28, 2026
Add PRs kroxylicious#96, kroxylicious#98, kroxylicious#99, kroxylicious#100, kroxylicious#101, and kroxylicious#103 which were opened
after the initial script was created.

Note: PR kroxylicious#100 is already correctly named (100-sidecar-injection-webhook.md).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
k-wall added a commit to k-wall/design that referenced this pull request Apr 28, 2026
This change simplifies the proposal numbering system by using PR numbers
as proposal identifiers, eliminating number collisions and removing the
need for a separate allocation process.

Changes:
- Simplified proposals/README.md to focus on author workflow
  - Removed index tables (directory listing serves as the index)
  - Streamlined instructions for creating and renaming proposals
- Updated proposal template with workflow instructions
  - Require PR number in title format: # <PR#> - <Title>
  - Moved workflow instructions into comment block
- Added GitHub workflow to automatically check proposal numbering
  - Validates both filename and title format
  - Updates PR description when proposal files don't match PR number
  - Provides exact commands to fix naming issues
  - Removes warning once corrected
  - Handles both added and renamed files
  - Runs on all PRs (ready for mandatory status check)
- Added notification script for existing open PRs
  - After merge, run notify-open-prs.sh to ask authors to rebase
  - Workflow will automatically guide them through renaming
  - Updated with all current open proposal PRs (kroxylicious#70, kroxylicious#82, kroxylicious#83, kroxylicious#85,
    kroxylicious#88, kroxylicious#93, kroxylicious#94, kroxylicious#96, kroxylicious#98, kroxylicious#99, kroxylicious#100, kroxylicious#101, kroxylicious#103)

Proposals 001-019 retain their original numbers.

Assisted-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Keith Wall <kwall@apache.org>
k-wall added a commit that referenced this pull request Apr 28, 2026
This change simplifies the proposal numbering system by using PR numbers
as proposal identifiers, eliminating number collisions and removing the
need for a separate allocation process.

Changes:
- Simplified proposals/README.md to focus on author workflow
  - Removed index tables (directory listing serves as the index)
  - Streamlined instructions for creating and renaming proposals
- Updated proposal template with workflow instructions
  - Require PR number in title format: # <PR#> - <Title>
  - Moved workflow instructions into comment block
- Added GitHub workflow to automatically check proposal numbering
  - Validates both filename and title format
  - Updates PR description when proposal files don't match PR number
  - Provides exact commands to fix naming issues
  - Removes warning once corrected
  - Handles both added and renamed files
  - Runs on all PRs (ready for mandatory status check)
- Added notification script for existing open PRs
  - After merge, run notify-open-prs.sh to ask authors to rebase
  - Workflow will automatically guide them through renaming
  - Updated with all current open proposal PRs (#70, #82, #83, #85,
    #88, #93, #94, #96, #98, #99, #100, #101, #103)

Proposals 001-019 retain their original numbers.

Assisted-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Signed-off-by: Keith Wall <kwall@apache.org>
@k-wall
Copy link
Copy Markdown
Member

k-wall commented Apr 28, 2026

Hi! We've updated the proposal numbering system to use PR numbers as proposal identifiers.

Action required: Please rebase your PR on main.

Once you rebase, you'll need to rename your proposal file and update the title:

git mv proposals/020-micrometer-configuration-in-kafkaproxy-crd.md proposals/099-configuration-in-kafkaproxy-crd.md
# Update title: remove any old number prefix and add PR number
sed -i.bak '0,/^# /{s/^# \([0-9]\{3\}\|xxx\|nnn\|000\) - /# 99 - /; t; s/^# /# 99 - /}' proposals/099-configuration-in-kafkaproxy-crd.md && rm proposals/099-configuration-in-kafkaproxy-crd.md.bak
git add proposals/099-configuration-in-kafkaproxy-crd.md
git commit -m "Rename proposal to use PR number"
git push

The GitHub workflow will automatically check your proposal file naming after you push and update this PR description if any corrections are still needed.

See proposals/README.md for the updated workflow.

@k-wall
Copy link
Copy Markdown
Member

k-wall commented Apr 28, 2026

Correction: The previous notification had an incorrect filename. Here are the correct commands:

git mv proposals/020-micrometer-configuration-in-kafkaproxy-crd.md proposals/099-micrometer-configuration-in-kafkaproxy-crd.md
# Update title: remove any old number prefix and add PR number
sed -i.bak '0,/^# /{s/^# \([0-9]\{3\}\|xxx\|nnn\|000\) - /# 99 - /; t; s/^# /# 99 - /}' proposals/099-micrometer-configuration-in-kafkaproxy-crd.md && rm proposals/099-micrometer-configuration-in-kafkaproxy-crd.md.bak
git add proposals/099-micrometer-configuration-in-kafkaproxy-crd.md
git commit -m "Rename proposal to use PR number"
git push

Sorry for the confusion!

Copy link
Copy Markdown
Member

@robobario robobario left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @SamBarker

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.

4 participants