Skip to content

Commit

Permalink
Move opentracing-shim folder out of instrumentation folder (#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzchen authored Jan 19, 2021
1 parent 89fb4e5 commit 2fb7dba
Show file tree
Hide file tree
Showing 60 changed files with 31 additions and 35 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1516](https://github.com/open-telemetry/opentelemetry-python/pull/1516))
- `opentelemetry-exporter-zipkin` Update boolean attribute value transformation
([#1509](https://github.com/open-telemetry/opentelemetry-python/pull/1509))
- Move opentelemetry-opentracing-shim out of instrumentation folder
([#1533](https://github.com/open-telemetry/opentelemetry-python/pull/1533))
- `opentelemetry-sdk` The JaegerPropagator has been moved into its own package: `opentelemetry-propagator-jaeger`
([#1525](https://github.com/open-telemetry/opentelemetry-python/pull/1525))

Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
if isdir(join(exp, f))
]

instr = "../instrumentation"
instr_dirs = [
os.path.abspath("/".join(["../instrumentation", f, "src"]))
for f in listdir(instr)
if isdir(join(instr, f))
shim = "../shim"
shim_dirs = [
os.path.abspath("/".join(["../shim", f, "src"]))
for f in listdir(shim)
if isdir(join(shim, f))
]

sys.path[:0] = source_dirs + exp_dirs + instr_dirs
sys.path[:0] = source_dirs + exp_dirs + shim_dirs

# -- Project information -----------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/opentracing/README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
OpenTracing Shim Example
==========================

This example shows how to use the :doc:`opentelemetry-instrumentation-opentracing-shim
package <../../instrumentation/opentracing_shim/opentracing_shim>`
This example shows how to use the :doc:`opentelemetry-opentracing-shim
package <../../shim/opentracing_shim/opentracing_shim>`
to interact with libraries instrumented with
`opentracing-python <https://github.com/opentracing/opentracing-python>`_.

Expand Down Expand Up @@ -100,6 +100,6 @@ Useful links
------------

- OpenTelemetry_
- :doc:`../../instrumentation/opentracing_shim/opentracing_shim`
- :doc:`../../shim/opentracing_shim/opentracing_shim`

.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/
2 changes: 1 addition & 1 deletion docs/examples/opentracing/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from opentelemetry import trace
from opentelemetry.exporter.jaeger import JaegerSpanExporter
from opentelemetry.instrumentation import opentracing_shim
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor
from opentelemetry.shim import opentracing_shim

# Configure the tracer using the default implementation
trace.set_tracer_provider(TracerProvider())
Expand Down
7 changes: 3 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ install <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>

api/api
sdk/sdk
instrumentation/instrumentation

.. toctree::
:maxdepth: 2
Expand All @@ -85,11 +84,11 @@ install <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>

.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Instrumentations
:name: Instrumentations
:caption: OpenTelemetry Shims
:name: Shims
:glob:

instrumentation/**
shim/**

.. toctree::
:maxdepth: 1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OpenTracing Shim for OpenTelemetry
==================================

.. automodule:: opentelemetry.instrumentation.opentracing_shim
.. automodule:: opentelemetry.shim.opentracing_shim
:no-show-inheritance:
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Installation
References
----------

* `OpenTracing Shim for OpenTelemetry <https://opentelemetry-python.readthedocs.io/en/latest/instrumentation/opentracing_shim/opentracing_shim.html>`_
* `OpenTracing Shim for OpenTelemetry <https://opentelemetry-python.readthedocs.io/en/latest/shim/opentracing_shim/opentracing_shim.html>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@

BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR,
"src",
"opentelemetry",
"instrumentation",
"opentracing_shim",
"version.py",
BASE_DIR, "src", "opentelemetry", "shim", "opentracing_shim", "version.py",
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.instrumentation.opentracing_shim import create_tracer
from opentelemetry.shim.opentracing_shim import create_tracer
# Define which OpenTelemetry Tracer provider implementation to use.
trace.set_tracer_provider(TracerProvider())
Expand Down Expand Up @@ -102,8 +102,8 @@
from opentelemetry import propagators
from opentelemetry.baggage import get_baggage, set_baggage
from opentelemetry.context import Context, attach, detach, get_value, set_value
from opentelemetry.instrumentation.opentracing_shim import util
from opentelemetry.instrumentation.opentracing_shim.version import __version__
from opentelemetry.shim.opentracing_shim import util
from opentelemetry.shim.opentracing_shim.version import __version__
from opentelemetry.trace import INVALID_SPAN_CONTEXT, DefaultSpan, Link
from opentelemetry.trace import SpanContext as OtelSpanContext
from opentelemetry.trace import Tracer as OtelTracer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import opentracing

from opentelemetry import propagators, trace
from opentelemetry.instrumentation.opentracing_shim import (
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.shim.opentracing_shim import (
SpanContextShim,
SpanShim,
create_tracer,
util,
)
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.test.mock_textmap import (
MockTextMapPropagator,
NOOPTextMapPropagator,
Expand Down Expand Up @@ -137,7 +137,7 @@ def test_explicit_start_time(self):
with self.shim.start_active_span("TestSpan4", start_time=now) as scope:
result = util.time_seconds_from_ns(scope.span.unwrap().start_time)
# Tolerate inaccuracies of less than a microsecond. See Note:
# https://open-telemetry.github.io/opentelemetry-python/opentelemetry.instrumentation.opentracing_shim.html
# https://open-telemetry.github.io/opentelemetry-python/opentelemetry.shim.opentracing_shim.html
# TODO: This seems to work consistently, but we should find out the
# biggest possible loss of precision.
self.assertAlmostEqual(result, now, places=6)
Expand All @@ -151,7 +151,7 @@ def test_explicit_end_time(self):

end_time = util.time_seconds_from_ns(span.unwrap().end_time)
# Tolerate inaccuracies of less than a microsecond. See Note:
# https://open-telemetry.github.io/opentelemetry-python/opentelemetry.instrumentation.opentracing_shim.html
# https://open-telemetry.github.io/opentelemetry-python/opentelemetry.shim.opentracing_shim.html
# TODO: This seems to work consistently, but we should find out the
# biggest possible loss of precision.
self.assertAlmostEqual(end_time, now, places=6)
Expand Down Expand Up @@ -431,7 +431,7 @@ def test_log_kv(self):
)
self.assertEqual(span.unwrap().events[1].attributes["foo"], "bar")
# Tolerate inaccuracies of less than a microsecond. See Note:
# https://open-telemetry.github.io/opentelemetry-python/instrumentation/opentracing_shim/opentracing_shim.html
# https://open-telemetry.github.io/opentelemetry-python/shim/opentracing_shim/opentracing_shim.html
# TODO: This seems to work consistently, but we should find out the
# biggest possible loss of precision.
self.assertAlmostEqual(result, now, places=6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import time
import unittest

from opentelemetry.instrumentation.opentracing_shim import util
from opentelemetry.shim.opentracing_shim import util
from opentelemetry.util import time_ns


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import opentelemetry.instrumentation.opentracing_shim as opentracingshim
import opentelemetry.shim.opentracing_shim as opentracingshim
from opentelemetry.sdk import trace
from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ changedir =
test-core-proto: opentelemetry-proto/tests
test-core-instrumentation: opentelemetry-instrumentation/tests
test-core-getting-started: docs/getting_started/tests
test-core-opentracing-shim: instrumentation/opentelemetry-instrumentation-opentracing-shim/tests
test-core-opentracing-shim: shim/opentelemetry-opentracing-shim/tests

test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests
test-exporter-opencensus: exporter/opentelemetry-exporter-opencensus/tests
Expand Down Expand Up @@ -111,7 +111,7 @@ commands_pre =
exporter-jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger

opentracing-shim: pip install {toxinidir}/opentelemetry-sdk
opentracing-shim: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-opentracing-shim
opentracing-shim: pip install {toxinidir}/shim/opentelemetry-opentracing-shim

zipkin: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin

Expand Down Expand Up @@ -159,7 +159,7 @@ commands_pre =
python -m pip install -e {toxinidir}/opentelemetry-sdk[test]
python -m pip install -e {toxinidir}/opentelemetry-proto[test]
python -m pip install -e {toxinidir}/tests/util[test]
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-opentracing-shim[test]
python -m pip install -e {toxinidir}/shim/opentelemetry-opentracing-shim[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-jaeger[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-opencensus[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp[test]
Expand Down

0 comments on commit 2fb7dba

Please sign in to comment.