-
Notifications
You must be signed in to change notification settings - Fork 144
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
Introducing kubernetes.state_namespace datastream in k8s integration #3100
Comments
Adding
|
I see this is a tough one 😞 . In order to be precise we would need to either convert {
...
"kubernetes":{
"labels":{
"kubernetes_io/metadata_name":"kube-public"
},
"namespace": "kube-public",
"namespace_uuid": "asdf",
"namespace_labels": {},
"namespace_annotations": {},
"namespace_state":{
"created":{
"sec":1692688692
},
"status":{
"active":true,
"terminating":false
}
}
},
"metricset":{
"name":"state_namespace",
"period":10000
},
...
} @constanca-m do you think that Note that we already have the In any other case we would need to hit the breaking change's impact... |
Yes, for now I am using {
"@timestamp": "2019-03-01T08:05:34.853Z",
"event": {
"dataset": "kubernetes.state_namespace",
"duration": 115000,
"module": "kubernetes"
},
"kubernetes": {
"state_namespace": {
"created": {
"sec": 1691566342
},
"name": "local-path-storage",
"status": {
"active": true,
"terminating": false
}
}
},
"metricset": {
"name": "state_namespace",
"period": 10000
},
"service": {
"address": "127.0.0.1:55555",
"type": "kubernetes"
}
} The problem now is to find a solution to avoid introducing |
What is exactly the issue with the kubernetes processor ( The codebase that handles that can be found at https://github.com/elastic/elastic-agent-autodiscover/blob/8d7196695cfe60ff29a977e1f1f99759001a1f29/kubernetes/metadata/namespace.go#L98. Based on this I don't see where the issue would be. Is there anything else that I miss here 🤔 ? |
(I think) "kubernetes":{
"namespace":{
"name":"kube-public",
"uid":"87c48044-5618-4233-8ad5-73b7c5fc588b"
}
} And this causes an exception, because, once again, we have an object in |
That's really weird :). Do you hit this in latest |
I am running the {
"@timestamp": "2019-03-01T08:05:34.853Z",
"event": {
"dataset": "kubernetes.state_namespace",
"duration": 115000,
"module": "kubernetes"
},
"kubernetes": {
"state_namespace": {
"created": {
"sec": 1691566342
},
"name": "default",
"status": {
"active": true,
"terminating": false
}
}
},
"metricset": {
"name": "state_namespace",
"period": 10000
},
"service": {
"address": "127.0.0.1:55555",
"type": "kubernetes"
}
} But when I ran that manifest, then we have that new |
I tried running
Unfortunately, in both cases I ran into the same error:
I don't know what is causing this object to appear since running the tests on the metricset goes without a problem... 😕 |
And running it with every metricset disabled apart from {
"agent":{
"ephemeral_id":"8538f6e5-3134-4fad-a55b-d55702897288",
"id":"9da9b5b9-7f5a-42a0-85a8-e98ad350e8ae",
"name":"kind-control-plane",
"type":"metricbeat",
"version":"8.11.0"
},
"ecs":{
"version":"8.0.0"
},
"event":{
"dataset":"kubernetes.state_namespace",
"duration":306861293,
"module":"kubernetes"
},
"host":{
"name":"kind-control-plane"
},
"kubernetes":{
"labels":{
"kubernetes_io/metadata_name":"kube-system"
},
"namespace":{
"name":"kube-system",
"uid":"9db79c06-db65-4081-923f-b78deb19eda7"
},
"state_namespace":{
"created":{
"sec":1692858979
},
"name":"kube-system",
"status":{
"active":true,
"terminating":false
}
}
},
"metricset":{
"name":"state_namespace",
"period":10000
},
"orchestrator":{
"cluster":{
"name":"kind",
"url":"kind-control-plane:6443"
}
},
"service":{
"address":"http://kube-state-metrics:8080/metrics",
"type":"kubernetes"
}
} What could be adding the Edit: I just realized commenting |
Yeap, most probably it is sth like https://github.com/elastic/beats/blob/4ac4973250d39884be409efb593e1ad416515336/metricbeat/module/kubernetes/state_container/state_container.go#L138 that adds the metadata and treats the Namespace as a generic resource. You will need to change https://github.com/elastic/beats/blob/8effe2400de59546c6243caa36f4ae6356ac6091/metricbeat/module/kubernetes/util/kubernetes.go#L241 and call directly a namespace specific MetaGen (which treats the metadata properly with underscores as mentioned at #3100 (comment)) like what we do for the Service, Node, Pod resources. There is one that you could re-use called Hope that helps :). |
You nailed it @ChrsMark , it was exactly that! :) It runs without errors now, I still have a few doubts but I will write them in the description of the PR once I open it. |
Describe the enhancement:
Currently in our kubernetes integration we dont collect the namespace metrics from Kube State metrics. For more info see https://github.com/kubernetes/kube-state-metrics/blob/main/docs/namespace-metrics.md
This enhancement request will introduce the new kubernetes.state_namespace datastream collection. The main goal is to collect the
kube_namespace_status_condition
that will help users identify the status of namespace creation.Describe a specific use case for the enhancement or feature:
Users want easily to understand if their namespace creation is running or failing. Until now this was not feasible and users could not track the namespace status
What is the definition of done?
Add visualization to Overview dashboard:[Kubernetes] Add namespace visualization to Overview dashboard integrations#8377The text was updated successfully, but these errors were encountered: