Skip to content

Add metrics for API calls - #20

Open
dergeberl wants to merge 1 commit into
mainfrom
addMetricsForAPICalls
Open

Add metrics for API calls#20
dergeberl wants to merge 1 commit into
mainfrom
addMetricsForAPICalls

Conversation

@dergeberl

@dergeberl dergeberl commented Aug 18, 2026

Copy link
Copy Markdown
Member

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:

This PR adds metrics for API calls. Similar to the metrics in cloud-provider-stackit see https://github.com/stackitcloud/cloud-provider-stackit/tree/main/pkg/metrics

Special notes for your reviewer:

⚠️ I am not sure about the operationFromRequest, see also comment.

I tested that the metrics are created:
image

Breaking changes:

@ske-prow ske-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/enhancement Enhancement, improvement, extension labels Aug 18, 2026
@ske-prow

ske-prow Bot commented Aug 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nschad for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@ske-prow ske-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 18, 2026
Comment thread pkg/metrics/http.go Outdated
return response, err
}

func operationFromRequest(request *http.Request) string {

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.

I am not 100% sure about this. It kind of works but only in case all APIs follow that odd/even rule.
I copied this from https://github.com/stackitcloud/cloud-provider-stackit/blob/83f9aae577aa7e4a5b080cdbd076e6341aebd19f/pkg/metrics/http.go#L59

@dergeberl dergeberl changed the title WIP: Add metrics for API calls Add metrics for API calls Aug 18, 2026
@ske-prow ske-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 18, 2026
@dergeberl dergeberl added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 18, 2026
@dergeberl
dergeberl force-pushed the addMetricsForAPICalls branch from dd8a96d to 2d72b70 Compare August 18, 2026 13:09
@dergeberl dergeberl removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 18, 2026
@dergeberl
dergeberl force-pushed the addMetricsForAPICalls branch from 2d72b70 to 763e67b Compare August 18, 2026 14:38
@dergeberl
dergeberl force-pushed the addMetricsForAPICalls branch from 763e67b to ccc61b2 Compare August 18, 2026 14:40
@ske-prow

ske-prow Bot commented Aug 18, 2026

Copy link
Copy Markdown

@dergeberl: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-application-load-balancer-controller-verify ccc61b2 link true /test pull-application-load-balancer-controller-verify

Full PR test history. Your PR dashboard. Command help for this repository.
Please help us cut down on flakes by linking this test failure to an open flake report or filing a new flake report if you can't find an existing one. Also see the gardener testing guideline for how to avoid and hunt flakes.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/enhancement Enhancement, improvement, extension size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant