Skip to content

Commit 33d9387

Browse files
committed
auto_instrumentation -> instrumentation
1 parent e04eb75 commit 33d9387

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

ext/opentelemetry-ext-pyramid/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ package_dir=
4141
packages=find_namespace:
4242
install_requires =
4343
pyramid >= 1.7
44-
opentelemetry-auto-instrumentation == 0.9.dev0
44+
opentelemetry-instrumentation == 0.9.dev0
4545
opentelemetry-api == 0.9.dev0
4646
opentelemetry-ext-wsgi == 0.9.dev0
4747
wrapt >= 1.0.0, < 2.0.0

ext/opentelemetry-ext-pyramid/src/opentelemetry/ext/pyramid/__init__.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@
7676
from wrapt import ObjectProxy
7777
from wrapt import wrap_function_wrapper as _wrap
7878

79-
from opentelemetry.auto_instrumentation.instrumentor import BaseInstrumentor
8079
from opentelemetry.ext.pyramid.callbacks import (
8180
SETTING_TRACE_ENABLED,
8281
TWEEN_NAME,
8382
trace_tween_factory,
8483
)
8584
from opentelemetry.ext.pyramid.version import __version__
85+
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
86+
from opentelemetry.instrumentation.utils import unwrap
8687
from opentelemetry.trace import TracerProvider, get_tracer
8788

8889

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

115116

116-
def unwrap(obj, attr: str):
117-
"""Given a function that was wrapped by wrapt.wrap_function_wrapper, unwrap it
118-
Args:
119-
obj: Object that holds a reference to the wrapped function
120-
attr (str): Name of the wrapped function
121-
"""
122-
func = getattr(obj, attr, None)
123-
if func and isinstance(func, ObjectProxy) and hasattr(func, "__wrapped__"):
124-
setattr(obj, attr, func.__wrapped__)
125-
126-
127117
class PyramidInstrumentor(BaseInstrumentor):
128118
def _instrument(self, **kwargs):
129119
"""Integrate with Pyramid Python library.

0 commit comments

Comments
 (0)