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

Add http.base_url tag to Rack #327

Merged
merged 2 commits into from
Jan 27, 2018

Conversation

delner
Copy link
Contributor

@delner delner commented Jan 24, 2018

This pull request adds the http.base_url tag for Rack integrations, which is the equivalent of Rack::Request#base_url, e.g. "http://example.org" Addresses #301

@delner delner added enhancement integrations Involves tracing integrations community Was opened by a community member labels Jan 24, 2018
@delner delner added this to the 0.11.1 milestone Jan 24, 2018
@delner delner self-assigned this Jan 24, 2018
@delner delner requested a review from palazzem January 24, 2018 21:47
@delner delner mentioned this pull request Jan 24, 2018
@delner delner force-pushed the delner/change_http_url_tag_to_include_host branch from a65a3ae to 0f1056b Compare January 24, 2018 22:34
@palazzem palazzem force-pushed the delner/change_http_url_tag_to_include_host branch from 0f1056b to a3f6704 Compare January 27, 2018 11:43
@@ -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]
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor

@palazzem palazzem left a 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.

@palazzem palazzem merged commit 763d9df into master Jan 27, 2018
@palazzem palazzem deleted the delner/change_http_url_tag_to_include_host branch January 27, 2018 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Was opened by a community member integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants