Repository navigation
feat: honour OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT when RIUS_CAPTURE_CONTENT is unset - #287
PabloPardoGarcia wants to merge 2 commits into
Conversation
…TURE_CONTENT is unset NO_CONTENT and EVENT_ONLY turn content capture off (content is recorded on spans only), SPAN_ONLY and SPAN_AND_EVENT keep it on. Read case-insensitively; an unrecognised value keeps the default (on) and warns. The explicit option and RIUS_CAPTURE_CONTENT keep precedence, and with neither variable set capture stays on.
Automated reviewNo blocking issues. Precedence is correct and tested: the I checked the upstream text in #543 ("Content capture configuration"). Two parts of it matter here:
Should fix1. An unrecognised OTEL value fails open, where upstream says fail closed (
2. An empty Nits / questions
|
…id OTel values An empty RIUS_CAPTURE_CONTENT no longer shadows OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT (it still warns, as the other blank RIUS_* flags do), and an empty OTel variable counts as unset. The warning for an unrecognised OTel value says capture stays on and lists the valid values.
|
Addressed in ca0346b:
Nits: tool-definition masking under ruff, mypy and pytest (2920 passed) are green locally. rius-sdk-typescript#252 has the same changes. |
|
Landed through #289, together with the rius-semconv v1.13.0 sync. |
The GenAI conventions now define the content-capture setting (semantic-conventions-genai #543):
OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT, withNO_CONTENT(their default),SPAN_ONLY,EVENT_ONLYandSPAN_AND_EVENT.When
RIUS_CAPTURE_CONTENTis unset, the SDK now reads that variable:NO_CONTENTEVENT_ONLYSPAN_ONLY,SPAN_AND_EVENTThe value is case-insensitive and trimmed, as the conventions define. Precedence is unchanged at the top: the
capture_contentargument, thenRIUS_CAPTURE_CONTENT, then the OpenTelemetry variable, then on. With neither variable set capture stays on (deliberately different from the upstreamNO_CONTENTdefault).An unrecognised OpenTelemetry value keeps capture on. This intentionally differs from the conventions, which say an instrumentation SHOULD fall back to
NO_CONTENT: capture is on by default in Rius, and the warning names the valid values so a typo is visible.An empty (or blank)
RIUS_CAPTURE_CONTENTcounts as unset, so the OpenTelemetry variable applies; templated deployments often render an omitted value as"". It still logs a warning ("RIUS_CAPTURE_CONTENT is empty; treated as unset"), as the other blankRIUS_*flags do and as the sharedsdk_cases/env.jsoncase expects.README configuration table and the capture section, plus the
init()/resolve_config()docstrings, document it.Tests (in
tests/test_config.py): each mode, case-insensitivity, unrecognised values (includingfalseandNO-CONTENT) warn with the new text and keep capture on, an empty OTel variable is unset with no warning, an emptyRIUS_CAPTURE_CONTENTlets the OTel setting apply,RIUS_CAPTURE_CONTENTwins, the argument wins over both.ruff check,ruff format --check,mypyandpytest(2920 passed) are green.Not changed here: tool definitions stay among the content attributes stripped under
NO_CONTENT(tracked separately), and the olderOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTis not read.Closes RIUS-1883