|
14 | 14 | limitations under the License. |
15 | 15 | """ |
16 | 16 |
|
| 17 | +import logging |
17 | 18 | import os |
18 | 19 | import sys |
| 20 | +from typing import Any, Dict, Optional |
| 21 | + |
19 | 22 | import sentry_sdk |
20 | | -import logging |
21 | | -from typing import Dict, Optional, Any |
22 | 23 | from colorama import Fore |
23 | | -from langtrace_python_sdk.constants import LANGTRACE_SDK_NAME, SENTRY_DSN |
24 | 24 | from opentelemetry import trace |
| 25 | +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ |
| 26 | + OTLPSpanExporter as GRPCExporter |
| 27 | +from opentelemetry.exporter.otlp.proto.http.trace_exporter import \ |
| 28 | + OTLPSpanExporter as HTTPExporter |
25 | 29 | from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor |
26 | 30 | from opentelemetry.sdk.resources import SERVICE_NAME, Resource |
27 | 31 | from opentelemetry.sdk.trace import TracerProvider |
28 | | -from opentelemetry.sdk.trace.export import ( |
29 | | - BatchSpanProcessor, |
30 | | - ConsoleSpanExporter, |
31 | | - SimpleSpanProcessor, |
32 | | -) |
33 | | - |
34 | | -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import ( |
35 | | - OTLPSpanExporter as GRPCExporter, |
36 | | -) |
37 | | -from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( |
38 | | - OTLPSpanExporter as HTTPExporter, |
39 | | -) |
40 | | -from langtrace_python_sdk.constants.exporter.langtrace_exporter import ( |
41 | | - LANGTRACE_REMOTE_URL, |
42 | | - LANGTRACE_SESSION_ID_HEADER, |
43 | | -) |
44 | | -from langtrace_python_sdk.instrumentation import ( |
45 | | - AnthropicInstrumentation, |
46 | | - ChromaInstrumentation, |
47 | | - CohereInstrumentation, |
48 | | - CrewAIInstrumentation, |
49 | | - DspyInstrumentation, |
50 | | - EmbedchainInstrumentation, |
51 | | - GeminiInstrumentation, |
52 | | - GroqInstrumentation, |
53 | | - LangchainCommunityInstrumentation, |
54 | | - LangchainCoreInstrumentation, |
55 | | - LangchainInstrumentation, |
56 | | - LanggraphInstrumentation, |
57 | | - LiteLLMInstrumentation, |
58 | | - LlamaindexInstrumentation, |
59 | | - MistralInstrumentation, |
60 | | - AWSBedrockInstrumentation, |
61 | | - OllamaInstrumentor, |
62 | | - OpenAIInstrumentation, |
63 | | - PineconeInstrumentation, |
64 | | - QdrantInstrumentation, |
65 | | - AutogenInstrumentation, |
66 | | - VertexAIInstrumentation, |
67 | | - WeaviateInstrumentation, |
68 | | - PyMongoInstrumentation, |
69 | | - CerebrasInstrumentation, |
70 | | - MilvusInstrumentation, |
71 | | - GoogleGenaiInstrumentation, |
72 | | -) |
| 32 | +from opentelemetry.sdk.trace.export import (BatchSpanProcessor, |
| 33 | + ConsoleSpanExporter, |
| 34 | + SimpleSpanProcessor) |
73 | 35 | from opentelemetry.util.re import parse_env_headers |
| 36 | +from sentry_sdk.types import Event, Hint |
74 | 37 |
|
75 | | -from langtrace_python_sdk.types import DisableInstrumentations, InstrumentationMethods |
76 | | -from langtrace_python_sdk.utils import ( |
77 | | - check_if_sdk_is_outdated, |
78 | | - get_sdk_version, |
79 | | - is_package_installed, |
80 | | - validate_instrumentations, |
81 | | -) |
| 38 | +from langtrace_python_sdk.constants import LANGTRACE_SDK_NAME, SENTRY_DSN |
| 39 | +from langtrace_python_sdk.constants.exporter.langtrace_exporter import ( |
| 40 | + LANGTRACE_REMOTE_URL, LANGTRACE_SESSION_ID_HEADER) |
| 41 | +from langtrace_python_sdk.extensions.langtrace_exporter import \ |
| 42 | + LangTraceExporter |
| 43 | +from langtrace_python_sdk.instrumentation import ( |
| 44 | + AnthropicInstrumentation, AutogenInstrumentation, |
| 45 | + AWSBedrockInstrumentation, CerebrasInstrumentation, ChromaInstrumentation, |
| 46 | + CohereInstrumentation, CrewAIInstrumentation, CrewaiToolsInstrumentation, |
| 47 | + DspyInstrumentation, EmbedchainInstrumentation, GeminiInstrumentation, |
| 48 | + GoogleGenaiInstrumentation, GroqInstrumentation, |
| 49 | + LangchainCommunityInstrumentation, LangchainCoreInstrumentation, |
| 50 | + LangchainInstrumentation, LanggraphInstrumentation, LiteLLMInstrumentation, |
| 51 | + LlamaindexInstrumentation, MilvusInstrumentation, MistralInstrumentation, |
| 52 | + OllamaInstrumentor, OpenAIInstrumentation, PineconeInstrumentation, |
| 53 | + PyMongoInstrumentation, QdrantInstrumentation, VertexAIInstrumentation, |
| 54 | + WeaviateInstrumentation) |
| 55 | +from langtrace_python_sdk.types import (DisableInstrumentations, |
| 56 | + InstrumentationMethods) |
| 57 | +from langtrace_python_sdk.utils import (check_if_sdk_is_outdated, |
| 58 | + get_sdk_version, is_package_installed, |
| 59 | + validate_instrumentations) |
82 | 60 | from langtrace_python_sdk.utils.langtrace_sampler import LangtraceSampler |
83 | | -from langtrace_python_sdk.extensions.langtrace_exporter import LangTraceExporter |
84 | | -from sentry_sdk.types import Event, Hint |
85 | 61 |
|
86 | 62 |
|
87 | 63 | class LangtraceConfig: |
@@ -309,6 +285,7 @@ def init( |
309 | 285 | "pymongo": PyMongoInstrumentation(), |
310 | 286 | "cerebras-cloud-sdk": CerebrasInstrumentation(), |
311 | 287 | "pymilvus": MilvusInstrumentation(), |
| 288 | + "crewai-tools": CrewaiToolsInstrumentation(), |
312 | 289 | } |
313 | 290 |
|
314 | 291 | init_instrumentations(config.disable_instrumentations, all_instrumentations) |
|
0 commit comments