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

Do not attach empty 'node' metadata #1268

Merged
merged 1 commit into from
Dec 29, 2020

Conversation

andrzej-stencel
Copy link
Contributor

After attaching node=nil metadata to a metrics record, the other plugin prometheus_format fails with "undefined method `gsub' for nil:NilClass":

long-collection-sumologic-fluentd-metrics-8 fluentd 2020-12-23 11:18:21 +0000 [warn]: #0 dump an error event: error_class=NoMethodError error="undefined method `gsub' for nil:NilClass" location="/usr/local/bundle/gems/fluent-plugin-prometheus-format-1.3.2/lib/fluent/plugin/filter_prometheus_format.rb:127:in `escape'" tag="prometheus.metrics.state" time=2020-12-23 11:18:14.000000000 +0000 record={"@metric"=>"kube_pod_container_resource_limits", "app"=>"collections", "container"=>"forge-metrics", "endpoint"=>"http", "instance"=>"10.3.71.116:8080", "job"=>"kube-state-metrics", "namespace"=>"long-distributed-systems", "pod"=>"forge-pod1-fd7c8b6d4-gtvdw", "prometheus"=>"long-collections/long-collection-prometheus", "prometheus_replica"=>"prometheus-long-collection-prometheus-0", "resource"=>"cpu", "unit"=>"core", "@timestamp"=>1608722294978, "@value"=>0.1, "cluster"=>"long", "prometheus_service"=>"long-prometheus-kube-state-metrics", "node"=>nil, "pod_labels"=>{"assembly"=>"forge", "assemblyVersion"=>"21.0-1606248095-4476-165371dae6bb", "chart"=>"sumo-assembly", "chartVersion"=>"1.0.1", "heritage"=>"Helm", "pod-template-hash"=>"fd7c8b6d4", "release"=>"long-forge", "sumoPod"=>"1", "sumoPodGroup"=>"ingestion", "team"=>"distributed-systems"}, "replicaset"=>"forge-pod1-fd7c8b6d4", "deployment"=>"forge-pod1"}

@kasia-kujawa
Copy link
Contributor

Do you know why 'node' metadata is empty?

@andrzej-stencel
Copy link
Contributor Author

andrzej-stencel commented Dec 23, 2020

Do you know why 'node' metadata is empty?

I'm not quite sure, but I have a clue which I will want to investigate. There's a lot of 404 responses from Kubernetes API server which look a bit funny, like this:

prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:00:21 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/prod-analytics-airflow/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz
prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:00:24 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/teleport/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz
prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:13:15 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/kube-system/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz
prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:13:15 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/gloo-system/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz
prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:15:15 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/prod-collections/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz
prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:19:45 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/cert-manager/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz
prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:21:15 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/prod-distributed-systems/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz
prod-collection-sumologic-fluentd-metrics-10 fluentd 2020-12-23 11:29:46 +0000 [warn]: #0 HTTP status code 404, pods "prod-prometheus-kube-state-metrics-866d5d4858-zzkcz" not found for GET https://172.20.0.1/api/v1/namespaces/prod-analytics-airflow/pods/prod-prometheus-kube-state-metrics-866d5d4858-zzkcz

These responses are not something new, they occur in v1.2.1 as well.

Copy link
Contributor

@pmalek-sumo pmalek-sumo left a comment

Choose a reason for hiding this comment

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

@pmalek-sumo pmalek-sumo added this to the v1.3 milestone Dec 29, 2020
@pmalek-sumo
Copy link
Contributor

We'll need to cherry-pick this to https://github.com/SumoLogic/sumologic-kubernetes-fluentd

This was actually submitted by @astencel-sumo 🤦🏻 (SumoLogic/sumologic-kubernetes-fluentd#54)

Thanks!

@pmalek-sumo pmalek-sumo force-pushed the do-not-attach-empty-metadata branch from cae2436 to a2b5659 Compare December 29, 2020 11:01
@pmalek-sumo pmalek-sumo force-pushed the do-not-attach-empty-metadata branch from a2b5659 to d706053 Compare December 29, 2020 11:01
@perk-sumo
Copy link
Contributor

perk-sumo commented Dec 29, 2020

Do you know why 'node' metadata is empty?

Some metrics might not have a specific node data as they are cluster wide ones.

Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

👍

@pmalek-sumo pmalek-sumo merged commit bb0f658 into release-v1.3 Dec 29, 2020
@pmalek-sumo pmalek-sumo deleted the do-not-attach-empty-metadata branch December 29, 2020 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants