Skip to content

Commit 95110ab

Browse files
Concise class level instrumentation
1 parent b5e6ce3 commit 95110ab

11 files changed

Lines changed: 30 additions & 0 deletions

File tree

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/aiohttp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class AiohttpInstrumentor(LibraryInstrumentor):
10+
"""Instruments aiohttp client sessions with OTel spans and W3C header propagation."""
11+
1012
library_name = "aiohttp"
1113

1214
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/django.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class DjangoInstrumentorWrapper(LibraryInstrumentor):
10+
"""Instruments Django with OTel spans for inbound HTTP requests and baggage extraction."""
11+
1012
library_name = "django"
1113

1214
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/fastapi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88

99
class FastAPIInstrumentorWrapper(LibraryInstrumentor):
10+
"""Instruments FastAPI with OTel spans for inbound HTTP requests and baggage extraction.
11+
12+
Must be called before the FastAPI app instance is constructed, or pass the app
13+
instance via auto_instrument(app=app) from within a lifespan handler.
14+
"""
15+
1016
library_name = "fastapi"
1117

1218
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/flask.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class FlaskInstrumentorWrapper(LibraryInstrumentor):
10+
"""Instruments Flask with OTel spans for inbound HTTP requests and baggage extraction."""
11+
1012
library_name = "flask"
1113

1214
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/grpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212

1313
class GrpcInstrumentorWrapper(LibraryInstrumentor):
14+
"""Instruments gRPC client and server interceptors with OTel spans."""
15+
1416
library_name = "grpc"
1517

1618
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/httpx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class HttpxInstrumentor(LibraryInstrumentor):
10+
"""Instruments httpx sync and async clients with OTel spans and W3C header propagation."""
11+
1012
library_name = "httpx"
1113

1214
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/logging.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class LoggingInstrumentorWrapper(LibraryInstrumentor):
10+
"""Injects trace_id and span_id into every stdlib log record for log-trace correlation."""
11+
1012
library_name = "logging"
1113

1214
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/redis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class RedisInstrumentorWrapper(LibraryInstrumentor):
10+
"""Instruments the redis client with OTel spans for commands and pipeline operations."""
11+
1012
library_name = "redis"
1113

1214
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/requests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class RequestsInstrumentorWrapper(LibraryInstrumentor):
10+
"""Instruments the requests library with OTel spans and W3C header propagation."""
11+
1012
library_name = "requests"
1113

1214
def is_instrumented(self) -> bool:

src/sap_cloud_sdk/core/telemetry/instrumentation/instrumentors/sqlalchemy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class SQLAlchemyInstrumentorWrapper(LibraryInstrumentor):
10+
"""Instruments SQLAlchemy with OTel spans for database queries."""
11+
1012
library_name = "sqlalchemy"
1113

1214
def is_instrumented(self) -> bool:

0 commit comments

Comments
 (0)