ioa-observe-sdk 1.0.10__py3-none-any.whl → 1.0.11__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.
@@ -43,7 +43,6 @@ from ioa_observe.sdk.utils.const import (
43
43
  from ioa_observe.sdk.utils.json_encoder import JSONEncoder
44
44
  from ioa_observe.sdk.metrics.agent import topology_dynamism, determinism_score
45
45
 
46
-
47
46
  P = ParamSpec("P")
48
47
 
49
48
  R = TypeVar("R")
@@ -554,30 +553,53 @@ def entity_class(
554
553
  # Specific method specified - existing behavior
555
554
  methods_to_wrap = [method_name]
556
555
  else:
557
- # No method specified - wrap all public methods
556
+ # No method specified - wrap all public methods defined in this class
558
557
  for attr_name in dir(cls):
559
558
  if (
560
559
  not attr_name.startswith("_") # Skip private/built-in methods
561
560
  and attr_name != "mro" # Skip class method
562
561
  and hasattr(cls, attr_name)
563
- and callable(getattr(cls, attr_name))
564
- and not isinstance(
565
- getattr(cls, attr_name), (classmethod, staticmethod, property)
566
- )
567
562
  ):
568
- methods_to_wrap.append(attr_name)
563
+ attr = getattr(cls, attr_name)
564
+ # Only wrap functions defined in this class (not inherited methods or built-ins)
565
+ if (
566
+ inspect.isfunction(attr) # Functions defined in the class
567
+ and not isinstance(attr, (classmethod, staticmethod, property))
568
+ and hasattr(attr, "__qualname__") # Has qualname attribute
569
+ and attr.__qualname__.startswith(
570
+ cls.__name__ + "."
571
+ ) # Defined in this class
572
+ ):
573
+ # Additional check: ensure the function has a proper signature with 'self' parameter
574
+ try:
575
+ sig = inspect.signature(attr)
576
+ params = list(sig.parameters.keys())
577
+ if params and params[0] == "self":
578
+ methods_to_wrap.append(attr_name)
579
+ except (ValueError, TypeError):
580
+ # Skip methods that can't be inspected
581
+ continue
569
582
 
570
583
  # Wrap all detected methods
571
584
  for method_to_wrap in methods_to_wrap:
572
585
  if hasattr(cls, method_to_wrap):
573
- method = getattr(cls, method_to_wrap)
574
- wrapped_method = entity_method(
575
- name=f"{task_name}.{method_to_wrap}",
576
- description=description,
577
- version=version,
578
- tlp_span_kind=tlp_span_kind,
579
- )(method)
580
- setattr(cls, method_to_wrap, wrapped_method)
586
+ original_method = getattr(cls, method_to_wrap)
587
+ # Only wrap actual functions defined in this class
588
+ if inspect.isfunction(original_method):
589
+ try:
590
+ # Verify the method has a proper signature
591
+ sig = inspect.signature(original_method)
592
+ wrapped_method = entity_method(
593
+ name=f"{task_name}.{method_to_wrap}",
594
+ description=description,
595
+ version=version,
596
+ tlp_span_kind=tlp_span_kind,
597
+ )(original_method)
598
+ # Set the wrapped method on the class
599
+ setattr(cls, method_to_wrap, wrapped_method)
600
+ except Exception:
601
+ # Don't wrap methods that can't be properly decorated
602
+ continue
581
603
 
582
604
  return cls
583
605
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ioa-observe-sdk
3
- Version: 1.0.10
3
+ Version: 1.0.11
4
4
  Summary: IOA Observability SDK
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -44,6 +44,7 @@ Requires-Dist: opentelemetry-instrumentation-logging==0.54b1
44
44
  Requires-Dist: opentelemetry-instrumentation-openai==0.40.8
45
45
  Requires-Dist: opentelemetry-instrumentation-llamaindex==0.40.8
46
46
  Requires-Dist: opentelemetry-instrumentation-ollama==0.40.8
47
+ Requires-Dist: opentelemetry-instrumentation-anthropic==0.40.8
47
48
  Requires-Dist: opentelemetry-instrumentation-langchain==0.40.8
48
49
  Requires-Dist: opentelemetry-instrumentation-threading==00.54b1
49
50
  Requires-Dist: opentelemetry-instrumentation-urllib3==0.54b1
@@ -10,7 +10,7 @@ ioa_observe/sdk/config/__init__.py,sha256=8aVNaw0yRNLFPxlf97iOZLlJVcV81ivSDnudH2
10
10
  ioa_observe/sdk/connectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  ioa_observe/sdk/connectors/slim.py,sha256=NwbKEV7d5NIOqmG8zKqtgGigSJl7kf3QJ65z2gxpsY8,8498
12
12
  ioa_observe/sdk/decorators/__init__.py,sha256=Lv5EbouBazvWaYB0N82v26pqKtj2FAqlwfLKEh5e8Q0,3251
13
- ioa_observe/sdk/decorators/base.py,sha256=vZuF9bsaMhH0BAJjPvmPA-cvdgaXucRuSvGHhvc_8tc,28483
13
+ ioa_observe/sdk/decorators/base.py,sha256=kR_0KWMMbOdJ_t9m5EZ9ZUj3pmKWEgkj0-E1F3c-nIE,29969
14
14
  ioa_observe/sdk/decorators/util.py,sha256=WMkzmwD7Js0g1BbId9_qR4pwhnaIJdW588zVc5dpqdQ,25399
15
15
  ioa_observe/sdk/instrumentations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  ioa_observe/sdk/instrumentations/a2a.py,sha256=ov_9ckkymf_qFXG0iXVWfxlW-3kFcP-knrM_t-Cf72w,4414
@@ -38,8 +38,8 @@ ioa_observe/sdk/utils/const.py,sha256=GwbHakKPjBL4wLqAVkDrSoKB-8p18EUrbaqPuRuV_x
38
38
  ioa_observe/sdk/utils/in_memory_span_exporter.py,sha256=H_4TRaThMO1H6vUQ0OpQvzJk_fZH0OOsRAM1iZQXsR8,2112
39
39
  ioa_observe/sdk/utils/json_encoder.py,sha256=g4NQ0tTqgWssY6I1D7r4zo0G6PiUo61jhofTAw5-jno,639
40
40
  ioa_observe/sdk/utils/package_check.py,sha256=1d1MjxhwoEZIx9dumirT2pRsEWgn-m-SI4npDeEalew,576
41
- ioa_observe_sdk-1.0.10.dist-info/licenses/LICENSE.md,sha256=55VjUfgjWOS4vv3Cf55gfq-RxjPgRIO2vlgYPUuC5lA,11362
42
- ioa_observe_sdk-1.0.10.dist-info/METADATA,sha256=eNDXQNsig6-m56PqwvFuYH6XUtYG8konoqFk2UUHW9w,7747
43
- ioa_observe_sdk-1.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
44
- ioa_observe_sdk-1.0.10.dist-info/top_level.txt,sha256=Yt-6Y1olZEDqCs2REeqI30WjYx0pLGQSVqzYmDd67N8,12
45
- ioa_observe_sdk-1.0.10.dist-info/RECORD,,
41
+ ioa_observe_sdk-1.0.11.dist-info/licenses/LICENSE.md,sha256=55VjUfgjWOS4vv3Cf55gfq-RxjPgRIO2vlgYPUuC5lA,11362
42
+ ioa_observe_sdk-1.0.11.dist-info/METADATA,sha256=5YMHTWQw2c6VwUQG4K-15klct9thZBw6cJ0rO_Hs2zg,7810
43
+ ioa_observe_sdk-1.0.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
44
+ ioa_observe_sdk-1.0.11.dist-info/top_level.txt,sha256=Yt-6Y1olZEDqCs2REeqI30WjYx0pLGQSVqzYmDd67N8,12
45
+ ioa_observe_sdk-1.0.11.dist-info/RECORD,,