Skip to content

Add workflow duration metric#3565

Open
wrisa wants to merge 2 commits intoopen-telemetry:mainfrom
wrisa:workflow-duration-metric
Open

Add workflow duration metric#3565
wrisa wants to merge 2 commits intoopen-telemetry:mainfrom
wrisa:workflow-duration-metric

Conversation

@wrisa
Copy link
Copy Markdown
Contributor

@wrisa wrisa commented Mar 20, 2026

Fixes #3318

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

@github-actions github-actions bot added enhancement New feature or request area:gen-ai labels Mar 20, 2026
Comment thread docs/gen-ai/gen-ai-metrics.md
@wrisa wrisa marked this pull request as ready for review March 25, 2026 20:46
@wrisa wrisa requested review from a team as code owners March 25, 2026 20:46
the canonical name of exception that occurred, or another low-cardinality error identifier.
Instrumentations SHOULD document the list of errors they report.

**[2] `gen_ai.workflow.name`:** This attribute can be populated in different frameworks eg: name of the first chain in LangChain OR name of the crew in CrewAI.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is workflow name unique? Would workflow id be a better pick? Thinking about the case where I can give same name to different workflows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally workflow name should be maintained as unique. @singankit are you suggesting multiple workflow.id for same workflow.name resulting to high cardinality?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same things is true fora gents too. Agent Name are probably not unique but agentId should be. My suggestion is not to rely on name being unique and use workflow.id instead for metrics.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no such thing as workflow id defined and realistically, there is no such notion in the libraries. workflow name should be unique within the application - we should probably add a note on this. Instrumentations will have no means to distinguish workflows with the same name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added note.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmolkova Are you suggesting for users to make sure workflow name is unique within application? Scoping metric name with application name can help make it unique even if workflow name is not unique is a possible solution but again customer need to do it.

Comment thread docs/gen-ai/gen-ai-metrics.md Outdated
Comment thread docs/gen-ai/gen-ai-metrics.md Outdated
Comment thread docs/gen-ai/gen-ai-metrics.md Outdated
Comment thread docs/gen-ai/gen-ai-metrics.md Outdated
Comment thread docs/gen-ai/gen-ai-metrics.md Outdated
Comment thread model/gen-ai/metrics.yaml
extends: metric_attributes.gen_ai
- id: metric.gen_ai.workflow.duration
type: metric
metric_name: gen_ai.workflow.duration
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to distinguish client and server workflows? all other metrics are either client or server.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmolkova workflow is an internal concept of agentic frameworks and so as per my understanding there won't be a client and server gen_ai.workflow.duration metric. I am not aware of such a thing called server workflow ? Or to future proof, we want metric name as gen_ai.client.workflow.duration ?

@github-actions
Copy link
Copy Markdown

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Add metrics for workflow

5 participants