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

Instrumentation/HTTP: Handle incoming requests with long request url … #515

Conversation

Projects
None yet
5 participants
@mayurkale22
Copy link
Collaborator

commented May 10, 2019

…path

Fixes #486

@codecov-io

This comment has been minimized.

Copy link

commented May 10, 2019

Codecov Report

Merging #515 into master will increase coverage by 0.35%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #515      +/-   ##
==========================================
+ Coverage   94.81%   95.17%   +0.35%     
==========================================
  Files         147      147              
  Lines       10604    10582      -22     
  Branches      905      899       -6     
==========================================
+ Hits        10054    10071      +17     
+ Misses        550      511      -39
Impacted Files Coverage Δ
src/detect-resource.ts 90.9% <0%> (-1.95%) ⬇️
src/common-utils.ts 95.83% <0%> (-0.84%) ⬇️
test/test-detect-resource.ts 99.13% <0%> (-0.38%) ⬇️
src/http.ts 91.6% <0%> (-0.34%) ⬇️
src/tracecontext-format.ts 96.42% <0%> (-0.19%) ⬇️
test/test-tracecontext-format.ts 99.06% <0%> (-0.04%) ⬇️
src/http-stats.ts 100% <0%> (ø) ⬆️
src/grpc-stats/server-stats.ts 100% <0%> (ø) ⬆️
src/grpc-stats/client-stats.ts 100% <0%> (ø) ⬆️
src/grpc-stats/stats-common.ts 100% <0%> (ø) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 727b59c...9d5cb11. Read the comment docs.

@mayurkale22 mayurkale22 added this to the Release 0.0.12 milestone May 10, 2019

@vmarchaud

This comment has been minimized.

Copy link
Contributor

commented May 10, 2019

I'm not sure if they are other places where we set tag value that may be above the 256 length mark.

@mayurkale22

This comment has been minimized.

Copy link
Collaborator Author

commented May 10, 2019

I'm not sure if they are other places where we set tag value that may be above the 256 length mark.

Other places are for client/server > method and client/server > statusCode, IMO they don't have this problem.

@@ -228,7 +228,12 @@ export class HttpPlugin extends BasePlugin {
rootSpan.addAttribute(
HttpPlugin.ATTRIBUTE_HTTP_ROUTE, requestUrl.path || '');
tags.set(
stats.HTTP_SERVER_ROUTE, {value: requestUrl.path || ''},
stats.HTTP_SERVER_ROUTE, {
value: ((requestUrl.path && requestUrl.path.length > 255) ?

This comment has been minimized.

Copy link
@draffensperger

draffensperger May 10, 2019

Contributor

Can this be simplified to just (requestUrl.path || '').substring(0, 255)?

Calling substring on a shorter string just returns the string so for strings shorter than 255 that is fine.

Should 255 be a constant as well?

This comment has been minimized.

Copy link
@mayurkale22

mayurkale22 May 10, 2019

Author Collaborator

Sure, done. I was thinking not to use substring unless it is really required by checking the length.

This comment has been minimized.

Copy link
@draffensperger

draffensperger May 10, 2019

Contributor

Makes sense - I'd say either is fine. I'm not sure whether the substring has a performance/memory penalty, but if it did that seems like a reason to only do it if needed.

This comment has been minimized.

Copy link
@mayurkale22

mayurkale22 May 10, 2019

Author Collaborator

Not sure, already made the change as per your suggestion.

@mayurkale22 mayurkale22 force-pushed the mayurkale22:handle_long_request_url_path branch from c6834ba to 9d5cb11 May 10, 2019

@mayurkale22 mayurkale22 merged commit aeb5fd4 into census-instrumentation:master May 10, 2019

56 checks passed

ci/circleci: node10 Your tests passed on CircleCI!
Details
ci/circleci: node11 Your tests passed on CircleCI!
Details
ci/circleci: node6 Your tests passed on CircleCI!
Details
ci/circleci: node8 Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
security/snyk - examples/grpc/package.json (mayurkale22) No manifest changes detected
security/snyk - examples/grpc/package.json (ofrobots) No manifest changes detected
security/snyk - examples/http/package.json (ofrobots) No manifest changes detected
security/snyk - package.json (mayurkale22) No manifest changes detected
security/snyk - package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-core/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-core/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-example-automatic-tracing/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-example-automatic-tracing/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-exporter-instana/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-exporter-instana/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-exporter-jaeger/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-exporter-jaeger/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-exporter-ocagent/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-exporter-ocagent/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-exporter-prometheus/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-exporter-prometheus/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-exporter-stackdriver/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-exporter-stackdriver/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-exporter-zipkin/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-exporter-zipkin/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-exporter-zpages/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-exporter-zpages/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-all/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-all/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-grpc/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-grpc/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-http/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-http/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-http2/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-http2/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-https/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-https/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-ioredis/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-mongodb/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-mongodb/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-instrumentation-redis/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-nodejs/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-nodejs/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-propagation-b3/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-propagation-b3/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-propagation-binaryformat/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-propagation-binaryformat/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-propagation-jaeger/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-propagation-jaeger/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-propagation-stackdriver/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-propagation-stackdriver/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-propagation-tracecontext/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-propagation-tracecontext/package.json (ofrobots) No manifest changes detected
security/snyk - packages/opencensus-resource-util/package.json (mayurkale22) No manifest changes detected
security/snyk - packages/opencensus-resource-util/package.json (ofrobots) No manifest changes detected

@mayurkale22 mayurkale22 deleted the mayurkale22:handle_long_request_url_path branch May 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.