Skip to content

K8SPS-672 track cloud provider for metrics - #1432

Open
gkech wants to merge 4 commits into
mainfrom
K8SPS-672
Open

K8SPS-672 track cloud provider for metrics#1432
gkech wants to merge 4 commits into
mainfrom
K8SPS-672

Conversation

@gkech

@gkech gkech commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

CHANGE DESCRIPTION

Problem:
GKE:
Screenshot 2026-06-29 at 10 52 55 AM

DO:
Screenshot 2026-06-29 at 10 58 33 AM

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PS version?
  • Does the change support oldest and newest supported Kubernetes version?

Copilot AI review requested due to automatic review settings June 26, 2026 10:00
@pull-request-size pull-request-size Bot added the size/L 100-499 lines label Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the operator’s platform reporting to include a detected cloud provider suffix (e.g. kubernetes-gke) so telemetry/version-service requests and startup logs can distinguish between Kubernetes distributions and managed providers.

Changes:

  • Add CloudProvider to platform.ServerVersion plus detection via API group probes and a node-sampling fallback.
  • Switch version-service requests and telemetry metrics to use serverVersion.String() instead of serverVersion.Platform.
  • Update manager startup log to emit the combined platform/provider identifier.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
pkg/platform/platform.go Adds cloud provider detection and a ServerVersion.String() that returns platform[-cloud].
pkg/version/service/service.go Sends combined platform/provider string to the version service.
pkg/telemetry/service.go Sends combined platform/provider string as the platform telemetry metric.
cmd/manager/main.go Logs combined platform/provider identifier at startup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/version/service/service.go
Comment thread pkg/telemetry/service.go
Comment thread pkg/platform/platform.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Comment on lines 44 to 47
timeout := 10 * time.Second
crUID := string(cr.GetUID())
platformStr := string(serverVersion.Platform)
platformStr := serverVersion.String()

Comment thread pkg/platform/platform.go Outdated
Comment on lines +123 to +126
if strings.Contains(host, aksHostSuffix) {
log.Info("cloud provider detected", "provider", CloudProviderAKS, "signal", "host:"+aksHostSuffix)
return CloudProviderAKS
}
@gkech
gkech marked this pull request as ready for review June 29, 2026 09:29
@gkech
gkech requested review from egegunes and hors as code owners June 29, 2026 09:29
Copilot AI review requested due to automatic review settings June 29, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Comment on lines 44 to 47
timeout := 10 * time.Second
crUID := string(cr.GetUID())
platformStr := string(serverVersion.Platform)
platformStr := serverVersion.String()

Comment thread pkg/platform/platform.go
Comment on lines +134 to +136
}
log.Info("cloud provider not detected", "provider", "unknown")
return CloudProviderUndef
@egegunes egegunes added this to the v1.3.0 milestone Jun 30, 2026
@JNKPercona

Copy link
Copy Markdown
Collaborator
Test Name Result Time
async-ignore-annotations-8-4 passed 00:06:30
async-global-metadata-8-4 passed 00:15:23
async-upgrade-8-0 passed 00:13:23
async-upgrade-8-4 passed 00:13:19
auto-config-8-4 passed 00:18:34
config-8-4 passed 00:27:41
config-router-8-0 passed 00:07:58
config-router-8-4 passed 00:07:41
custom-users-8-4 passed 00:06:14
demand-backup-8-0 passed 00:20:44
demand-backup-8-4 passed 00:20:17
gr-pitr-minio-8-4 passed 00:26:50
gr-pitr-encrypted-minio-8-4 passed 00:16:51
gr-pitr-one-pod-8-4 passed 00:11:13
async-pitr-minio-8-4 passed 00:26:31
demand-backup-cloud-8-4 passed 00:24:00
demand-backup-retry-8-4 passed 00:17:49
demand-backup-incremental-8-0 passed 00:34:23
demand-backup-incremental-8-4 passed 00:34:21
async-data-at-rest-encryption-8-0 passed 00:14:10
async-data-at-rest-encryption-8-4 passed 00:13:21
gr-cross-cluster-8-0 passed 00:19:20
gr-cross-cluster-8-4 passed 00:20:13
gr-cross-cluster-backup-8-0 passed 00:27:08
gr-cross-cluster-backup-8-4 passed 00:26:41
gr-global-metadata-8-4 passed 00:13:56
gr-data-at-rest-encryption-8-0 passed 00:14:07
gr-data-at-rest-encryption-8-4 passed 00:14:42
gr-demand-backup-8-4 passed 00:12:47
gr-demand-backup-cloud-8-4 passed 00:25:11
gr-demand-backup-haproxy-8-4 passed 00:10:57
gr-demand-backup-incremental-8-0 passed 00:25:11
gr-demand-backup-incremental-8-4 passed 00:23:46
gr-demand-backup-incremental-compressed-8-0 passed 00:11:46
gr-demand-backup-incremental-compressed-8-4 passed 00:11:47
gr-demand-backup-incremental-encrypted-8-0 passed 00:19:06
gr-demand-backup-incremental-encrypted-8-4 passed 00:18:04
gr-finalizer-8-4 passed 00:06:07
gr-haproxy-8-0 passed 00:05:04
gr-haproxy-8-4 passed 00:04:44
gr-ignore-annotations-8-4 passed 00:05:18
gr-init-deploy-8-0 passed 00:09:39
gr-init-deploy-8-4 passed 00:09:42
gr-one-pod-8-4 passed 00:05:56
gr-recreate-8-4 passed 00:17:12
gr-scaling-8-4 passed 00:07:49
gr-scheduled-backup-8-4 passed 00:26:27
gr-scheduled-backup-incremental-8-4 passed 00:34:29
gr-security-context-8-4 passed 00:10:24
gr-self-healing-8-4 passed 00:24:05
gr-tls-cert-manager-8-4 passed 00:11:06
gr-users-8-4 passed 00:07:36
gr-upgrade-8-0 passed 00:09:44
gr-upgrade-8-4 passed 00:10:36
haproxy-8-0 passed 00:08:29
haproxy-8-4 passed 00:08:27
init-deploy-8-0 passed 00:05:53
init-deploy-8-4 passed 00:05:52
limits-8-4 passed 00:04:20
monitoring-8-4 passed 00:18:50
one-pod-8-0 passed 00:06:13
one-pod-8-4 passed 00:06:25
operator-self-healing-8-4 passed 00:11:37
pvc-auto-resize-8-4 passed 00:05:01
pvc-resize-8-4 passed 00:14:00
recreate-8-4 passed 00:12:37
scaling-8-4 passed 00:10:36
scheduled-backup-8-0 passed 00:25:06
scheduled-backup-8-4 passed 00:24:04
scheduled-backup-incremental-8-0 passed 00:35:09
scheduled-backup-incremental-8-4 passed 00:34:47
service-per-pod-8-4 passed 00:05:56
sidecars-8-4 passed 00:04:51
smart-update-8-4 passed 00:09:58
storage-8-4 passed 00:04:09
switch-cluster-type-8-4 passed 00:11:16
telemetry-8-4 passed 00:06:13
tls-cert-manager-8-4 passed 00:15:52
users-8-0 passed 00:08:28
users-8-4 passed 00:08:13
version-service-8-4 passed 00:23:50
Summary Value
Tests Run 81/81
Job Duration 02:30:20
Total Test Time 20:14:47

commit: 7d919c1
image: perconalab/percona-server-mysql-operator:PR-1432-7d919c1c

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

Labels

size/L 100-499 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants