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.
Could we have the error as a separated test case? ;)
There was a problem hiding this comment.
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.
I'm assuming it's not so trivial to verify against the actual builtin format(s)?
There was a problem hiding this comment.
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.
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.
|
|
@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.