Skip to content

Commit 432a887

Browse files
authored
[chore] Relocate dashscope instrumentation and fix genai util (#90)
2 parents 8737f91 + 232f4d4 commit 432a887

File tree

17 files changed

+54
-13
lines changed

17 files changed

+54
-13
lines changed

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Usage
2525
from opentelemetry.sdk.trace import TracerProvider
2626
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
2727
28-
from loongsuite.instrumentation.dashscope import DashScopeInstrumentor
28+
from opentelemetry.instrumentation.dashscope import DashScopeInstrumentor
2929
3030
# Initialize tracing
3131
trace.set_tracer_provider(TracerProvider())

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/examples/basic_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
import os
1414

1515
from dashscope import Generation, TextEmbedding
16-
from loongsuite.instrumentation.dashscope import DashScopeInstrumentor
1716

1817
from opentelemetry import trace
18+
from opentelemetry.instrumentation.dashscope import DashScopeInstrumentor
1919
from opentelemetry.sdk.trace import TracerProvider
2020
from opentelemetry.sdk.trace.export import (
2121
ConsoleSpanExporter,

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ instruments = [
3737
]
3838

3939
[project.entry-points.opentelemetry_instrumentor]
40-
dashscope = "loongsuite.instrumentation.dashscope:DashScopeInstrumentor"
40+
dashscope = "opentelemetry.instrumentation.dashscope:DashScopeInstrumentor"
4141

4242
[project.urls]
4343
Homepage = "https://github.com/alibaba/loongsuite-python-agent"
4444

4545
[tool.hatch.version]
46-
path = "src/loongsuite/instrumentation/dashscope/version.py"
46+
path = "src/opentelemetry/instrumentation/dashscope/version.py"
4747

4848
[tool.hatch.build.targets.sdist]
4949
include = [
@@ -52,5 +52,5 @@ include = [
5252
]
5353

5454
[tool.hatch.build.targets.wheel]
55-
packages = ["src/loongsuite"]
55+
packages = ["src/opentelemetry"]
5656

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/loongsuite/__init__.py renamed to instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/__init__.py

File renamed without changes.

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/loongsuite/instrumentation/__init__.py renamed to instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/__init__.py

File renamed without changes.

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/loongsuite/instrumentation/dashscope/__init__.py renamed to instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
completion functionality.
3131
3232
Usage:
33-
from loongsuite.instrumentation.dashscope import DashScopeInstrumentor
33+
from opentelemetry.instrumentation.dashscope import DashScopeInstrumentor
3434
3535
DashScopeInstrumentor().instrument()
3636
@@ -42,8 +42,10 @@
4242
import logging
4343
from typing import Collection
4444

45-
from loongsuite.instrumentation.dashscope.package import _instruments
46-
from loongsuite.instrumentation.dashscope.patch import (
45+
from wrapt import wrap_function_wrapper
46+
47+
from opentelemetry.instrumentation.dashscope.package import _instruments
48+
from opentelemetry.instrumentation.dashscope.patch import (
4749
wrap_aio_generation_call,
4850
wrap_generation_call,
4951
wrap_image_synthesis_async_call,
@@ -52,9 +54,7 @@
5254
wrap_text_embedding_call,
5355
wrap_text_rerank_call,
5456
)
55-
from loongsuite.instrumentation.dashscope.version import __version__
56-
from wrapt import wrap_function_wrapper
57-
57+
from opentelemetry.instrumentation.dashscope.version import __version__
5858
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
5959
from opentelemetry.instrumentation.utils import unwrap
6060
from opentelemetry.util.genai.extended_handler import (

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/loongsuite/instrumentation/dashscope/package.py renamed to instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/package.py

File renamed without changes.

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/loongsuite/instrumentation/dashscope/patch.py renamed to instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/patch.py

File renamed without changes.

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/loongsuite/instrumentation/dashscope/utils.py renamed to instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/utils.py

File renamed without changes.

instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/loongsuite/instrumentation/dashscope/version.py renamed to instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/version.py

File renamed without changes.

0 commit comments

Comments
 (0)