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

Catch panic from Prometheus client on invalid label strings #4051

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Nov 16, 2022

Partially addresses #2944.
Supersedes and closes #4050.

This only solves the problem in httpmetrics package, we still have other scenarios where malformed strings can leak into Prometheus labels and cause panic, specifically the service-name-based metrics produced by the collector. So I am keeping the original issue open. Hopefully, we can resolve it when we migrate the metrics to OTEL, and allow factories to return errors to be handled gracefully.

@yurishkuro yurishkuro requested a review from a team as a code owner November 16, 2022 18:14
Signed-off-by: Yuri Shkuro <[email protected]>
@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Base: 97.17% // Head: 97.16% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (92512d3) compared to base (e0e6abd).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4051      +/-   ##
==========================================
- Coverage   97.17%   97.16%   -0.01%     
==========================================
  Files         295      295              
  Lines       17393    17413      +20     
==========================================
+ Hits        16901    16920      +19     
- Misses        396      397       +1     
  Partials       96       96              
Flag Coverage Δ
unittests 97.16% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/collector/app/server/http.go 100.00% <100.00%> (ø)
cmd/collector/app/server/zipkin.go 92.59% <100.00%> (ø)
pkg/httpmetrics/metrics.go 100.00% <100.00%> (ø)
plugin/storage/integration/integration.go 75.95% <0.00%> (-0.39%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yurishkuro yurishkuro merged commit 102c37b into jaegertracing:main Nov 16, 2022
@yurishkuro yurishkuro deleted the fix-2944 branch November 16, 2022 19:19
shubbham1215 pushed a commit to shubbham1215/jaeger that referenced this pull request Feb 22, 2023
…acing#4051)

Partially addresses jaegertracing#2944.
Supersedes and closes jaegertracing#4050.

This only solves the problem in httpmetrics package, we still have other
scenarios where malformed strings can leak into Prometheus labels and
cause panic, specifically the service-name-based metrics produced by the
collector. So I am keeping the original issue open. Hopefully, we can
resolve it when we migrate the metrics to OTEL, and allow factories to
return errors to be handled gracefully.

Signed-off-by: Yuri Shkuro <[email protected]>
shubbham1215 pushed a commit to shubbham1215/jaeger that referenced this pull request Mar 5, 2023
…acing#4051)

Partially addresses jaegertracing#2944.
Supersedes and closes jaegertracing#4050.

This only solves the problem in httpmetrics package, we still have other
scenarios where malformed strings can leak into Prometheus labels and
cause panic, specifically the service-name-based metrics produced by the
collector. So I am keeping the original issue open. Hopefully, we can
resolve it when we migrate the metrics to OTEL, and allow factories to
return errors to be handled gracefully.

Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: shubbham1215 <[email protected]>
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.

1 participant