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

fix(kuma-cp) metrics hijacker incorrect fallback during merge #2476

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

lobkovilya
Copy link
Contributor

@lobkovilya lobkovilya commented Aug 2, 2021

Summary

Metrics Hijacker could merge only metrics with the same label values. This's an incorrect way to handle data. Different label vales is a valid use case:

# TYPE envoy_cluster_external_upstream_rq counter
envoy_cluster_external_upstream_rq{envoy_response_code="200",envoy_cluster_name="backend_kuma-demo_svc_3001-_0_"} 14
envoy_cluster_external_upstream_rq{envoy_response_code="404",envoy_cluster_name="backend_kuma-demo_svc_3001-_0_"} 2
envoy_cluster_external_upstream_rq{envoy_response_code="200",envoy_cluster_name="backend_kuma-demo_svc_3001-_1_"} 24
envoy_cluster_external_upstream_rq{envoy_response_code="404",envoy_cluster_name="backend_kuma-demo_svc_3001-_1_"} 12
envoy_cluster_external_upstream_rq{envoy_response_code="200",envoy_cluster_name="kuma_envoy_admin"} 255

should become:

# TYPE envoy_cluster_external_upstream_rq counter
envoy_cluster_external_upstream_rq{envoy_response_code="200",envoy_cluster_name="backend_kuma-demo_svc_3001"} 38
envoy_cluster_external_upstream_rq{envoy_response_code="404",envoy_cluster_name="backend_kuma-demo_svc_3001"} 14
envoy_cluster_external_upstream_rq{envoy_response_code="200",envoy_cluster_name="kuma_envoy_admin"} 255

Current PR changes the way Hijacker merges the metrics. Also, added comments on how it works.

Full changelog

  • add more test cases
  • replace 'merge' algorithm
  • add comments

Issues resolved

N/A

Documentation

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

Signed-off-by: Ilya Lobkov <lobkovilya@yandex.ru>
@lobkovilya lobkovilya merged commit 49e24fe into master Aug 4, 2021
@lobkovilya lobkovilya deleted the fix/metrics-hijacker-fallback branch August 4, 2021 10:58
mergify bot pushed a commit that referenced this pull request Aug 4, 2021
Signed-off-by: Ilya Lobkov <lobkovilya@yandex.ru>
(cherry picked from commit 49e24fe)
jpeach pushed a commit that referenced this pull request Aug 11, 2021
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
(cherry picked from commit 49e24fe)
jpeach pushed a commit that referenced this pull request Aug 11, 2021
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
(cherry picked from commit 49e24fe)

Co-authored-by: Ilya Lobkov <ilya.lobkov@konghq.com>
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.

None yet

2 participants