-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a single top level span for Racecar consumers
Right now, Racecar consumer processes use one of two top level span names based on the mode of operation: `racecar.message` or `racecar.batch`. Because of this, the Datadog interface cannot show single message consumers and batch consumers in the same list. This change subscribes to the `main_loop` event which wraps both of these more specific events. The new span is called `racecar.consume` since that is the logical operation.
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'ddtrace/contrib/racecar/ext' | ||
require 'ddtrace/contrib/racecar/event' | ||
|
||
module Datadog | ||
module Contrib | ||
module Racecar | ||
module Events | ||
# Defines instrumentation for main_loop.racecar event | ||
module Consume | ||
include Racecar::Event | ||
|
||
EVENT_NAME = 'main_loop.racecar'.freeze | ||
|
||
module_function | ||
|
||
def event_name | ||
self::EVENT_NAME | ||
end | ||
|
||
def span_name | ||
Ext::SPAN_CONSUME | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters