Skip to content

Commit d64de18

Browse files
committed
docs(ag2): match README claims to tests and list the remaining limits
- Tested-version line names only what the suite ran: ag2 1.0.0, 1.0.3 and 1.1.2 on Python 3.11, and ag2 1.1.2 on Python 3.10, 3.12 and 3.13. - hide_llm_invocation_parameters has nothing to act on: AG2 1.0.0 and 1.1.2 set no gen_ai.request.parameters. A drift guard now checks AG2's telemetry source for that key; the processor docstring says the same. - Limits: the subtask dedupe matches by agent name within a trace (M1); create_telemetry_middleware() defaults agent_name=None ("unknown") and tracer_provider=None (OTel global provider) (N2); concurrent first add_span_processor calls can race with fi's unlocked reset (N4). approved: Nikhil 2026-10-03 blanket Refs: TH-8236
1 parent c0a2015 commit d64de18

4 files changed

Lines changed: 33 additions & 7 deletions

File tree

‎python/frameworks/ag2/CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,10 @@
6565
with `Agent(assembly=...)` policies, and with per-call `Plugin` policies
6666
gives a `chat` span with status `UNSET` and no reason attribute. No capture
6767
is added; tests pin these span shapes.
68+
- README accuracy: the tested-version line now names only what the test
69+
suite ran (ag2 1.0.0, 1.0.3 and 1.1.2 on Python 3.11; ag2 1.1.2 on Python
70+
3.10, 3.12 and 3.13); `hide_llm_invocation_parameters` is listed as having
71+
nothing to act on (AG2 sets no `gen_ai.request.parameters`, now checked by
72+
a drift guard); Limits also cover the by-name sub-task match, the
73+
`create_telemetry_middleware()` `agent_name` / `tracer_provider` defaults
74+
and the concurrent first `add_span_processor` race.

‎python/frameworks/ag2/README.md‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ AG2 1.x is the PyPI package `ag2`, imported as `ag2`. It is not Microsoft AutoGe
1212
| `autogen` 0.14.x | `autogen` | AG2 Classic integration (TH-8237) |
1313
| `autogen-agentchat` | `autogen_agentchat` | `traceAI-autogen` |
1414

15-
Requires `ag2>=1.0.0` (the first stable 1.x that ships `TelemetryMiddleware`;
16-
tested on 1.0.0, 1.0.3 and 1.1.2), `fi-instrumentation-otel>=1.1.0` and
17-
Python 3.10 to 3.13. `ag2` is
15+
Requires `ag2>=1.0.0` (the first stable 1.x that ships `TelemetryMiddleware`),
16+
`fi-instrumentation-otel>=1.1.0` and Python 3.10 to 3.13. The offline test
17+
suite runs against ag2 1.0.0, 1.0.3 and 1.1.2 on Python 3.11, and against
18+
ag2 1.1.2 on Python 3.10, 3.12 and 3.13. `ag2` is
1819
Apache-2.0 and is a dependency only; nothing from it is vendored.
1920

2021
## What it does
@@ -143,7 +144,7 @@ the processor drops whole attributes:
143144
| `hide_outputs`, `hide_output_text` | `gen_ai.output.messages`, `gen_ai.tool.call.result`, `ag2.human_input.response` |
144145
| `hide_input_messages` | `gen_ai.input.messages`, `gen_ai.system_instructions` |
145146
| `hide_output_messages` | `gen_ai.output.messages` |
146-
| `hide_llm_invocation_parameters` | `gen_ai.request.parameters` (through `TraceConfig.mask`) |
147+
| `hide_llm_invocation_parameters` | Nothing: AG2 sets no invocation-parameter attribute (`gen_ai.request.parameters`) |
147148
| `hide_input_images`, `hide_embedding_vectors` | Nothing: AG2 records only text parts (binary inputs are omitted) and no embeddings |
148149

149150
The text flags cannot redact just the text inside the JSON, so they remove the
@@ -210,6 +211,20 @@ Notes:
210211
come from `Agent(assembly=[...])`. With per-call `Plugin` policies
211212
(`agent.ask(..., plugins=[...])`, ag2 1.1.2) the halted call gets a `chat`
212213
span with status `UNSET` and no attribute carrying the halt reason.
214+
- The `record_usage subtask` dedupe matches the sub-agent by name within a
215+
trace, so if an instrumented agent and an uninstrumented sub-agent with the
216+
same name both run in one trace, the uninstrumented one's rollup loses its
217+
promoted tokens and the trace undercounts; give such agents distinct names.
218+
- `create_telemetry_middleware()` defaults `agent_name=None`, which AG2
219+
records as `unknown`, so a sub-agent instrumented that way never matches
220+
its rollup's `ag2.usage.label` and its spend is counted twice (pass
221+
`agent_name=agent.name`), and `tracer_provider=None` sends spans to the
222+
OpenTelemetry global provider, which `register()` does not set by default
223+
(pass the provider from `register()` or `setup()`).
224+
- Two threads making the first `add_span_processor` call on a fresh
225+
`register()` provider at the same time can race with fi's unlocked
226+
exporter reset and drop `AG2SpanProcessor`; add span processors from one
227+
thread, or before calling `setup()`.
213228

214229
## Troubleshooting
215230

‎python/frameworks/ag2/tests/test_setup.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def test_scope_and_strings_match_installed_ag2():
6262
assert f'"{key}"' in source
6363
params = inspect.signature(telemetry.TelemetryMiddleware.__init__).parameters
6464
assert params["capture_content"].default is True # upstream default the helper overrides
65+
# README: hide_llm_invocation_parameters has nothing to act on because AG2
66+
# sets no invocation-parameter attribute.
67+
assert "gen_ai.request.parameters" not in source + inspect.getsource(_telemetry_consts)
6568

6669

6770
# --- AC-05 privacy default ---------------------------------------------------

‎python/frameworks/ag2/traceai_ag2/_processor.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
``hide_output_text`` every output-side one (output messages, tool result,
2323
human-input response), and ``hide_input_messages`` /
2424
``hide_output_messages`` the message keys only. ``hide_input_images`` and
25-
``hide_embedding_vectors`` have nothing to act on (AG2 records neither);
26-
``hide_llm_invocation_parameters`` and ``base64_image_max_length`` apply
27-
through ``TraceConfig.mask`` as usual;
25+
``hide_embedding_vectors`` have nothing to act on (AG2 records neither),
26+
and neither do ``hide_llm_invocation_parameters`` (AG2 sets no
27+
``gen_ai.request.parameters``) and ``base64_image_max_length``;
28+
``TraceConfig.mask`` still runs on every key;
2829
* in ``on_start``, copies traceAI context attributes (``using_session``,
2930
``using_user``, ``using_metadata``, ``using_attributes``, ...) onto the span
3031
without overriding keys AG2 sets, except ``session.id``, where the context

0 commit comments

Comments
 (0)