-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Metricbeat][Kubernetes] Namespace labels missing on kube-state-metrics and container metrics #33108
Comments
Hi @bvader. Thank you for the detailed description. Regarding the inconsistencies between the versions, there is an explanation.
So the best way to collect the labels before 8.1 would be with the use of the kubernetes autodiscover provider. Now, regarding the So this is not a bug, but rather a feature. I can see and agree with you that this request make sense for a devops. It is something that @elastic/obs-cloudnative-monitoring team could do as an enhancement. |
Thanks for the detailed response it helps greatly. So if I understand correctly in 8.1+ A) state_pod, state_container, state_service are supported I am mostly following except the following as, we would really like to get this working in 7.17. 4. So in versions 7.16 until 8.0 you do not see the labels, because Are the metric level enrichers something the end user configures?... if so can you show us the documentation or a how to? or are you saying in 7.17 the labels are not supported at all? 4. So in versions 7.16 until 8.0 you do not see the labels, because I am currently Testing running metricbeat with 7.17.6 with autodiscover (which I think I have been configured all along) Here is and example I am currently running, the autodiscover provider is configured and it is basically straight from the example here so I am unclear why we are not getting the labels. Perhaps I am unclear on the autodiscover / using it wrong. If so can you provide an example this is all pretty vanilla / simple GKE / kube-state-metrics / container & pod metrics Current config. metricbeat-kubernetes-7.17.6.yml
No Namespace Labels at all, I am right back to where I was...
Appreciate your help / guidance |
Correct
Correct
Correct as well as the namespace labels where the pod/container belong to.
Unfortunately the enricher became configurable in version 8.1 and after that can be configured to collect the namespace labels. Before that version it is not.
This is my mistake. It seems that the autodiscover provider although you are using it, does not collect the labels. The reason behind this is the setting of After all the above analysis it seems that between versions 7.16-8.1 it is not trivial to collect the namespace labels. I can suggest some ways forward.
metricbeat-kubernetes-7.17.6.yml
This way you will rely on the provider to start the metricsets that do not require I would like the teams opinion on this matter. @ChrsMark , @gizas |
This part looks weird to me:
The Now that I'm thinking of it again, how about adding a configurable option in |
If we are going to add this on the upcoming releases, it still needs to be backported to 7.16, 7.17 and 8.0. So why not just back porting the enricher feature we already have? |
I'm +1 on doing this if it's easy enough and worth the effort. On the other hand having the extra config option can be handy in other cases too (I don't have anything specific in mind at the moment). It's up to you make the call :). |
Regardless of the choice I think it should be just back ported only to 7.17 version as this is mainly the one supported and will be supported in the future. For the enhancement request I will open the issue myself. |
@MichaelKatsoulis and I had a sync and thank you for the great explanation here
For the backport work still I am not convinced if needed. @bvader is this analysis an outcome from a specific customer? |
@MichaelKatsoulis Thanks! for the clarifications, mostly makes sense.
Yes that was a mistake on my part... I edited the original post. I will absorb the other items. I spoke to @gizas Offline about the very large customer impacted by this... |
@MichaelKatsoulis does this issue include any other issues beside #33144 ? I've closed this issue, and backported it to 7.17, 8.5, 8.6 |
FYI : @gizas
Use Case : As a Kubernetes Platform Owner / Operator I want to be able to define labels at the namespace level (such as org, environment, product line etc) so that I can route / filter / apply workflow to the kube-state-metrics and container metrics based on these defined namespace labels.
The Following kube-state-metrics should support namespace labels.
The request is for 7.17.x backport and the 8.x release for metricbeat
Currently Supported
Not Currently Supported - But Required
EDIT removed - state_node per @MichaelKatsoulis explanation
Container metrics are / are not supported depending on what version is used see the matrix below.
Matrix of what the test indicate that are currently supported.
Steps to reproduce
I used GKE and the Google Online Boutique Sample
Deploy a microservices app such as the online boutique
With custom namespace labels example
Note : Tested with kube-state-metrics 2.4.2 and 2.6.0
https://github.com/kubernetes/kube-state-metrics/blob/v2.4.2/examples/standard/deployment.yaml#L24
Deploy metricbeat with standard kube-state-metrics configuration in 7.X 8.X
Go To Discover and Observer the kube-state-metrics that the custom namespace labels and those that do not.
Not Currently Supported - But Required
curl
the kube-state-metrics endpoint we see the labels are there. So it is unclear why they are not showing up on thestate_deployment
andstate_replicaset
metricsetsIt does Appear that in 8.X the custom matcher code for container metrics is not needed, it is unclear when look at the matrix above whether it is needed or not in 7.17
For reference here is the custom matcher code we had to use in 7.15.x to get the container metrics to have namespace labels
The text was updated successfully, but these errors were encountered: