-
Notifications
You must be signed in to change notification settings - Fork 373
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
[OpenTracing] Add skeleton code #462
Conversation
950cd5b
to
b9666c9
Compare
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.
One small comment about using rspec filters.
Otherwise this PR looks like good starting point with OpenTracing.
require 'ddtrace/opentracing' | ||
require 'ddtrace/opentracing/helper' | ||
|
||
if Datadog::OpenTracing.supported? |
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.
Could this be moved into RSpec filter?
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.
No. The next line below refers to a constant that is undefined if OpenTracing is not supported. We can only load these constants if Ruby >= 2.0.
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.
Everything looks good opentracing-wise. Only the one potential action item with the naming consistency.
lib/ddtrace/opentracing.rb
Outdated
@@ -0,0 +1,23 @@ | |||
module Datadog | |||
# Namespace for ddtrace OpenTracing implementation | |||
module OpenTracing |
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.
In both our python and go opentracing implementations we refer to the tracer and name the sub-module as 'opentracer'.
This is probably not a big deal, but we may wish to be consistent across our implementations.
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.
I see. For consistency with all other Datadog tracers, I'll change OpenTracing
to OpenTracer
.
lib/ddtrace/opentracing/carrier.rb
Outdated
@@ -0,0 +1,6 @@ | |||
module Datadog | |||
module OpenTracing | |||
class Carrier < ::OpenTracing::Carrier |
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.
👍 the python opentracing library does not define a class for the carrier and is assumed to be a dict
, this is better.
require 'ddtrace/opentracing' | ||
require 'ddtrace/opentracing/helper' | ||
|
||
if Datadog::OpenTracing.supported? |
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.
👍
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.
Looks good to me 👍.
* Added: opentracing to gemspec. * Added: Opentracing CI tasks. * Added: Datadog::OpenTracer module. * Added: Datadog::OpenTracer spec helpers. * Added: Datadog::OpenTracer::Tracer. * Added: Datadog::OpenTracer::Span. * Added: Datadog::OpenTracer::SpanContext. * Added: Datadog::OpenTracer::Scope. * Added: Datadog::OpenTracer::ScopeManager. * Added: Datadog::OpenTracer::Carrier.
* Added: opentracing to gemspec. * Added: Opentracing CI tasks. * Added: Datadog::OpenTracer module. * Added: Datadog::OpenTracer spec helpers. * Added: Datadog::OpenTracer::Tracer. * Added: Datadog::OpenTracer::Span. * Added: Datadog::OpenTracer::SpanContext. * Added: Datadog::OpenTracer::Scope. * Added: Datadog::OpenTracer::ScopeManager. * Added: Datadog::OpenTracer::Carrier.
* Added: opentracing to gemspec. * Added: Opentracing CI tasks. * Added: Datadog::OpenTracer module. * Added: Datadog::OpenTracer spec helpers. * Added: Datadog::OpenTracer::Tracer. * Added: Datadog::OpenTracer::Span. * Added: Datadog::OpenTracer::SpanContext. * Added: Datadog::OpenTracer::Scope. * Added: Datadog::OpenTracer::ScopeManager. * Added: Datadog::OpenTracer::Carrier.
* Added: opentracing to gemspec. * Added: Opentracing CI tasks. * Added: Datadog::OpenTracer module. * Added: Datadog::OpenTracer spec helpers. * Added: Datadog::OpenTracer::Tracer. * Added: Datadog::OpenTracer::Span. * Added: Datadog::OpenTracer::SpanContext. * Added: Datadog::OpenTracer::Scope. * Added: Datadog::OpenTracer::ScopeManager. * Added: Datadog::OpenTracer::Carrier.
* Added: opentracing to gemspec. * Added: Opentracing CI tasks. * Added: Datadog::OpenTracer module. * Added: Datadog::OpenTracer spec helpers. * Added: Datadog::OpenTracer::Tracer. * Added: Datadog::OpenTracer::Span. * Added: Datadog::OpenTracer::SpanContext. * Added: Datadog::OpenTracer::Scope. * Added: Datadog::OpenTracer::ScopeManager. * Added: Datadog::OpenTracer::Carrier.
* Added: opentracing to gemspec. * Added: Opentracing CI tasks. * Added: Datadog::OpenTracer module. * Added: Datadog::OpenTracer spec helpers. * Added: Datadog::OpenTracer::Tracer. * Added: Datadog::OpenTracer::Span. * Added: Datadog::OpenTracer::SpanContext. * Added: Datadog::OpenTracer::Scope. * Added: Datadog::OpenTracer::ScopeManager. * Added: Datadog::OpenTracer::Carrier.
* Added: opentracing to gemspec. * Added: Opentracing CI tasks. * Added: Datadog::OpenTracer module. * Added: Datadog::OpenTracer spec helpers. * Added: Datadog::OpenTracer::Tracer. * Added: Datadog::OpenTracer::Span. * Added: Datadog::OpenTracer::SpanContext. * Added: Datadog::OpenTracer::Scope. * Added: Datadog::OpenTracer::ScopeManager. * Added: Datadog::OpenTracer::Carrier.
This pull request extends OpenTracing components in their most basic form, which are all no-ops. It should act as a starting point for adding code and tests as we begin to implement OpenTracing for
ddtrace
.