temporalio / temporalio/temporal

Adding a custom label to Temporal out-of-the-box metric

Open
#6,754 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Is your feature request related to a problem? Please describe.
The default out-of-the-box metrics have been very helpful. Meanwhile, I thought adding custom labels (dimensions) to these metrics would offer more precise insights for troubleshooting.

For example, we are submitting thousands of WorkflowA instances, each with multiple subtype values. While temporal_workflow_failed is a useful metric for tracking failures, we would have better insights if we could add subtype as a custom label in the metric, such as temporal_workflow_failed{..., subtype=...}.

Describe the solution you'd like
When adding a custom Search Attribute, it would be helpful if Temporal provided an option to include these attributes as metric labels. This would make it easier to centralize and use custom Search Attributes directly in metric labels.

Describe alternatives you've considered
If it were possible to reference and copy the default out-of-the-box metrics within workflow or activity code, we could modify these metrics to include additional labels.

Additional context
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Temporal's out-of-the-box metrics are defined and how custom Search Attributes are registered and exposed. Determine whether Search Attributes can safely become metric labels, and document the supported behavior and limitations. Done means the feature design is agreed and includes coverage for labels such as subtype.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.