Skip to content

Commit 7658011

Browse files
User guide
1 parent 6bdee89 commit 7658011

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

src/sap_cloud_sdk/core/telemetry/user-guide.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -380,31 +380,6 @@ auto_instrument(middlewares=[StarletteIASTelemetryMiddleware(app=app)])
380380

381381
---
382382

383-
## Multi-tenancy
384-
385-
`sap.tenancy.tenant_id` and `user.id` are automatically propagated to all three OTel signal types — traces, metrics, and logs — when a request context is active. No manual attribute setting is required.
386-
387-
**For apps using `bootstrap()`** (recommended):
388-
389-
`IASContextProvider` extracts the tenant and user from the `Authorization: Bearer` header and populates the runtime context. The SDK reads from this context automatically.
390-
391-
**For Starlette/FastAPI apps using `StarletteIASTelemetryMiddleware`:**
392-
393-
The middleware parses the IAS JWT on each request and makes the identity available as a fallback when the runtime context is not populated.
394-
395-
**For other frameworks:**
396-
397-
Call `set_tenant_id()` manually at the request boundary. Note: this only affects SDK-recorded metrics and spans that explicitly read it — use `bootstrap()` or a middleware for full coverage across all signal types.
398-
399-
```python
400-
from sap_cloud_sdk.core.telemetry import set_tenant_id
401-
402-
def handle_request(request):
403-
set_tenant_id(extract_tenant_from_jwt(request))
404-
```
405-
406-
Identity attributes are omitted on signals emitted outside a request context (e.g. at startup) — no empty-string values are injected.
407-
408383
## Configuration
409384

410385
### Production

0 commit comments

Comments
 (0)