Repository navigation
feat(python): trace IBM watsonx.ai and Writer, zero-code - #728
Merged
Merged
Conversation
…, error and hidden-content tracing
…ro-code registration Add traceAI-watsonx (traceai_watsonx.WatsonxInstrumentor) for ibm-watsonx-ai 1.3.0 up to 2.0: ModelInference generate/generate_text/generate_text_stream/chat/chat_stream and their async variants, and Embeddings generate/embed_documents/embed_query and async variants. Register the integration for zero-code instrumentation and wire release automation, CI and docs.
…late variables, input/output values and tracing failures
…eep template variables out of request parameters, set input/output values, guard tracing failures - generate_text, embed_query and embed_documents take usage, finish reason and response model from the inner generate response through the outer span's accumulator. - Parameters given when creating ModelInference or Embeddings are recorded under the call's. - prompt_variables move to gen_ai.prompt.template.variables, which core hides with the input flags. - input.value, input.mime_type and output.value follow the sibling providers and the hide settings. - A tracing error in span start or result handling never breaks a successful call. - generate(prompt=[...], async_mode=True) records each answer under its own prompt and sums usage.
…ams; register zero-code auto-instrumentation
… stream is dropped
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two new Python integrations, both registered in zero-code auto-instrumentation (
fi-instrument/FI_AUTO_INSTRUMENT=truepicks each up when its SDK is installed).traceAI-watsonx(IBM watsonx.ai,ibm-watsonx-ai>=1.3.0,<2)ModelInferencegenerate,generate_text,generate_text_stream,chat,chat_streamand their async forms, plusEmbeddings. Only the outermost call gets a span; usage, finish reason and model from inner calls (e.g.generate_text→generate) are folded into it.prompt_variablesare recorded as template variables, which the input-hiding settings mask.input.value/output.valueand messages follow the hide settings. Embedding vectors and exception messages are never exported.async_modeprompts are recorded per prompt with summed usage.traceAI-writer(Writer,writer-sdk>=2.0.0,<4)chat.chatandcompletions.create(sync and async, streaming), including tool calls and streamed tool-call deltas.chat.stream(),with_raw_responseandwith_streaming_responseeach produce exactly one span.chat.stream()helper left early, closed or dropped still ends its span (marked incomplete).error.type.Release wiring for both: release-please config and manifest (0.1.0), the PyPI bootstrap list, the auto-instrumentation registry, CI workflows (oldest SDK on Python 3.10, latest on 3.13, offline), and the docs tables.
Tests
Offline, real SDKs with HTTP stubbed and sockets blocked.
chat.streamhelper does not exist.