Skip to content

add generic metrics for external API#1228

Merged
ske-prow[bot] merged 17 commits into
mainfrom
add-generic-metrics
Jul 9, 2026
Merged

add generic metrics for external API#1228
ske-prow[bot] merged 17 commits into
mainfrom
add-generic-metrics

Conversation

@aniruddha2000

Copy link
Copy Markdown
Member

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:

This PR enables using generic metrics for all the external API (IaaS & Loadbalancer) and also track error code more than 400 unlike 500 previously.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Breaking changes:

@ske-prow ske-prow Bot added kind/enhancement Enhancement, improvement, extension size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 15, 2026
@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand create

@ske-prow

ske-prow Bot commented Jun 15, 2026

Copy link
Copy Markdown

Hey @aniruddha2000, I'm managing your ondemand environment ond-yak. I've successfully transitioned from phase "preheated" to "provisioning".

👩‍🌾 Gardener Dashboard
🚀 STACKIT Portal

How to Connect

Retrieve kubeconfig to interact with the environment with kubectl ske (assuming you're connected to the prow-trusted cluster):

gardenctl target --garden prd --project 74140853d0 --shoot prow-trust
kubectl ske connect ondemand ond-yak

To connect to the API, you can retrieve the Password from the prow-trusted cluster:

export BASIC_AUTH_USERNAME=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.username}' | base64 -d)
export BASIC_AUTH_PASSWORD=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.password}' | base64 -d)
export PROJECT_ID=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.projectID}' | base64 -d)
export SNA_PROJECT_ID=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.snaProjectID}' | base64 -d)
export SKE_API=https://ske-api.ing.ond-yak.ci.ske.eu01.stackit.cloud
curl -u "$BASIC_AUTH_USERNAME:$BASIC_AUTH_PASSWORD" "$SKE_API/v2/projects/$PROJECT_ID/regions/eu01/clusters"

@ske-prow

ske-prow Bot commented Jun 15, 2026

Copy link
Copy Markdown

Hey @aniruddha2000, I'm managing your ondemand environment ond-yak. I've successfully transitioned from phase "provisioning" to "provisioned".

👩‍🌾 Gardener Dashboard
🚀 STACKIT Portal

How to Connect

Retrieve kubeconfig to interact with the environment with kubectl ske (assuming you're connected to the prow-trusted cluster):

gardenctl target --garden prd --project 74140853d0 --shoot prow-trust
kubectl ske connect ondemand ond-yak

To connect to the API, you can retrieve the Password from the prow-trusted cluster:

export BASIC_AUTH_USERNAME=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.username}' | base64 -d)
export BASIC_AUTH_PASSWORD=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.password}' | base64 -d)
export PROJECT_ID=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.projectID}' | base64 -d)
export SNA_PROJECT_ID=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.snaProjectID}' | base64 -d)
export SKE_API=https://ske-api.ing.ond-yak.ci.ske.eu01.stackit.cloud
curl -u "$BASIC_AUTH_USERNAME:$BASIC_AUTH_PASSWORD" "$SKE_API/v2/projects/$PROJECT_ID/regions/eu01/clusters"

@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand create --ske-base-branch=add-generic-metrics

@ske-prow

ske-prow Bot commented Jun 16, 2026

Copy link
Copy Markdown

Hey @aniruddha2000, you've asked for an ondemand environment. The OnDemandEnvironment ond-yak has already been assigned to this issue/PR, so I can't allocate another. 🫣

@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand edit --ske-base-branch=add-generic-metrics

@ske-prow

ske-prow Bot commented Jun 16, 2026

Copy link
Copy Markdown

Hey @aniruddha2000, I'm managing your ondemand environment ond-yak. I've successfully transitioned from phase "provisioned" to "provisioning".

👩‍🌾 Gardener Dashboard
🚀 STACKIT Portal

How to Connect

Retrieve kubeconfig to interact with the environment with kubectl ske (assuming you're connected to the prow-trusted cluster):

gardenctl target --garden prd --project 74140853d0 --shoot prow-trust
kubectl ske connect ondemand ond-yak

To connect to the API, you can retrieve the Password from the prow-trusted cluster:

export BASIC_AUTH_USERNAME=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.username}' | base64 -d)
export BASIC_AUTH_PASSWORD=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.password}' | base64 -d)
export PROJECT_ID=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.projectID}' | base64 -d)
export SNA_PROJECT_ID=$(kubectl get -n ondemand secret ond-yak-credentials -ojsonpath='{.data.snaProjectID}' | base64 -d)
export SKE_API=https://ske-api.ing.ond-yak.ci.ske.eu01.stackit.cloud
curl -u "$BASIC_AUTH_USERNAME:$BASIC_AUTH_PASSWORD" "$SKE_API/v2/projects/$PROJECT_ID/regions/eu01/clusters"

@ske-prow ske-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 16, 2026
@nschad nschad changed the title add genetric metrics for external API add generic metrics for external API Jun 17, 2026
@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand help

@ske-prow

ske-prow Bot commented Jun 21, 2026

Copy link
Copy Markdown

Hi @aniruddha2000, your ondemand ond-yak is stale and will be automatically deleted at 2026-06-22 13:32:23 +0000 UTC. You can set a new TTL via /ondemand edit --ttl=48h

@ske-prow

ske-prow Bot commented Jun 22, 2026

Copy link
Copy Markdown

Hey @aniruddha2000, I'm managing your ondemand environment ond-yak. I've successfully transitioned from phase "provisioning" to "destroying".

@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand create --ske-base-branch=add-generic-metrics

1 similar comment
@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand create --ske-base-branch=add-generic-metrics

@ske-prow

ske-prow Bot commented Jun 22, 2026

Copy link
Copy Markdown

Hey @aniruddha2000, you've asked me to delete the ondemand environment associated with this issue. I successfully destroyed the OnDemandEnvironment ond-yak.

@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand help

@ske-prow

ske-prow Bot commented Jun 22, 2026

Copy link
Copy Markdown

@aniruddha2000: The following commands are available for ondemands:

  • /ondemand create [OPTIONS]: Create an ondemand
  • /ondemand delete: Delete an existing ondemand that was associated with this PR/Issue
  • /ondemand edit [OPTIONS]: Edit an existing ondemand
  • /ondemand (move|transfer) --issue/--pull Move an existing ondemand
  • /ondemand help: Print this message

Note that by default your ondemand will be deleted when the issue/PR is closed.
You can disable this by setting the label ondemand/skip-deletion. Deletion
will also be triggered after 1 week, which can be customized via the --ttl
flag.

Available `flags`

You can specify arguments as if using a CLI, e.g. /ondemand --help. Available arguments are:

      --class string                   If specified, sets OnDemandEnvironment.spec.class to the given value. Useful for testing changes to the ondemand controller.
      --feature feature                Optional features to enable on the ondemand. (default [])
      --fresh                          If true, a not yet provisioned ondemand is assigned. Otherwise a preheated ondemand is preferred.
  -h, --help                           Displays the help message
      --initial-cluster-type string    Type of the ondemand's initial cluster: shoot (default) or autonomousshoot
      --issue string                   Target Issue when moving ondemands, like 'stackitcloud/ske-base#123' or a full URL. Synonymous with pull.
      --pull string                    Target PR when moving ondemands, like 'stackitcloud/ske-base#123' or a full URL. Synonymous with issue, which takes precedence.
      --ske-base-branch string         Override the ske-base GitRepo branch ref
      --ske-components-branch string   Override the ske-components branch ref.
      --ske-stages-branch string       Override the ske-stages GitRepo branch ref
      --ttl duration                   Time to live for the ondemand (e.g. '168h'). It will be deleted automatically once the time has passed. (default 168h0m0s)

Additionally, you can enable the following features when you create an ondemand

* private-networking<br>

by using /ondemand create --feature <name>=<config>.

The config will be parsed by Helm's strvals which is a compact format of YAML. Thus, if you have a YAML configuration, e.g.

fieldA:
subFieldA: valueA
fieldB:
subFieldB:
subSubFieldB: valueB

you would pass it as 'fieldA.subFieldA=valueA,fieldB.subFieldB.subSubFieldB=valueB'

@aniruddha2000

Copy link
Copy Markdown
Member Author

/ondemand create --ske-base-branch=add-generic-metrics

@dergeberl

Copy link
Copy Markdown
Member

/cc @stackitcloud/ske-infrastructure

@ske-prow ske-prow Bot requested a review from a team June 23, 2026 10:45
@aniruddha2000

Copy link
Copy Markdown
Member Author

stackitcloud/gardener-extension-provider-stackit#178 we need to merge it together

@nschad

nschad commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

stackitcloud/gardener-extension-provider-stackit#178

No. This needs to be merged & released first. Then you can merge the provider-stackit with an CSI version bump

Comment thread pkg/metrics/http.go Outdated
Comment thread pkg/metrics/http_test.go
Comment thread pkg/metrics/http_test.go Outdated
@aniruddha2000 aniruddha2000 requested a review from ftl June 24, 2026 13:10
@aniruddha2000 aniruddha2000 force-pushed the add-generic-metrics branch from 3896109 to 01d9322 Compare July 8, 2026 12:51
@ske-prow ske-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2026
@aniruddha2000 aniruddha2000 force-pushed the add-generic-metrics branch from 01d9322 to ebbced5 Compare July 8, 2026 12:51
@nschad

nschad commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@ske-prow ske-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2026
@ske-prow

ske-prow Bot commented Jul 9, 2026

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: b74b309030c1185a0136badcb3414b4e2df74ac9

@nschad

nschad commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/unhold
/approve

@ske-prow ske-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2026
@ske-prow

ske-prow Bot commented Jul 9, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nschad

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

@ske-prow ske-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2026
@nschad

nschad commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/cherry-pick release-v1.33
/cherry-pick release-v1.34
/cherry-pick release-v1.35
/cherry-pick release-v1.36

@stackit-ske

Copy link
Copy Markdown

@nschad: once the present PR merges, I will cherry-pick it on top of release-v1.33, release-v1.34, release-v1.35, release-v1.36 in new PRs and assign them to you.

Details

In response to this:

/cherry-pick release-v1.33
/cherry-pick release-v1.34
/cherry-pick release-v1.35
/cherry-pick release-v1.36

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.

@ske-prow ske-prow Bot merged commit 437d81d into main Jul 9, 2026
3 checks passed
@ske-prow ske-prow Bot deleted the add-generic-metrics branch July 9, 2026 11:08
@stackit-ske

Copy link
Copy Markdown

@nschad: #1228 failed to apply on top of branch "release-v1.33":

Applying: add genetric metrics for external API
Applying: make fmt
Applying: add tests for the new http error metrics
Applying: remove loadbalancer prefix from metrics names
Applying: add tests for HTTPRequestDurationHistogram and HTTPRequestCount
Applying: add api label from client creation
Applying: make mod tidy
Using index info to reconstruct a base tree...
M	go.mod
Falling back to patching base and 3-way merge...
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0007 make mod tidy

Details

In response to this:

/cherry-pick release-v1.33
/cherry-pick release-v1.34
/cherry-pick release-v1.35
/cherry-pick release-v1.36

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.

@stackit-ske

Copy link
Copy Markdown

@nschad: #1228 failed to apply on top of branch "release-v1.34":

Applying: add genetric metrics for external API
Applying: make fmt
Applying: add tests for the new http error metrics
Applying: remove loadbalancer prefix from metrics names
Applying: add tests for HTTPRequestDurationHistogram and HTTPRequestCount
Applying: add api label from client creation
Applying: make mod tidy
Using index info to reconstruct a base tree...
M	go.mod
Falling back to patching base and 3-way merge...
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0007 make mod tidy

Details

In response to this:

/cherry-pick release-v1.33
/cherry-pick release-v1.34
/cherry-pick release-v1.35
/cherry-pick release-v1.36

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.

@stackit-ske

Copy link
Copy Markdown

@nschad: #1228 failed to apply on top of branch "release-v1.35":

Applying: add genetric metrics for external API
Applying: make fmt
Applying: add tests for the new http error metrics
Applying: remove loadbalancer prefix from metrics names
Applying: add tests for HTTPRequestDurationHistogram and HTTPRequestCount
Applying: add api label from client creation
Applying: make mod tidy
Using index info to reconstruct a base tree...
M	go.mod
Falling back to patching base and 3-way merge...
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0007 make mod tidy

Details

In response to this:

/cherry-pick release-v1.33
/cherry-pick release-v1.34
/cherry-pick release-v1.35
/cherry-pick release-v1.36

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.

@stackit-ske

Copy link
Copy Markdown

@nschad: new pull request created: #1350

Details

In response to this:

/cherry-pick release-v1.33
/cherry-pick release-v1.34
/cherry-pick release-v1.35
/cherry-pick release-v1.36

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.

aniruddha2000 added a commit that referenced this pull request Jul 9, 2026
* add genetric metrics for external API

* make fmt

* add tests for the new http error metrics

* remove loadbalancer prefix from metrics names

* add tests for HTTPRequestDurationHistogram and HTTPRequestCount

* add api label from client creation

* make mod tidy

* add metrics for csi

* call metric server from csi/main.go

* create prometheus metrics exporter

* remove api name required check and update tests

* remove error from func

* make status_code

* make add more labels in new metrics

* make lint

* fix test

* optimize code
ske-prow Bot pushed a commit that referenced this pull request Jul 9, 2026
* add genetric metrics for external API

* make fmt

* add tests for the new http error metrics

* remove loadbalancer prefix from metrics names

* add tests for HTTPRequestDurationHistogram and HTTPRequestCount

* add api label from client creation

* make mod tidy

* add metrics for csi

* call metric server from csi/main.go

* create prometheus metrics exporter

* remove api name required check and update tests

* remove error from func

* make status_code

* make add more labels in new metrics

* make lint

* fix test

* optimize code
ske-prow Bot pushed a commit that referenced this pull request Jul 9, 2026
* add genetric metrics for external API

* make fmt

* add tests for the new http error metrics

* remove loadbalancer prefix from metrics names

* add tests for HTTPRequestDurationHistogram and HTTPRequestCount

* add api label from client creation

* make mod tidy

* add metrics for csi

* call metric server from csi/main.go

* create prometheus metrics exporter

* remove api name required check and update tests

* remove error from func

* make status_code

* make add more labels in new metrics

* make lint

* fix test

* optimize code
ske-prow Bot pushed a commit that referenced this pull request Jul 9, 2026
* add genetric metrics for external API

* make fmt

* add tests for the new http error metrics

* remove loadbalancer prefix from metrics names

* add tests for HTTPRequestDurationHistogram and HTTPRequestCount

* add api label from client creation

* make mod tidy

* add metrics for csi

* call metric server from csi/main.go

* create prometheus metrics exporter

* remove api name required check and update tests

* remove error from func

* make status_code

* make add more labels in new metrics

* make lint

* fix test

* optimize code

Co-authored-by: Aniruddha Basak <aniruddha.basak@stackit.cloud>
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. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. 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.

5 participants