Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 352
Mar kolya/components suggestions#580
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,6 +2,7 @@ import datadog.trace.agent.test.AgentTestRunner | ||
| import datadog.trace.agent.test.TestUtils | ||
| import datadog.trace.api.DDSpanTypes | ||
| import datadog.trace.api.DDTags | ||
| import datadog.trace.instrumentation.http_url_connection.UrlInstrumentation | ||
| import io.opentracing.tag.Tags | ||
| import io.opentracing.util.GlobalTracer | ||
| @@ -65,4 +66,47 @@ class UrlConnectionTest extends AgentTestRunner { | ||
| url = new URI("$scheme://localhost:$INVALID_PORT").toURL() | ||
| } | ||
| def "trace request with connection failure to a local file with broken url path"() { | ||
| setup: | ||
| def url = new URI("file:/some-random-file%abc").toURL() | ||
| when: | ||
| runUnderTrace("someTrace") { | ||
| url.openConnection() | ||
| } | ||
| then: | ||
| thrown IllegalArgumentException | ||
| expect: | ||
| assertTraces(1) { | ||
| trace(0, 2) { | ||
| span(0) { | ||
| operationName "someTrace" | ||
| parent() | ||
| errored true | ||
| tags { | ||
| errorTags IllegalArgumentException, String | ||
| defaultTags() | ||
| } | ||
| } | ||
| span(1) { | ||
| operationName "file.request" | ||
| childOf span(0) | ||
| errored true | ||
| tags { | ||
| "$Tags.COMPONENT.key" UrlInstrumentation.COMPONENT | ||
| "$Tags.SPAN_KIND.key" Tags.SPAN_KIND_CLIENT | ||
| // FIXME: These tags really make no sense for non-http connections, why do we set them? | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you're right... it doesn't make sense for this case. perhaps we should limit this error span somehow to http only? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My impression is that http case doesn't even hit this code since we instrument http stuff separately... | ||
| "$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT | ||
| "$Tags.HTTP_URL.key" "$url" | ||
| "$Tags.PEER_PORT.key" 80 | ||
| errorTags IllegalArgumentException, String | ||
| defaultTags() | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops... I missed that it was already being set. Nice catch.