Workflow Task metrics only have labels with the workflow_type=none for the Java SDK

Hi,

We are using the latest Java SDK and like to get the metrics for the Workflow Task run stats. Unfortunately below metrics (likely some other we don’t know about as well) have workflow_type=none and there are no metrics with the workflow_type=DeliveryWorkflow label while we were active with the workflow starts and runs.

temporal_workflow_task_queue_poll_succeed
temporal_workflow_task_schedule_to_start_latency_seconds_bucket

e.g.

temporal_workflow_task_schedule_to_start_latency_seconds_bucket{activity_type="none",exception="none",language="java",namespace="sandbox",operation="none",query_type="none",sdk_version="0.0.29",signal_name="none",status_code="none",task_queue="DeliveryAppTaskQueue",temporal_cluster_config="westeurope-01",temporal_environment="dev",temporal_frontend="maersk-composition:///sandbox",worker_type="WorkflowWorker",workflow_type="none",le="0.001",}

Similar metrics for the activities have the data populated for the workflow_type

temporal_activity_schedule_to_start_latency_seconds_bucket{activity_type="CreateShipping",exception="none",language="java",namespace="sandbox",operation="none",query_type="none",sdk_version="0.0.29",signal_name="none",status_code="none",task_queue="DeliveryAppTaskQueue",temporal_cluster_config="westeurope-01",temporal_environment="dev",temporal_frontend="maersk-composition:///sandbox",worker_type="ActivityWorker",workflow_type="DeliveryWorkflow",le="0.001",} 

I wonder if we are missing something in the setup which might cause the workflow_type to be missing or there is some issue with the SDK metric exporter.

Thanks,
A

Hello @Andrey_Dubnik

Thank you for reporting this,

I have filed an issue Aling information provided by metrics temporal_activity_schedule_to_start_latency_seconds_bucket and temporal_workflow_task_schedule_to_start_latency_seconds_bucket · Issue #1417 · temporalio/sdk-java · GitHub Please feel free to provide more information in the ticket if something is missed.

Thanks @antonio.perez , will this cover temporal_workflow_task_queue_poll_succeed metric as well? As this is also a workflow specific metric without the workflow type populated.

Also a more generic question as currently the metrics are split into 2 groups where it might be actually 3

  1. Worker
  2. Workflow
  3. Client

At the moment worker and workflow metrics are grouped together which may need more clarity in future in the case metric is worker only without distinction between the workflow types and activity types being processed.

Hi @Andrey_Dubnik

I have added a comment to the issue, the team will review it.

You can add custom tags to your metrics per worker so you can filter by those, see this example https://github.com/temporalio/samples-java/blob/main/src/main/java/io/temporal/samples/metrics/MetricsWorker.java#L47

let me know if that helps

What I wanted to say is it is not clear from the documentation when the metric is worker/poller specific or a workflow as there is a group of metrics specific to the worker which does not apply to the workflow. We already using the custom worker labels in our setup but it won’t help in the given case.

Got it!

The current clasification is done by the component emitting the metric, client or worker as you have mentioned.

Please feel free to add a comment on the issue we opened before since the team is going to revisit the documentation. I can do it on your behalf if you prefer.