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 sucker_punch integration #194

Merged
merged 2 commits into from
Sep 26, 2017
Merged

Conversation

p-lambert
Copy link
Member

@p-lambert p-lambert commented Sep 21, 2017

Overview

The sucker_punch integration traces all scheduled jobs:

require 'ddtrace'

Datadog::Monkey.patch_module(:sucker_punch)

# the execution of this job is traced
LogJob.perform_async('login')

# to change SuckerPunch service name, use the Pin class
pin = Datadog::Pin.get_from(::SuckerPunch)
pin.service = 'deploy-queues'

@p-lambert p-lambert force-pushed the pedro/add-suckerpunch-integration branch 3 times, most recently from 98915e3 to 5c8cad1 Compare September 22, 2017 02:06
@palazzem palazzem added this to the 0.9.0 milestone Sep 22, 2017
@palazzem palazzem added the integrations Involves tracing integrations label Sep 22, 2017
@p-lambert p-lambert force-pushed the pedro/add-suckerpunch-integration branch 3 times, most recently from 43404e3 to d238432 Compare September 22, 2017 17:03
@p-lambert p-lambert requested a review from palazzem September 22, 2017 19:06
@p-lambert p-lambert force-pushed the pedro/add-suckerpunch-integration branch from d238432 to 8ee8e81 Compare September 22, 2017 20:11
pin.tracer.provider.context = Datadog::Context.new

__with_instrumentation do |span|
span.resource = "#{self} [process]"
Copy link
Contributor

Choose a reason for hiding this comment

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

We may change that one as PROCESS LogJob

def __with_instrumentation
pin = Datadog::Pin.get_from(::SuckerPunch)

::SuckerPunch.datadog_pin.tracer.trace(pin.service) do |span|
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be great having something like:

  • sucker_punch.perform_async
  • sucker_punch.run_perform
  • sucker_punch.perform_in

assert_equal('sucker_punch', span.name)
assert_equal('DummyWorker [process]', span.resource)
assert_equal('DummyWorker', span.get_tag('sucker_punch.queue'))
assert_equal(Ext::Errors::STATUS, span.status)
Copy link
Contributor

Choose a reason for hiding this comment

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

we may check the message and the exception class here

@p-lambert p-lambert force-pushed the pedro/add-suckerpunch-integration branch from 8ee8e81 to 8e69ec4 Compare September 25, 2017 19:12
@p-lambert p-lambert force-pushed the pedro/add-suckerpunch-integration branch from 8e69ec4 to c705bed Compare September 25, 2017 20:33
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.

Nice! We'll improve this integration later if we need to add more metadata! Thank you!

@palazzem palazzem merged commit 4ff3cd2 into master Sep 26, 2017
@palazzem palazzem deleted the pedro/add-suckerpunch-integration branch September 26, 2017 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants