Skip to content

Conversation

@grantbdev
Copy link
Contributor

Overview

Add excon instrumentation adapter similar to the existing adapter for Faraday.

Related

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a first pass, the comments about setup and presence checking from #172 apply to this PR. I'll dig deeper into the instrumentation for more feedback when I get a chance.

@grantbdev
Copy link
Contributor Author

@mwear I've updated this PR to address all the relevant feedback from #172.

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in good shape. I have the one comment about saving a string allocation by using a map, and the larger question about quantization.

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same comments here as on the Rest::Client instrumentation regarding name and the middleware configuration. We should also set span status. According to the spec, it's required for requests resulting in an error.

@grantbdev
Copy link
Contributor Author

@mwear PR feedback addressed.

These spec statements seem conflicting:

Implementations MUST set status if the HTTP communication failed or an HTTP error status code is returned (e.g. above 3xx).

Don't set a status message if the reason can be inferred from http.status_code and http.status_text already.

@mwear
Copy link
Member

mwear commented Feb 5, 2020

The api-tracing spec has this to say:

Status interface represents the status of a finished Span. It's composed of a canonical code in conjunction with an optional descriptive message.

My interpretation is that a canonical status code should be set, but the optional descriptive message shouldn't be if it can be inferred from the http status code (or message).

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks for working through my suggestions @grantbdev!

@grantbdev
Copy link
Contributor Author

PR updated to use "HTTP #{method_name}" span names as discussed in the SIG meeting.

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like rest-client, this will need a rebase and the suggested change since the context prop PR merged.

@grantbdev
Copy link
Contributor Author

@mwear PR updated. Thanks!

@mwear
Copy link
Member

mwear commented Feb 7, 2020

Like #172 (comment), we should test propagation here as well. This is the corresponding datadog test: https://github.com/DataDog/dd-trace-rb/blob/master/spec/ddtrace/contrib/excon/instrumentation_spec.rb#L166-L188.

@mwear
Copy link
Member

mwear commented Feb 8, 2020

👀 ing good here too @grantbdev. Let me know if you want to take a look here as well @fbogsany.

@mwear
Copy link
Member

mwear commented Feb 18, 2020

Same as #172, this could a use a rebase and I'll merge it.

mwear pushed a commit that referenced this pull request Feb 18, 2020
* Add `rest-client` instrumentation adapter (#172)

Add `rest-client` instrumentation adapter
based on the adapter for Faraday and `ddtrace` code for `rest-client`.

The `rest-client` gem uses `restclient` internally for file and folder
naming, so I used that style for most of the internal adapter code.
`rest-client` is used for names referring to the gem name itself.

Related to #67

* Update `faraday` adapter

Update `faraday` adapter
to match changes in the `rest-client` adapter.

In the example code, the install call is replaced
to work with the structure changes from #175.

Support for disabling span reporting via a custom override
is no longer provided since there is not a need for it at this time.
This also removes the need to support injection of custom middleware.

In the tracer middleware, the HTTP method attribute value
is set to an uppercase string to be compliant with the specification.
The name of the span is set to "HTTP #{verb}"
to reduce the cardinality of the span names as described in the spec.
The span status is now set when the response is received.
The span propagation is now done directly.

Propagated headers are now tested.
@mwear
Copy link
Member

mwear commented Feb 18, 2020

I used to have a button where I could merge in master, but it's no longer here. I guess we'll need another rebase.

Add `excon` instrumentation adapter
based on the adapter for `rest-client` and `ddtrace` code for `excon`.

Related to #67
@grantbdev
Copy link
Contributor Author

@mwear PR rebased.

@mwear mwear merged commit 3a58e9f into open-telemetry:master Feb 18, 2020
@grantbdev grantbdev deleted the gb/feature--excon-instrumentation--67 branch February 18, 2020 20:27
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.

2 participants