Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource relation metrics #2424

Open
tiithansen opened this issue Jun 17, 2024 · 1 comment
Open

Resource relation metrics #2424

tiithansen opened this issue Jun 17, 2024 · 1 comment
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@tiithansen
Copy link

What would you like to be added:

It would be great if KSM had an optional set of metrics which would describe relations between resources.

For example:

  • Which HPA is controlling which deployment/statefulset.
  • Which service is connected to which pod.
  • Which ingress is connected to which service.
  • Possibly many more relations can be figured out ...

Why is this needed:

This would give a possibility to query relation changes over time. Also it would allow to create smarter and more detailed alerts about changes to configuration.

Describe the solution you'd like

If the label combinations are not frequently changing it should not have a big impact on memory usage for Prometheus or any other tool that is going to scrape and persist those metrics.

kube_ingress_relation{ingress="name-of-the-ingress", service="name-of-the-service", namespace="name-of-the-namespace"} 1 kube_service_relation{service="name-of-the-service", pod="name-of-the-pod", namespace="name-of-the-namespace"} 1 kube_hpa_relation{hpa="name-of-the-hpa", deployment="name-of-the-deployment", namespace="name-of-the-namespace"} 1
Possibly using resource uids might give better insight while being less fragile.

Additional context

This idea came from trying to develop Grafana Scenes App for Kubernetes to display cluster state based on collected metrics. If we would have metrics describing relations we could easily query state & alerts for related sources and build a full picture about the current state at any given time.

@tiithansen tiithansen added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 17, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 17, 2024
@dgrisonnet
Copy link
Member

/assign @rexagod
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants