Skip to content

Commit

Permalink
auto_instrumentation -> instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cnnradams committed Jun 9, 2020
1 parent e04eb75 commit 33d9387
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-pyramid/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package_dir=
packages=find_namespace:
install_requires =
pyramid >= 1.7
opentelemetry-auto-instrumentation == 0.9.dev0
opentelemetry-instrumentation == 0.9.dev0
opentelemetry-api == 0.9.dev0
opentelemetry-ext-wsgi == 0.9.dev0
wrapt >= 1.0.0, < 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@
from wrapt import ObjectProxy
from wrapt import wrap_function_wrapper as _wrap

from opentelemetry.auto_instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.ext.pyramid.callbacks import (
SETTING_TRACE_ENABLED,
TWEEN_NAME,
trace_tween_factory,
)
from opentelemetry.ext.pyramid.version import __version__
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.instrumentation.utils import unwrap
from opentelemetry.trace import TracerProvider, get_tracer


Expand Down Expand Up @@ -113,17 +114,6 @@ def traced_init(wrapped, instance, args, kwargs):
instance.include("opentelemetry.ext.pyramid.callbacks")


def unwrap(obj, attr: str):
"""Given a function that was wrapped by wrapt.wrap_function_wrapper, unwrap it
Args:
obj: Object that holds a reference to the wrapped function
attr (str): Name of the wrapped function
"""
func = getattr(obj, attr, None)
if func and isinstance(func, ObjectProxy) and hasattr(func, "__wrapped__"):
setattr(obj, attr, func.__wrapped__)


class PyramidInstrumentor(BaseInstrumentor):
def _instrument(self, **kwargs):
"""Integrate with Pyramid Python library.
Expand Down

0 comments on commit 33d9387

Please sign in to comment.