Skip to content

Commit

Permalink
Rename propagator
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Feb 4, 2021
1 parent fb3e16d commit 1c64838
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
OpenTelemetry OpenTracing Propagator
====================================
OpenTelemetry OTTrace Propagator
================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opentelemetry-propagator-opentracing.svg
:target: https://pypi.org/project/opentelemetry-propagator-opentracing/
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-propagator-ot-trace.svg
:target: https://pypi.org/project/opentelemetry-propagator-ot-trace/

Installation
------------

::

pip install opentelemetry-propagator-opentracing
pip install opentelemetry-propagator-ot-trace

.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/

OpenTracing Format
------------------
OTTrace Format
--------------

===================== ======================================================================================================================================= =====================
Header Name Description Required
Expand All @@ -30,7 +30,7 @@ Header Name Description
Interop and trace ids
---------------------

The OpenTracing propagation format expects trace ids to be 64-bits. In order to
The OTTrace propagation format expects trace ids to be 64-bits. In order to
interop with OpenTelemetry, trace ids need to be truncated to 64-bits before
sending them on the wire. When truncating, the least significant (right-most)
bits MUST be retained. For example, a trace id of
Expand All @@ -40,5 +40,4 @@ bits MUST be retained. For example, a trace id of
References
----------

* `OpenTracing Project <https://opentracing.io/>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# limitations under the License.
#
[metadata]
name = opentelemetry-propagator-opentracing
description = OpenTracing Propagator for OpenTelemetry
name = opentelemetry-propagator-ot-trace
description = OTTrace Propagator for OpenTelemetry
long_description = file: README.rst
long_description_content_type = text/x-rst
author = OpenTelemetry Authors
author_email = cncf-opentelemetry-contributors@lists.cncf.io
url = https://github.com/open-telemetry/opentelemetry-python-contrib/propagator/opentelemetry-propagator-opentracing
url = https://github.com/open-telemetry/opentelemetry-python-contrib/propagator/opentelemetry-propagator-ot-trace
platforms = any
license = Apache-2.0
classifiers =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "propagator", "opentracing", "version.py"
BASE_DIR, "src", "opentelemetry", "propagator", "ot-trace", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
_valid_spanid = re_compile(r"[0-9a-f]{16}")


class OpenTracingPropagator(TextMapPropagator):
"""Propagator for the OpenTracing HTTP header format"""
class OTTracePropagator(TextMapPropagator):
"""Propagator for the OTTrace HTTP header format"""

def extract(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
from unittest import TestCase

from opentelemetry.baggage import get_all, set_baggage
from opentelemetry.propagator.opentracing import (
from opentelemetry.propagator.ot_trace import (
OT_BAGGAGE_PREFIX,
OT_SAMPLED_HEADER,
OT_SPAN_ID_HEADER,
OT_TRACE_ID_HEADER,
OpenTracingPropagator,
OTTracePropagator,
)
from opentelemetry.sdk.trace import _Span
from opentelemetry.trace import (
Expand All @@ -37,15 +37,15 @@
carrier_getter = DictGetter()


class TestOpenTracingPropagator(TestCase):
class TestOTTracePropagator(TestCase):

opentracing_propagator = OpenTracingPropagator()
ot_trace_propagator = OTTracePropagator()

def carrier_inject(self, trace_id, span_id, is_remote, trace_flags):

carrier = {}

self.opentracing_propagator.inject(
self.ot_trace_propagator.inject(
dict.__setitem__,
carrier,
set_span_in_context(
Expand Down Expand Up @@ -146,7 +146,7 @@ def test_inject_set_baggage(self):

carrier = {}

self.opentracing_propagator.inject(
self.ot_trace_propagator.inject(
dict.__setitem__,
carrier,
set_baggage(
Expand Down Expand Up @@ -175,7 +175,7 @@ def test_inject_invalid_baggage_keys(self):

carrier = {}

self.opentracing_propagator.inject(
self.ot_trace_propagator.inject(
dict.__setitem__,
carrier,
set_baggage(
Expand Down Expand Up @@ -204,7 +204,7 @@ def test_inject_invalid_baggage_values(self):

carrier = {}

self.opentracing_propagator.inject(
self.ot_trace_propagator.inject(
dict.__setitem__,
carrier,
set_baggage(
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_extract_trace_id_span_id_sampled_true(self):
"""Test valid trace_id, span_id and sampled true"""

span_context = get_current_span(
self.opentracing_propagator.extract(
self.ot_trace_propagator.extract(
carrier_getter,
{
OT_TRACE_ID_HEADER: "80f198ee56343ba864fe8b2a57d3eff7",
Expand All @@ -253,7 +253,7 @@ def test_extract_trace_id_span_id_sampled_false(self):
"""Test valid trace_id, span_id and sampled false"""

span_context = get_current_span(
self.opentracing_propagator.extract(
self.ot_trace_propagator.extract(
carrier_getter,
{
OT_TRACE_ID_HEADER: "80f198ee56343ba864fe8b2a57d3eff7",
Expand All @@ -274,7 +274,7 @@ def test_extract_malformed_trace_id(self):
"""Test extraction with malformed trace_id"""

span_context = get_current_span(
self.opentracing_propagator.extract(
self.ot_trace_propagator.extract(
carrier_getter,
{
OT_TRACE_ID_HEADER: "abc123",
Expand All @@ -290,7 +290,7 @@ def test_extract_malformed_span_id(self):
"""Test extraction with malformed span_id"""

span_context = get_current_span(
self.opentracing_propagator.extract(
self.ot_trace_propagator.extract(
carrier_getter,
{
OT_TRACE_ID_HEADER: "64fe8b2a57d3eff7",
Expand All @@ -306,7 +306,7 @@ def test_extract_invalid_trace_id(self):
"""Test extraction with invalid trace_id"""

span_context = get_current_span(
self.opentracing_propagator.extract(
self.ot_trace_propagator.extract(
carrier_getter,
{
OT_TRACE_ID_HEADER: INVALID_TRACE_ID,
Expand All @@ -322,7 +322,7 @@ def test_extract_invalid_span_id(self):
"""Test extraction with invalid span_id"""

span_context = get_current_span(
self.opentracing_propagator.extract(
self.ot_trace_propagator.extract(
carrier_getter,
{
OT_TRACE_ID_HEADER: "64fe8b2a57d3eff7",
Expand All @@ -337,7 +337,7 @@ def test_extract_invalid_span_id(self):
def test_extract_baggage(self):
"""Test baggage extraction"""

context = self.opentracing_propagator.extract(
context = self.ot_trace_propagator.extract(
carrier_getter,
{
OT_TRACE_ID_HEADER: "64fe8b2a57d3eff7",
Expand Down

0 comments on commit 1c64838

Please sign in to comment.