openlit 1.22.2__py3-none-any.whl → 1.22.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
openlit/__init__.py CHANGED
@@ -130,6 +130,13 @@ class OpenlitConfig:
130
130
  cls.trace_content = trace_content
131
131
  cls.disable_metrics = disable_metrics
132
132
 
133
+ def module_exists(module_name):
134
+ """Check if nested modules exist, addressing the dot notation issue."""
135
+ parts = module_name.split(".")
136
+ for i in range(1, len(parts) + 1):
137
+ if find_spec(".".join(parts[:i])) is None:
138
+ return False
139
+ return True
133
140
 
134
141
  def instrument_if_available(
135
142
  instrumentor_name,
@@ -150,7 +157,7 @@ def instrument_if_available(
150
157
  return
151
158
 
152
159
  try:
153
- if find_spec(module_name) is not None:
160
+ if module_exists(module_name):
154
161
  instrumentor_instance.instrument(
155
162
  environment=config.environment,
156
163
  application_name=config.application_name,
@@ -167,6 +174,7 @@ def instrument_if_available(
167
174
  except Exception as e:
168
175
  logger.error("Failed to instrument %s: %s", instrumentor_name, e)
169
176
 
177
+
170
178
  def init(environment="default", application_name="default", tracer=None, otlp_endpoint=None,
171
179
  otlp_headers=None, disable_batch=False, trace_content=True, disabled_instrumentors=None,
172
180
  meter=None, disable_metrics=False, pricing_json=None, collect_gpu_stats=False):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openlit
3
- Version: 1.22.2
3
+ Version: 1.22.3
4
4
  Summary: OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects
5
5
  Home-page: https://github.com/openlit/openlit/tree/main/openlit/python
6
6
  Keywords: OpenTelemetry,otel,otlp,llm,tracing,openai,anthropic,claude,cohere,llm monitoring,observability,monitoring,gpt,Generative AI,chatGPT,gpu
@@ -1,5 +1,5 @@
1
1
  openlit/__helpers.py,sha256=lrn4PBs9owDudiCY2NBoVbAi7AU_HtUpyOj0oqPBsPY,5545
2
- openlit/__init__.py,sha256=NvlRqmf_mHcUNTHDI-Tv211x4BlDGLnU2vv8KTaGOxc,15782
2
+ openlit/__init__.py,sha256=iuYE-acp7ScvxzA9P3f8obfOLLLrNMYkLbyKRz8Liec,16049
3
3
  openlit/instrumentation/anthropic/__init__.py,sha256=oaU53BOPyfUKbEzYvLr1DPymDluurSnwo4Hernf2XdU,1955
4
4
  openlit/instrumentation/anthropic/anthropic.py,sha256=y7CEGhKOGHWt8G_5Phr4qPJTfPGRJIAr9Yk6nM3CcvM,16775
5
5
  openlit/instrumentation/anthropic/async_anthropic.py,sha256=Zz1KRKIG9wGn0quOoLvjORC-49IvHQpJ6GBdB-4PfCQ,16816
@@ -59,7 +59,7 @@ openlit/instrumentation/vllm/vllm.py,sha256=lDzM7F5pgxvh8nKL0dcKB4TD0Mc9wXOWeXOs
59
59
  openlit/otel/metrics.py,sha256=O7NoaDz0bY19mqpE4-0PcKwEe-B-iJFRgOCaanAuZAc,4291
60
60
  openlit/otel/tracing.py,sha256=vL1ifMbARPBpqK--yXYsCM6y5dSu5LFIKqkhZXtYmUc,3712
61
61
  openlit/semcov/__init__.py,sha256=wpAarrnkndbgvP8VSudi8IRInYtD02hkewqjyiC0dMk,7614
62
- openlit-1.22.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
- openlit-1.22.2.dist-info/METADATA,sha256=yD1-PRHWYtdY6KsSX_ulQvL83tqbpBhZVkgQqm8J2vk,15710
64
- openlit-1.22.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
- openlit-1.22.2.dist-info/RECORD,,
62
+ openlit-1.22.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
+ openlit-1.22.3.dist-info/METADATA,sha256=0F7-sbMG7ctUtCaCNZsxsjUzSZJeqnfgXjzFc7D8Ico,15710
64
+ openlit-1.22.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
+ openlit-1.22.3.dist-info/RECORD,,