Skip to content

implement additional metrics for backend traffic#4192

Merged
kcp-ci-bot merged 1 commit into
kcp-dev:mainfrom
xrstf:fp-metrics
Jun 5, 2026
Merged

implement additional metrics for backend traffic#4192
kcp-ci-bot merged 1 commit into
kcp-dev:mainfrom
xrstf:fp-metrics

Conversation

@xrstf
Copy link
Copy Markdown
Contributor

@xrstf xrstf commented Jun 5, 2026

Summary

This PR adds 3 new metrics to the front-proxy:

  • kcp_backend_rq_body_bytes{shard=...} – number of request body bytes sent from the front-proxy to the backend shards.
  • kcp_backend_rs_body_bytes{shard=...} – number of request body bytes received from a backend.
  • kcp_listener_tls_connection_error{shard=...} – count of TLS-related errors

What Type of PR Is This?

/kind feature

Related Issue(s)

Fixes #4042

Release Notes

Add `kcp_backend_rq_body_bytes`, `kcp_backend_rs_body_bytes`, `kcp_listener_tls_connection_error` metrics to front-proxy.

@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 5, 2026
Comment thread pkg/proxy/lookup/lookup.go Outdated
Comment on lines +198 to +199
ctx = WithShardName(ctx, result.Shard)
SetShardNameInHolder(ctx, result.Shard)
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.

Doesn't WithShardName already set the shard name correctly? Why are we setting it afterwards again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's due to the cascading nature of the middlewares. The lookup middleware is handled later, so only its children would know the effective shard. To transport the shard name up out of the subtree of middlewares, we inject this pointer and "cheat".

Comment thread pkg/proxy/metrics/metrics.go
Comment thread pkg/proxy/metrics/metrics.go
Comment thread pkg/proxy/metrics/metrics.go Outdated
Comment thread pkg/proxy/metrics/metrics.go Outdated
@ntnn ntnn added this to tbd Jun 5, 2026
@ntnn ntnn moved this to Reviewing in tbd Jun 5, 2026
On-behalf-of: @SAP christoph.mewes@sap.com
Copy link
Copy Markdown
Member

@ntnn ntnn left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2026
@kcp-ci-bot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 057eb8779b3d318e6c71df6677e06de9f419ca67

@kcp-ci-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ntnn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2026
@kcp-ci-bot kcp-ci-bot merged commit 95d26f2 into kcp-dev:main Jun 5, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewing to Done in tbd Jun 5, 2026
@xrstf xrstf deleted the fp-metrics branch June 5, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Expose ssl errors and req/res size metrics in front-proxy

3 participants