Skip to content

Publish metrics for storage drivers types in worker heartbeat#9431

Open
simvlad wants to merge 2 commits intotemporalio:mainfrom
simvlad:simvlad/storage-driver-heartbeat-metrics
Open

Publish metrics for storage drivers types in worker heartbeat#9431
simvlad wants to merge 2 commits intotemporalio:mainfrom
simvlad:simvlad/storage-driver-heartbeat-metrics

Conversation

@simvlad
Copy link
Contributor

@simvlad simvlad commented Mar 2, 2026

What changed?

Publish metrics for storage driver types that are passed from SDK through worker heartbeat. This is only enabled if ExternalPayloadsEnabled is set to true. Since drivers can be implemented by the user, we sanitize the list against StorageDriverMetricsAllowedTypes. If the driver name is not present in the list we log it as "other".

Why?

SDK sends the storage driver types used for storing large external payloads. We'd like to publish them as metrics in order to gauge the usage.

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

High metric cardinality, but StorageDriverMetricsAllowedTypes restricts the cardinality.

@simvlad simvlad requested review from a team as code owners March 2, 2026 19:03
@simvlad simvlad requested review from jmaeagle99 and yycptt March 2, 2026 19:04
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35ae7d77a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

)
MatchingStorageDriverMetricsAllowedTypes = NewGlobalTypedSetting(
"matching.storageDriverMetricsAllowedTypes",
[]string{"s3"},

Choose a reason for hiding this comment

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

P2 Badge Use nil default for typed allowlist

NewGlobalTypedSetting values are decoded by merging over the default, and dynamicconfig explicitly warns that non-nil slice defaults get appended rather than replaced. With []string{"s3"} as the default here, operators cannot fully override the allowlist (for example, setting [] or [“gcs”] will still keep s3), so storage-driver sanitization and cardinality controls become inaccurate in production configs.

Useful? React with 👍 / 👎.

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.

1 participant