Skip to content

[pull] main from google:main#399

Merged
pull[bot] merged 2 commits into
CrazyForks:mainfrom
google:main
Jul 6, 2026
Merged

[pull] main from google:main#399
pull[bot] merged 2 commits into
CrazyForks:mainfrom
google:main

Conversation

@pull

@pull pull Bot commented Jul 6, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

RKest added 2 commits July 6, 2026 02:48
The `gen_ai.workflow.nested=true` attribute/dimension was never produced for
any nested workflow in `gen_ai.invoke_workflow.duration` metric, so root and
nested workflow invocations could not be distinguished.

Root cause was a lost OpenTelemetry context value in
`_use_invoke_workflow_span`. The "entrypoint workflow active" marker was only
`set_value`'d onto the local `otel_context` handed to
`tracer.start_as_current_span(context=...)`. OTel uses that argument solely to
resolve the new span's parent; it does not attach it as the current context.
The child telemetry context was then captured from `context_api.get_current()`,
which never carried the marker, so every downstream workflow computed
`nested=False`.

Fix: after starting the span, `context_api.attach` the marker onto the current
context (and `detach` on exit) so child nodes capturing `get_current()` observe
`nested=True`. The now-redundant `set_value` onto the local context is removed.

Extend the telemetry functional tests so the scenario runs a workflow nested
inside a workflow. All expected span trees and the invoke_workflow duration
metric now assert the inner workflow carries `gen_ai.workflow.nested=true` while
the root omits it. This case previously went uncovered.

Co-authored-by: Max Ind <maxind@google.com>
PiperOrigin-RevId: 943153631
Semconv PR for this metric in:
open-telemetry/semantic-conventions-genai#203
Was replaced by `gen_ai.invoke_agent.{inference,tool}_calls` metrics in:
open-telemetry/semantic-conventions-genai#336

We're hence removing the non-standard and less defined
`gen_ai.agent.workflow.steps` metric.

Co-authored-by: Max Ind <maxind@google.com>
PiperOrigin-RevId: 943154162
@pull pull Bot locked and limited conversation to collaborators Jul 6, 2026
@pull pull Bot added the ⤵️ pull label Jul 6, 2026
@pull pull Bot merged commit 68a7803 into CrazyForks:main Jul 6, 2026
2 of 14 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant