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

Support new 1.16 metrics with filter to exclude deprecated metrics #401

Merged
merged 11 commits into from
Feb 17, 2020
4 changes: 2 additions & 2 deletions deploy/helm/prometheus-overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ prometheus:
- url: http://collection-sumologic.sumologic.svc.cluster.local:9888/prometheus.metrics.apiserver
writeRelabelConfigs:
- action: keep
regex: apiserver;(?:apiserver_request_count|apiserver_request_latencies.*|etcd_request_cache_get_latencies_summary.*|etcd_request_cache_add_latencies_summary.*|etcd_helper_cache_hit_count|etcd_helper_cache_miss_count)
regex: apiserver;(?:apiserver_request_(?:count|total)|apiserver_request_(?:latencies|duration_seconds).*|etcd_request_cache_get_(?:latencies_summary|duration_seconds).*|etcd_request_cache_add_(?:latencies_summary|duration_seconds).*|etcd_helper_cache_hit_(?:count|total)|etcd_helper_cache_miss_(?:count|total))
sourceLabels: [job, __name__]
# kubelet metrics
- url: http://collection-sumologic.sumologic.svc.cluster.local:9888/prometheus.metrics.kubelet
writeRelabelConfigs:
- action: keep
regex: kubelet;(?:kubelet_docker_operations_errors|kubelet_docker_operations_latency_microseconds|kubelet_running_container_count|kubelet_running_pod_count|kubelet_runtime_operations_latency_microseconds.*)
regex: kubelet;(?:kubelet_docker_operations_errors.*|kubelet_docker_operations_(?:latency_micro|duration_)seconds.*|kubelet_running_container_count|kubelet_running_pod_count|kubelet_runtime_operations_(?:latency_micro|duration_)seconds.*)
sourceLabels: [job, __name__]
# cadvisor container metrics
- url: http://collection-sumologic.sumologic.svc.cluster.local:9888/prometheus.metrics.container
Expand Down
9 changes: 9 additions & 0 deletions deploy/helm/sumologic/conf/metrics/metrics.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
@label @DATAPOINT
</match>
<label @DATAPOINT>
{{- if and (eq .Capabilities.KubeVersion.Major "1") (gt (int .Capabilities.KubeVersion.Minor) 13) (lt (int .Capabilities.KubeVersion.Minor) 17) }}
<filter prometheus.metrics**>
@type grep
<exclude>
key @metric
pattern /^apiserver_request_count|^apiserver_request_latencies_summary|^kubelet_runtime_operations_latency_microseconds|^kubelet_docker_operations_latency_microseconds|^kubelet_docker_operations_errors$/
</exclude>
</filter>
{{- end }}
<filter prometheus.metrics**>
@type enhance_k8s_metadata
cache_size "#{ENV['K8S_METADATA_FILTER_CACHE_SIZE']}"
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@ prometheus-operator:
- url: http://collection-sumologic.sumologic.svc.cluster.local:9888/prometheus.metrics.apiserver
writeRelabelConfigs:
- action: keep
regex: apiserver;(?:apiserver_request_count|apiserver_request_latencies.*|etcd_request_cache_get_latencies_summary.*|etcd_request_cache_add_latencies_summary.*|etcd_helper_cache_hit_count|etcd_helper_cache_miss_count)
regex: apiserver;(?:apiserver_request_(?:count|total)|apiserver_request_(?:latencies|duration_seconds).*|etcd_request_cache_get_(?:latencies_summary|duration_seconds).*|etcd_request_cache_add_(?:latencies_summary|duration_seconds).*|etcd_helper_cache_hit_(?:count|total)|etcd_helper_cache_miss_(?:count|total))
sourceLabels: [job, __name__]
# kubelet metrics
- url: http://collection-sumologic.sumologic.svc.cluster.local:9888/prometheus.metrics.kubelet
writeRelabelConfigs:
- action: keep
regex: kubelet;(?:kubelet_docker_operations_errors|kubelet_docker_operations_latency_microseconds|kubelet_running_container_count|kubelet_running_pod_count|kubelet_runtime_operations_latency_microseconds.*)
regex: kubelet;(?:kubelet_docker_operations_errors.*|kubelet_docker_operations_(?:latency_micro|duration_)seconds.*|kubelet_running_container_count|kubelet_running_pod_count|kubelet_runtime_operations_(?:latency_micro|duration_)seconds.*)
sourceLabels: [job, __name__]
# cadvisor container metrics
- url: http://collection-sumologic.sumologic.svc.cluster.local:9888/prometheus.metrics.container
Expand Down
7 changes: 7 additions & 0 deletions deploy/kubernetes/fluentd-sumologic.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ data:
@label @DATAPOINT
</match>
<label @DATAPOINT>
<filter prometheus.metrics**>
@type grep
<exclude>
key @metric
pattern /^apiserver_request_count|^apiserver_request_latencies_summary|^kubelet_runtime_operations_latency_microseconds|^kubelet_docker_operations_latency_microseconds|^kubelet_docker_operations_errors$/
</exclude>
</filter>
<filter prometheus.metrics**>
@type enhance_k8s_metadata
cache_size "#{ENV['K8S_METADATA_FILTER_CACHE_SIZE']}"
Expand Down
4 changes: 2 additions & 2 deletions deploy/kubernetes/kube-prometheus-sumo-logic-mixin.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
writeRelabelConfigs: [
{
action: "keep",
regex: "apiserver;(?:apiserver_request_count|apiserver_request_latencies.*|etcd_request_cache_get_latencies_summary.*|etcd_request_cache_add_latencies_summary.*|etcd_helper_cache_hit_count|etcd_helper_cache_miss_count)",
regex: "apiserver;(?:apiserver_request_(?:count|total)|apiserver_request_(?:latencies|duration_seconds).*|etcd_request_cache_get_(?:latencies_summary|duration_seconds).*|etcd_request_cache_add_(?:latencies_summary|duration_seconds).*|etcd_helper_cache_hit_(?:count|total)|etcd_helper_cache_miss_(?:count|total))",
sourceLabels: [
"job",
"__name__"
Expand All @@ -62,7 +62,7 @@
writeRelabelConfigs: [
{
action: "keep",
regex: "kubelet;(?:kubelet_docker_operations_errors|kubelet_docker_operations_latency_microseconds|kubelet_running_container_count|kubelet_running_pod_count|kubelet_runtime_operations_latency_microseconds.*)",
regex: "kubelet;(?:kubelet_docker_operations_errors.*|kubelet_docker_operations_(?:latency_micro|duration_)seconds.*|kubelet_running_container_count|kubelet_running_pod_count|kubelet_runtime_operations_(?:latency_micro|duration_)seconds.*)",
sourceLabels: [
"job",
"__name__"
Expand Down