-
Notifications
You must be signed in to change notification settings - Fork 650
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
ext/opentracing-shim: implement inject and extract #256
ext/opentracing-shim: implement inject and extract #256
Conversation
This commit implements inject() and extract() support for TEXT_MAP and HTTP_HEADERS formats by using the configured OpenTelemetry propagators. The support for binary propagators is not completed on opentelemetry-python so this commit does not include for such format.
self.assertEqual( | ||
http_headers[MockHTTPTextFormat.SPAN_ID_KEY], str(7478) | ||
) | ||
|
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 we have the error as a separated test case? ;)
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 separated different formats in different test cases in 30de890.
self.shim.extract(opentracing.Format.BINARY, bytearray()) | ||
|
||
|
||
class MockHTTPTextFormat(HTTPTextFormat): |
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'm assuming it's not so trivial to verify against the actual builtin format(s)?
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.
It is not that hard actually but I wanted to keep these tests independently from actual implementations. Of course I am open to discuss why it could be better to test with the actual implementation instead.
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.
Sounds good to me, but lets wait for others to chime in ;)
Handle different formats in different test cases.
Let's get this rolling! |
ext/opentelemetry-ext-opentracing-shim/src/opentelemetry/ext/opentracing_shim/__init__.py
Outdated
Show resolved
Hide resolved
…pentracing_shim/__init__.py Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>
Codecov Report
@@ Coverage Diff @@
## master #256 +/- ##
==========================================
+ Coverage 85.5% 85.74% +0.23%
==========================================
Files 33 33
Lines 1608 1620 +12
Branches 181 183 +2
==========================================
+ Hits 1375 1389 +14
+ Misses 186 184 -2
Partials 47 47
Continue to review full report at Codecov.
|
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.
LGTM
@mauriciovasquezbernal looks like I don't have permission to push to the branch. I can merge this after you pick up master: diff --cc ext/opentelemetry-ext-opentracing-shim/CHANGELOG.md
index 34017bb,f059e90..8fe7c21
--- a/ext/opentelemetry-ext-opentracing-shim/CHANGELOG.md
+++ b/ext/opentelemetry-ext-opentracing-shim/CHANGELOG.md
@@@ -2,9 -2,7 +2,9 @@@
## Unreleased
+- Implement extract and inject support for HTTP_HEADERS and TEXT_MAP formats.
+
- ## 0.2a.0
+ ## 0.2a0
Released 2019-10-29
diff --cc ext/opentelemetry-ext-opentracing-shim/src/opentelemetry/ext/opentracing_shim/__init__.py
index e2185b9,7271d79..dae4d84
--- a/ext/opentelemetry-ext-opentracing-shim/src/opentelemetry/ext/opentracing_shim/__init__.py
+++ b/ext/opentelemetry-ext-opentracing-shim/src/opentelemetry/ext/opentracing_shim/__init__.py
@@@ -15,8 -15,8 +15,9 @@@
import logging
import opentracing
+ from deprecated import deprecated
+from opentelemetry import propagators
from opentelemetry.ext.opentracing_shim import util
logger = logging.getLogger(__name__) |
@c24t done!, not sure why you cannot push to my branch, |
This commit implements inject() and extract() support for TEXT_MAP and HTTP_HEADERS formats by using the configured OpenTelemetry propagators. The support for binary propagators is not completed on opentelemetry-python so this commit does not include for such format.
* chore: code cleanup * fix: build
This commit implements inject() and extract() support for TEXT_MAP and
HTTP_HEADERS formats by using the configured OpenTelemetry propagators.
The support for binary propagators is not completed on opentelemetry-python
so this commit does not include for such format.
Solves: #243.