trodo-python 2.10.7__py3-none-any.whl → 2.10.8__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.
trodo/__init__.py CHANGED
@@ -40,7 +40,7 @@ Downstream microservice (join the caller's run instead of making a new one):
40
40
 
41
41
  from __future__ import annotations
42
42
 
43
- __version__ = "2.10.7"
43
+ __version__ = "2.10.8"
44
44
 
45
45
  from typing import Any, Callable, Dict, List, Optional, Union
46
46
 
@@ -132,6 +132,7 @@ def init(
132
132
  on_error: Optional[Any] = None,
133
133
  debug: bool = False,
134
134
  auto_instrument: bool = True,
135
+ disable_instrumentations: Optional[List[str]] = None,
135
136
  otel_mode: str = "trodo",
136
137
  ) -> TrodoClient:
137
138
  """Initialise the singleton SDK instance.
@@ -140,6 +141,11 @@ def init(
140
141
  Anthropic, OpenAI, LangChain, LlamaIndex, Google Generative AI and
141
142
  any other installed opentelemetry-instrumentation-* package, so
142
143
  LLM calls emit token/cost spans with no further code.
144
+
145
+ ``disable_instrumentations`` turns OFF specific instrumentors by id
146
+ (e.g. ``['openai']`` when LangChain is your primary framework, to avoid
147
+ double-counting the same model call). Mirrors Node's
148
+ ``disableInstrumentations``.
143
149
  """
144
150
  global _client
145
151
  _client = TrodoClient(
@@ -154,6 +160,7 @@ def init(
154
160
  on_error=on_error,
155
161
  debug=debug,
156
162
  auto_instrument=auto_instrument,
163
+ disable_instrumentations=disable_instrumentations,
157
164
  otel_mode=otel_mode,
158
165
  )
159
166
  return _client
trodo/client.py CHANGED
@@ -57,6 +57,7 @@ class TrodoClient:
57
57
  on_error: Optional[Any] = None,
58
58
  debug: bool = False,
59
59
  auto_instrument: bool = True,
60
+ disable_instrumentations: Optional[List[str]] = None,
60
61
  otel_mode: str = "trodo",
61
62
  ) -> None:
62
63
  if not site_id:
@@ -100,13 +101,14 @@ class TrodoClient:
100
101
  import os
101
102
  if os.environ.get("TRODO_LEGACY_INIT") == "1":
102
103
  # Pre-2.4 escape hatch for one minor version.
103
- enable_auto_instrument(self._span_processor)
104
+ enable_auto_instrument(self._span_processor, disable=disable_instrumentations)
104
105
  else:
105
106
  _register_otel(
106
107
  site_id=site_id,
107
108
  processor=self._span_processor,
108
109
  mode=otel_mode,
109
110
  endpoint=api_base,
111
+ disable_instrumentations=disable_instrumentations,
110
112
  )
111
113
 
112
114
  def _get_span_processor(self) -> TrodoSpanProcessor:
trodo/otel/register.py CHANGED
@@ -93,7 +93,7 @@ def register_otel(
93
93
  endpoint = (endpoint or "https://sdkapi.trodo.ai").rstrip("/")
94
94
 
95
95
  if mode == "trodo":
96
- active = enable_auto_instrument(processor)
96
+ active = enable_auto_instrument(processor, disable=disable_instrumentations)
97
97
  elif mode == "otlp":
98
98
  active = _setup_otlp_mode(
99
99
  site_id=site_id,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trodo-python
3
- Version: 2.10.7
3
+ Version: 2.10.8
4
4
  Summary: Trodo Analytics SDK for Python — server-side event tracking
5
5
  License: ISC
6
6
  Keywords: analytics,tracking,trodo,server-side
@@ -1,5 +1,5 @@
1
- trodo/__init__.py,sha256=yRCFouIIerEbGEf14s1hA4Koa7RzDrytWt7H3k-EUx8,17810
2
- trodo/client.py,sha256=_T9gGu2GnAmGqA5VZSan4Hdy0DjfYOalnXpXl-_nkRg,18940
1
+ trodo/__init__.py,sha256=tfTaRW3Cmc87r_zTYy1SbztE9qbnvpp7tBo--DNMd8w,18166
2
+ trodo/client.py,sha256=dhGiOJmxdWmXDDDabHN865_cAxttJs9LWPeDwEFbAwI,19107
3
3
  trodo/types.py,sha256=eySgUvCXROG2TxtxgiU0MNr5iH0DEcduK8bmYtTKG44,3138
4
4
  trodo/user_context.py,sha256=9la6azzwEanVmdP4ps_xMoufbeWVeIGU-M8ychmgajg,7859
5
5
  trodo/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -16,7 +16,7 @@ trodo/otel/auto_instrument.py,sha256=QhSqQF6KRbSbeRuG28mzyJZleeCyDIpDRdxCKcC7eps
16
16
  trodo/otel/context.py,sha256=iJ1rE42-SbO8VZHAxhIl2ZJXgNwLIVps5xLg8GKgfFc,1165
17
17
  trodo/otel/helpers.py,sha256=4HsjMOrE-7zuvaRSiGXxV7ZyfXQ5gLxtR3HdpLut9sk,20054
18
18
  trodo/otel/processor.py,sha256=aqcTmzTw9cESgIp829pu_XCa5_dG_2MaeJNsqJZeqQU,7495
19
- trodo/otel/register.py,sha256=VE3VA8ey3SV9Ibp4TNLcPxhs62V8MQCUDpL61G1hq7s,9353
19
+ trodo/otel/register.py,sha256=bV_ePTfUvPugig2GZnylhzxi2QfoPWs96A9mGLPMrSQ,9387
20
20
  trodo/otel/transport.py,sha256=hzZz8gwSMGJ8CxdijmLn1Ljt18owr9XTWy13DLbwYbw,2441
21
21
  trodo/otel/wrap_agent.py,sha256=CWzu_yUwHYft5lvi4uY8LX3ceQvCjH8HYLbyM0xOk0s,38220
22
22
  trodo/queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -25,7 +25,7 @@ trodo/queue/event_queue.py,sha256=EVFZrhlq_kwC3jJ2GK0wMhHISf9UzLCZNDnT_aZ2I2A,87
25
25
  trodo/session/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  trodo/session/server_session.py,sha256=McsudEiq33XDq3nqxgzBcUvIjQxCMscwEuAPnYXrTjs,2136
27
27
  trodo/session/session_manager.py,sha256=JrgH1VeicmtlxPR4dXEuJbxhi23OelkgwW3-9Slv80o,2525
28
- trodo_python-2.10.7.dist-info/METADATA,sha256=UFFetsvkOCKxZkKzN-Jes2BLjYuPUuJBGnYDOPtEYzc,20483
29
- trodo_python-2.10.7.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
30
- trodo_python-2.10.7.dist-info/top_level.txt,sha256=VCQu1CJWFmNsqTs1YxMcw4Mq35Tc3z3uI9RwHEXAayQ,6
31
- trodo_python-2.10.7.dist-info/RECORD,,
28
+ trodo_python-2.10.8.dist-info/METADATA,sha256=Itp-gZCxGIWFFQo91wCT5VRdrDmtcw0C79yyKM4veIg,20483
29
+ trodo_python-2.10.8.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
30
+ trodo_python-2.10.8.dist-info/top_level.txt,sha256=VCQu1CJWFmNsqTs1YxMcw4Mq35Tc3z3uI9RwHEXAayQ,6
31
+ trodo_python-2.10.8.dist-info/RECORD,,