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

Allow customization of Rails controller resource names #321

Merged
merged 2 commits into from
Jan 19, 2018

Conversation

delner
Copy link
Contributor

@delner delner commented Jan 19, 2018

You can modify the resource of a span in a controller by doing the following:

class FooController < ApplicationController
  def index
    tracer = Datadog.configuration[:rails][:tracer]
    tracer.active_span.resource = "custom-resource-name"
    # ...
  end
end

However this wasn't working because resource names were being overridden by default names when the span was completed.

This pull request allows the above to work, by not applying default resource names if a custom resource name has already been set.

Example of it working:

screen shot 2018-01-19 at 2 07 05 pm

@delner delner added bug Involves a bug integrations Involves tracing integrations labels Jan 19, 2018
@delner delner added this to the 0.11.1 milestone Jan 19, 2018
@delner delner self-assigned this Jan 19, 2018
@delner delner force-pushed the delner/customize_resource_names branch from 983562b to 0fe453a Compare January 19, 2018 20:12
@palazzem palazzem merged commit e9aa57a into master Jan 19, 2018
@palazzem palazzem deleted the delner/customize_resource_names branch January 19, 2018 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants