# Individual workflow metric

**URL:** <https://community.temporal.io/t/individual-workflow-metric/4309>\
**Category:** Community Support\
**Tags:** metrics\
**Created:** [March 29, 2022, 8:00pm UTC](https://community.temporal.io/t/individual-workflow-metric/4309 "2022-03-29T20:00:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorge.neto](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jorge.neto](https://community.temporal.io/u/jorge.neto)\
**Post date:** [March 29, 2022, 8:00pm UTC](https://community.temporal.io/t/individual-workflow-metric/4309/1 "2022-03-29T20:00:32Z")

</div>

Hi experts,

We want to setup individual monitoring/alerting for a few business-critical Temporal workflows. What’s the best way to accomplish that?

We are already using the `workflow_failed` metric published by the server but we need a more fine-grained view into some of them.

Does it require a custom metric to be programatically emitted by each workflow implementation or is there another option?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Cully](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/cully/32/40_2.png) [@Cully](https://community.temporal.io/u/Cully)\
**Post date:** [March 29, 2022, 8:12pm UTC](https://community.temporal.io/t/individual-workflow-metric/4309/2 "2022-03-29T20:12:36Z")

</div>

Both the Temporal Cluster and a Temporal SDK emit metrics.

Temporal SDK Metrics are documented here: [SDK metrics | Temporal Documentation](https://docs.temporal.io/docs/reference/sdk-metrics/)  
And some Cluster metrics are loosely documented here: [Temporal Server self-hosted production deployment | Temporal Documentation](https://docs.temporal.io/docs/server/production-deployment#scaling-and-metrics)

For SDK metrics - where they are emitted to is controlled by the handler specified in Temporal Client options  
Go [How to set ClientOptions in Go | Temporal Documentation](https://docs.temporal.io/docs/go/how-to-set-clientoptions-in-go#metricshandler)  
TypeScript: [Logging and Sinks in TypeScript SDK | Temporal Documentation](https://docs.temporal.io/docs/typescript/logging/#metrics)

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [March 29, 2022, 8:30pm UTC](https://community.temporal.io/t/individual-workflow-metric/4309/3 "2022-03-29T20:30:38Z")

</div>

Just to add regarding

> We are already using the `workflow_failed` metric published by the server but we need a more fine-grained view into some of them.

Yes, the server metric `workflow_failed` does not include the workflow type. You could instead use the  
SDK `temporal_workflow_failed` metric which does include `workflow_type` param you can set in Grafana queries to the specific workflows you want to monitor.

---

<div class="post-metadata">

**Author:** ![jorge.neto](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jorge.neto](https://community.temporal.io/u/jorge.neto)\
**Post date:** [March 30, 2022, 1:27pm UTC](https://community.temporal.io/t/individual-workflow-metric/4309/4 "2022-03-30T13:27:40Z")

</div>

Thanks @tihomir, that’s exactly what I was looking for.

The only issue remaining is it seems our client code is not emitting `temporal_workflow_failed` metric. We’re using Java SDK. Is there any config I might be missing?

Alternatively, can I use `workflow_failed` metric with `taskqueue` param?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [March 30, 2022, 4:53pm UTC](https://community.temporal.io/t/individual-workflow-metric/4309/5 "2022-03-30T16:53:07Z")

</div>

> The only issue remaining is it seems our client code is not emitting `temporal_workflow_failed` metric. We’re using Java SDK. Is there any config I might be missing?

This should be emitted when a workflow execution fails by your workers if you configured sdk metrics with workers.  
Using Java SDK it’s a counter so you should see:  
`temporal_workflow_failed_total{ .... } 1.0`  
logged in your Prometheus metrics endpoint for example.

> Alternatively, can I use `workflow_failed` metric with `taskqueue` param?

Yes it does have `task_queue` param that you can use in your Grafana queries.
