Skip to content

Commit 063881d

Browse files
committed
Enhance TFO-Python-SDK with OTEL Autoinstrumentation (Fixing pipeline)
1 parent cfe0bbf commit 063881d

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

src/telemetryflow/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
- Full OpenTelemetry compatibility
1313
"""
1414

15+
from typing import Any
16+
1517
from telemetryflow.builder import TelemetryFlowBuilder
1618
from telemetryflow.client import TelemetryFlowClient
1719
from telemetryflow.domain.config import Protocol, SignalType, TelemetryConfig
@@ -66,7 +68,7 @@ def new_simple(
6668

6769
def auto_instrument(
6870
client: TelemetryFlowClient | None = None,
69-
**kwargs: object,
71+
**kwargs: Any,
7072
) -> dict[str, bool]:
7173
"""Auto-instrument all available libraries.
7274

src/telemetryflow/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ def start_span(
335335
kind=kind,
336336
attributes=attributes or {},
337337
)
338-
return self._handler.handle(command)
338+
result: str = self._handler.handle(command)
339+
return result
339340

340341
def end_span(
341342
self,

src/telemetryflow/infrastructure/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def handle(self, command: Command) -> Any:
116116
if handler is None:
117117
raise ValueError(f"Unknown command type: {type(command).__name__}")
118118

119-
return handler(command)
119+
return handler(command) # type: ignore[operator]
120120

121121
def _handle_initialize(self, command: InitializeSDKCommand) -> None:
122122
"""Initialize the SDK with the given configuration."""

src/telemetryflow/middleware/fastapi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
from telemetryflow.middleware.base import TelemetryMiddleware
99

1010
if TYPE_CHECKING:
11-
from starlette.types import ASGIApp, Message, Receive, Scope, Send
11+
from starlette.types import ( # type: ignore[import-not-found]
12+
ASGIApp,
13+
Message,
14+
Receive,
15+
Scope,
16+
Send,
17+
)
1218

1319
from telemetryflow.client import TelemetryFlowClient
1420

src/telemetryflow/middleware/flask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from telemetryflow.middleware.base import TelemetryMiddleware
88

99
if TYPE_CHECKING:
10-
from flask import Flask, Response
10+
from flask import Flask, Response # type: ignore[import-not-found]
1111

1212
from telemetryflow.client import TelemetryFlowClient
1313

0 commit comments

Comments
 (0)