-
Notifications
You must be signed in to change notification settings - Fork 609
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 Bridge - Initial implementation #211
OpenTracing Bridge - Initial implementation #211
Commits on Oct 23, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 3e495b9 - Browse repository at this point
Copy the full SHA 3e495b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 18a71c1 - Browse repository at this point
Copy the full SHA 18a71c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4745eca - Browse repository at this point
Copy the full SHA 4745ecaView commit details -
Add missing stubs for fully implementing the Span and Scope classes from OpenTracing.
Configuration menu - View commit details
-
Copy full SHA for 16d5126 - Browse repository at this point
Copy the full SHA 16d5126View commit details -
Configuration menu - View commit details
-
Copy full SHA for ebfbcd2 - Browse repository at this point
Copy the full SHA ebfbcd2View commit details -
Configuration menu - View commit details
-
Copy full SHA for fea256c - Browse repository at this point
Copy the full SHA fea256cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad0ac64 - Browse repository at this point
Copy the full SHA ad0ac64View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3830cfc - Browse repository at this point
Copy the full SHA 3830cfcView commit details -
- Explicitly use opentracing.* to make OpenTracing imports easily distinguishable. - Leave OpenTelemetry class names as-is.
Configuration menu - View commit details
-
Copy full SHA for 564c1f2 - Browse repository at this point
Copy the full SHA 564c1f2View commit details -
Make start_active_span() a context manager
Since start_span() is a context manager and since we want the OpenTelemetry Span to stop when the SpanWrapper stops, we need to turn start_active_span() into a context manager and yield the ScopeWrapper rather than return it.
Configuration menu - View commit details
-
Copy full SHA for bb72218 - Browse repository at this point
Copy the full SHA bb72218View commit details -
Configuration menu - View commit details
-
Copy full SHA for 419c6f4 - Browse repository at this point
Copy the full SHA 419c6f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for d6f5224 - Browse repository at this point
Copy the full SHA d6f5224View commit details -
Configuration menu - View commit details
-
Copy full SHA for af35112 - Browse repository at this point
Copy the full SHA af35112View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ce0fb8 - Browse repository at this point
Copy the full SHA 2ce0fb8View commit details -
Move type test to a separate method because it's not related to start_active_span().
Configuration menu - View commit details
-
Copy full SHA for 3cf9fa3 - Browse repository at this point
Copy the full SHA 3cf9fa3View commit details -
Configuration menu - View commit details
-
Copy full SHA for aa7024a - Browse repository at this point
Copy the full SHA aa7024aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4361e48 - Browse repository at this point
Copy the full SHA 4361e48View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac128bb - Browse repository at this point
Copy the full SHA ac128bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for d60927b - Browse repository at this point
Copy the full SHA d60927bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a759cd - Browse repository at this point
Copy the full SHA 8a759cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 190b480 - Browse repository at this point
Copy the full SHA 190b480View commit details -
Configuration menu - View commit details
-
Copy full SHA for 941d629 - Browse repository at this point
Copy the full SHA 941d629View commit details -
Configuration menu - View commit details
-
Copy full SHA for ecb3026 - Browse repository at this point
Copy the full SHA ecb3026View commit details -
Configuration menu - View commit details
-
Copy full SHA for db05d6c - Browse repository at this point
Copy the full SHA db05d6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9efa7c5 - Browse repository at this point
Copy the full SHA 9efa7c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fe644d - Browse repository at this point
Copy the full SHA 1fe644dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 43bbac8 - Browse repository at this point
Copy the full SHA 43bbac8View commit details -
Configuration menu - View commit details
-
Copy full SHA for c53ff56 - Browse repository at this point
Copy the full SHA c53ff56View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e5e6cf - Browse repository at this point
Copy the full SHA 5e5e6cfView commit details -
Ignore "format" argument in inject/extract
The inject() and extract() methods on opentracing.Tracer have an argument called "format", which clashes with a Python builtin. We can't rename the argument in the subclass without generating W0221.
Configuration menu - View commit details
-
Copy full SHA for fe41317 - Browse repository at this point
Copy the full SHA fe41317View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bdf9a7 - Browse repository at this point
Copy the full SHA 1bdf9a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 550b461 - Browse repository at this point
Copy the full SHA 550b461View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13433b2 - Browse repository at this point
Copy the full SHA 13433b2View commit details -
Verify child span's
parent
field is correctVerify the `parent` field of the child span is set to the parent span object.
Configuration menu - View commit details
-
Copy full SHA for 26908a3 - Browse repository at this point
Copy the full SHA 26908a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1f1afc - Browse repository at this point
Copy the full SHA d1f1afcView commit details -
Configuration menu - View commit details
-
Copy full SHA for b16650b - Browse repository at this point
Copy the full SHA b16650bView commit details -
Make active_span return a wrapped span
We can't return an OTel object to the consumer of the OT API.
Configuration menu - View commit details
-
Copy full SHA for d398c8c - Browse repository at this point
Copy the full SHA d398c8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f214aa7 - Browse repository at this point
Copy the full SHA f214aa7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89ec88c - Browse repository at this point
Copy the full SHA 89ec88cView commit details -
Configuration menu - View commit details
-
Copy full SHA for cdf42b9 - Browse repository at this point
Copy the full SHA cdf42b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac45a5c - Browse repository at this point
Copy the full SHA ac45a5cView commit details -
Since the OpenTelemetry API expects an event name and the OpenTracing API doesn't provide this information, we use a helper function to derive an event name from the key-value pairs passed to the `log_kv()` method. The helper function is adapted from the Java OpenTracing bridge implementation: https://github.com/open-telemetry/opentelemetry-java/blob/2379965a97c306f160de510d47daaaa77ef32550/opentracing_shim/src/main/java/io/opentelemetry/opentracingshim/SpanShim.java#L152
Configuration menu - View commit details
-
Copy full SHA for a21f490 - Browse repository at this point
Copy the full SHA a21f490View commit details -
Remove unused context manager methods
`__enter__()` and `__exit__()` on `SpanWrapper` aren't needed because the same methods on the base class `opentracing.Span` do what we need them to do when `SpanWrapper` is used as a context manager. `__enter__()` and `__exit__()` on `ScopeWrapper` aren't needed because we use the `@contextmanager` decorator on `start_active_span(). When the `with start_active_span()` block ends, the `with` block in the *implementation* of `start_active_span()` ends as well, which in turn makes the `with` block in OpenTelemetry's `start_span()` end, which makes the `finally` block in `use_span()` run, which calls `end()` on the OpenTelemetry span.
Configuration menu - View commit details
-
Copy full SHA for b9c8ae3 - Browse repository at this point
Copy the full SHA b9c8ae3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bf6592 - Browse repository at this point
Copy the full SHA 5bf6592View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5eba267 - Browse repository at this point
Copy the full SHA 5eba267View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29e75a9 - Browse repository at this point
Copy the full SHA 29e75a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1537c52 - Browse repository at this point
Copy the full SHA 1537c52View commit details -
Configuration menu - View commit details
-
Copy full SHA for 25ceeca - Browse repository at this point
Copy the full SHA 25ceecaView commit details -
Configuration menu - View commit details
-
Copy full SHA for f1e4cba - Browse repository at this point
Copy the full SHA f1e4cbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bf91c1 - Browse repository at this point
Copy the full SHA 4bf91c1View commit details -
We shouldn't return an OpenTelemetry object to OpenTracing API calls.
Configuration menu - View commit details
-
Copy full SHA for 6f9d22c - Browse repository at this point
Copy the full SHA 6f9d22cView commit details -
Raise exception on invalid parent type
According to the OpenTracing API, `child_of` can only be of type `Span` or `SpanContext`. In the shim these are represented as `SpanWrapper` and `SpanContextWrapper`, respectively. In case we receive a different type in `child_of`, it's safer to bail out than to try to set an unexpected object as the span's parent.
Configuration menu - View commit details
-
Copy full SHA for a3cb8b0 - Browse repository at this point
Copy the full SHA a3cb8b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for b726baf - Browse repository at this point
Copy the full SHA b726bafView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74735d5 - Browse repository at this point
Copy the full SHA 74735d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for cfa9ff8 - Browse repository at this point
Copy the full SHA cfa9ff8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c68052 - Browse repository at this point
Copy the full SHA 1c68052View commit details -
Configuration menu - View commit details
-
Copy full SHA for af038a2 - Browse repository at this point
Copy the full SHA af038a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for e57b5f0 - Browse repository at this point
Copy the full SHA e57b5f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d15ec6 - Browse repository at this point
Copy the full SHA 0d15ec6View commit details -
Configuration menu - View commit details
-
Copy full SHA for efa0f0c - Browse repository at this point
Copy the full SHA efa0f0cView commit details -
- Reorder tests. - Replace `otel_*` properties with `unwrap()` method. - Use correct type in `tracer` argument of `ScopeManagerWrapper`.
Configuration menu - View commit details
-
Copy full SHA for f45ef7b - Browse repository at this point
Copy the full SHA f45ef7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a4cce55 - Browse repository at this point
Copy the full SHA a4cce55View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1901cec - Browse repository at this point
Copy the full SHA 1901cecView commit details -
Use context manager where possible
Use a `with` statement to finish spans automatically where possible, i.e. when not testing things which require explicit calling to `span.finish()`.
Configuration menu - View commit details
-
Copy full SHA for 1f8fd20 - Browse repository at this point
Copy the full SHA 1f8fd20View commit details -
Disable too-many-public-methods Pylint check
We have many methods because we have many tests.
Configuration menu - View commit details
-
Copy full SHA for 45ed0b9 - Browse repository at this point
Copy the full SHA 45ed0b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for c32c278 - Browse repository at this point
Copy the full SHA c32c278View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92b760f - Browse repository at this point
Copy the full SHA 92b760fView commit details -
Handle time conversion between OT and OTel
Handle time format differences between OpenTracing and OpenTelemetry. OpenTracing expects time values in seconds since the epoch represented as floats. OpenTelemetry expects time values in nanoseconds since the epoch represented as ints.
Configuration menu - View commit details
-
Copy full SHA for b6abe12 - Browse repository at this point
Copy the full SHA b6abe12View commit details -
Configuration menu - View commit details
-
Copy full SHA for fca38ad - Browse repository at this point
Copy the full SHA fca38adView commit details -
Return self for call chaining on SpanWrapper
Return `self` from all "setter" methods on `SpanWrapper` to allow call chaining.
Configuration menu - View commit details
-
Copy full SHA for e04c073 - Browse repository at this point
Copy the full SHA e04c073View commit details -
It seems we cannot consistently use Python type hints in the OpenTracing shim since we rely on the `opentracing` library which doesn't contain type hints, nor does it have PEP 561 compliant stub packages or a module on typeshed. Rather than including partial typing information it's better not to include typing information at all.
Configuration menu - View commit details
-
Copy full SHA for ca8146f - Browse repository at this point
Copy the full SHA ca8146fView commit details -
Configuration menu - View commit details
-
Copy full SHA for a263f18 - Browse repository at this point
Copy the full SHA a263f18View commit details -
Configuration menu - View commit details
-
Copy full SHA for b1f362f - Browse repository at this point
Copy the full SHA b1f362fView commit details -
Configuration menu - View commit details
-
Copy full SHA for fe77380 - Browse repository at this point
Copy the full SHA fe77380View commit details -
Clean up OpenTracing inheritance
In some cases we had duplicated logic from the base class' `__init__` method. In others we had overridden methods with the same logic as the equivalent methods in the base class. We clean up the above and add comments to help understand some of the inheritance-related choices.
Configuration menu - View commit details
-
Copy full SHA for 0252f6c - Browse repository at this point
Copy the full SHA 0252f6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 442dd5c - Browse repository at this point
Copy the full SHA 442dd5cView commit details -
Handle inaccuracies in time conversions
Due to the differences between decimal and binary float representations, some time values yield "surprising" results when performing float arithmetic operations to convert seconds to nanoseconds and vice versa.
Configuration menu - View commit details
-
Copy full SHA for 8fd39ef - Browse repository at this point
Copy the full SHA 8fd39efView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9453625 - Browse repository at this point
Copy the full SHA 9453625View commit details -
Rename package to opentelemetry-opentracing-shim
"ot" isn't clear enough and could lead to confusion.
Configuration menu - View commit details
-
Copy full SHA for 78183cc - Browse repository at this point
Copy the full SHA 78183ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f88e7c - Browse repository at this point
Copy the full SHA 4f88e7cView commit details -
Don't override active_span on TracerWrapper
If the user passes a custom ScopeManager, we want the TracerWrapper to call `active_span` on the custom ScopeManager.
Configuration menu - View commit details
-
Copy full SHA for 8a7c1a7 - Browse repository at this point
Copy the full SHA 8a7c1a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for cbe971b - Browse repository at this point
Copy the full SHA cbe971bView commit details -
Don't raise on unimplemented methods
Log a warning instead in order not to break application code.
Configuration menu - View commit details
-
Copy full SHA for 97f3734 - Browse repository at this point
Copy the full SHA 97f3734View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0017eee - Browse repository at this point
Copy the full SHA 0017eeeView commit details -
Let the OTel implementation create event timestamps
Let the OTel implementation create event timestamps instead of generating a timestamp in the shim, i.e. outside of OpenTelemetry.
Configuration menu - View commit details
-
Copy full SHA for c644c10 - Browse repository at this point
Copy the full SHA c644c10View commit details -
- Remove an unnecessary context manager layers. - Allow creating `ContextWrapper` objects either from a `SpanWrapper` or from a `Span` context manager.
Configuration menu - View commit details
-
Copy full SHA for 55e692a - Browse repository at this point
Copy the full SHA 55e692aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9210853 - Browse repository at this point
Copy the full SHA 9210853View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb41689 - Browse repository at this point
Copy the full SHA cb41689View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04d44e3 - Browse repository at this point
Copy the full SHA 04d44e3View commit details -
Don't allow using arbitrary scope managers
Until we figure out how to handle unsupported frameworks (e.g. gevent), we remove the `scope_manager` argument of `create_tracer` to avoid breaking the OpenTelemetry context propagation.
Configuration menu - View commit details
-
Copy full SHA for add02e7 - Browse repository at this point
Copy the full SHA add02e7View commit details -
These are obvious and therefore unnecessary.
Configuration menu - View commit details
-
Copy full SHA for c2b03a7 - Browse repository at this point
Copy the full SHA c2b03a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ecfd2b8 - Browse repository at this point
Copy the full SHA ecfd2b8View commit details -
Don't accept scalar values in references argument
The API docs are clear about the `references` argument being a list. We don't try to compensate for wrong argument types elsewhere, so no reason to do that here.
Configuration menu - View commit details
-
Copy full SHA for 3a78b2c - Browse repository at this point
Copy the full SHA 3a78b2cView commit details -
Not all classes in the shim are actually wrappers, which makes the XWrapper naming convention confusing. XShim is more neutral.
Configuration menu - View commit details
-
Copy full SHA for 10f72ac - Browse repository at this point
Copy the full SHA 10f72acView commit details -
Configuration menu - View commit details
-
Copy full SHA for aee40a3 - Browse repository at this point
Copy the full SHA aee40a3View commit details -
In the OpenTracing API, when an exception occurs while a span is active, information about the exception is added to the span as logs and a tag is added as well. We re-add this functionality to the shim since we've overridden the `__exit__()` method in which it lives.
Configuration menu - View commit details
-
Copy full SHA for f2e91c8 - Browse repository at this point
Copy the full SHA f2e91c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f093ee1 - Browse repository at this point
Copy the full SHA f093ee1View commit details -
Validating the parent type complicates the logic of `start_span()`. Since the OpenTracing API clearly specifies the valid types for a parent span, it's the user's responsibility to specify a valid parent.
Configuration menu - View commit details
-
Copy full SHA for 1f4cc3c - Browse repository at this point
Copy the full SHA 1f4cc3cView commit details -
Verify ScopeShim.close() deactivates span
Verify that calling `close()` on a `ScopeShim` deactivates the span in the OpenTelemetry tracer.
Configuration menu - View commit details
-
Copy full SHA for 970ce6a - Browse repository at this point
Copy the full SHA 970ce6aView commit details -
We shouldn't return OpenTelemetry objects to the OpenTracing API.
Configuration menu - View commit details
-
Copy full SHA for fc12138 - Browse repository at this point
Copy the full SHA fc12138View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc6f34e - Browse repository at this point
Copy the full SHA fc6f34eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7860f55 - Browse repository at this point
Copy the full SHA 7860f55View commit details -
Rename tracer argument of create_tracer()
Make it clearer that the provided tracer object should be an OpenTelemetry tracer, not an OpenTracing tracer.
Configuration menu - View commit details
-
Copy full SHA for 082183a - Browse repository at this point
Copy the full SHA 082183aView commit details