Skip to content

feat: Surfacing heartbeat counts for activities#10020

Open
davidporter-id-au wants to merge 17 commits intotemporalio:mainfrom
davidporter-id-au:feature/adding-heartbeat-count
Open

feat: Surfacing heartbeat counts for activities#10020
davidporter-id-au wants to merge 17 commits intotemporalio:mainfrom
davidporter-id-au:feature/adding-heartbeat-count

Conversation

@davidporter-id-au
Copy link
Copy Markdown
Contributor

@davidporter-id-au davidporter-id-au commented Apr 22, 2026

What changed?

This surfaces the total count of received activities by the server-side (noting that they'll be throttled client-side under frequent heartbeating scenarios, so this is likely to be an undercount of the user calls to activity.RecordHeartbeat).

This should be a field visible for the DescribeActivityInfo call.

Why?

UX improvement for users

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

None identified yet

@davidporter-id-au davidporter-id-au changed the title WIP draft change WIP draft change - surfacing heartbeat counts for activities Apr 22, 2026
Comment thread go.mod Outdated
Comment thread chasm/lib/activity/activity.go
@davidporter-id-au
Copy link
Copy Markdown
Contributor Author

This probably needs some more tests too, I'm just putting it in draft for early feedback

@davidporter-id-au davidporter-id-au marked this pull request as ready for review April 22, 2026 23:03
@davidporter-id-au davidporter-id-au requested review from a team as code owners April 22, 2026 23:03
@davidporter-id-au davidporter-id-au changed the title WIP draft change - surfacing heartbeat counts for activities feat: Surfacing heartbeat counts for activities Apr 22, 2026
Comment thread proto/internal/temporal/server/api/persistence/v1/executions.proto Outdated
Comment thread service/history/workflow/mutable_state_impl.go Outdated
Comment thread chasm/lib/activity/activity_test.go Outdated
require.True(t, hbResp.CancelRequested)
})

t.Run("HeartbeatDetailsAvailableOnRetry", func(t *testing.T) {
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.

can you extend this test so that we're counting the heartbeats across retries? You have one that validates multiple heartbeats but this scenario checks it across retries.
It'd be Poll1 -> Heartbeat1 -> Fail1 -> Poll2 -> Heartbeat2 -> Complete2 -> Describe (assert count=2)

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.

Good call, let me add

@davidporter-id-au davidporter-id-au enabled auto-merge (squash) April 24, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants