-
Notifications
You must be signed in to change notification settings - Fork 375
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
Add http.base_url tag to Rack #327
Conversation
a65a3ae
to
0f1056b
Compare
0f1056b
to
a3f6704
Compare
@@ -20,16 +20,14 @@ def initialize(app) | |||
def call(env) | |||
# retrieve integration settings | |||
tracer = Datadog.configuration[:rack][:tracer] | |||
service = Datadog.configuration[:rack][:service_name] | |||
distributed_tracing = Datadog.configuration[:rack][:distributed_tracing] |
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.
Removed this variables since they're used once (reducing the method's length)
if status.to_s.start_with?('5') && request_span.status.zero? | ||
request_span.status = 1 | ||
end | ||
set_request_tags!(request_span, env, status, headers, response) |
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.
to reduce the method Abc complexity, I've moved these actions in a separated method that updates in place request_span
. It's just moving, though the logic is still the same.
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.
All good to me! with this new base_url
tag we can provide more details about the host via tag.
This pull request adds the
http.base_url
tag for Rack integrations, which is the equivalent ofRack::Request#base_url
, e.g. "http://example.org" Addresses #301