Skip to content

Conversation

@simvlad
Copy link
Contributor

@simvlad simvlad commented Nov 27, 2025

What changed?

Start to track the size of the header field in the requests

Why?

There are few reasons to start tracking the header size. First, it helps to picture the size of the request used by header field. Second, unlike payload and memo fields, we currently do not enforce the size of the header size. Better visibility into its size will determine at what level we would need to set up the enforcement.

How did you test it?

  • built
  • run locally and tested manually - ran samples-go/ctxpropagation and checked that the header size metric is populated in Prometheus
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

No

@simvlad simvlad requested review from a team as code owners November 27, 2025 00:32
@simvlad simvlad requested review from bergundy and yycptt November 27, 2025 00:32
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Looks like you missed workflow update headers.
I think all of the commands are covered by I would double check.
Look here for all of the places where header is referenced.
Maybe also inspect the header in the CreateSchedule and UpdateSchedule` APIs in the action to start a workflow.

operation string,
) error {
config := shard.GetConfig()
logger := shard.GetLogger()
throttledLogger := shard.GetThrottledLogger()
namespaceName := namespaceEntry.Name().String()

metricsHandler := interceptor.GetMetricsHandlerFromContext(ctx, logger).WithTags(metrics.CommandTypeTag(operation))
metrics.HeaderSize.With(metricsHandler).Record(int64(workflowHeaderSize))
Copy link
Member

Choose a reason for hiding this comment

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

Why emit this both on the history and frontend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to emit this one close to where the payload/memo sizes are being enforced (right after this). Also I don't think this is emitted for start workflow execution requests specifically in the frontend.

@simvlad simvlad force-pushed the simvlad/track-size-header-user-metadata branch from 1861fcb to 86d7d30 Compare December 1, 2025 22:34
@simvlad simvlad requested a review from bergundy December 1, 2025 22:35
@simvlad simvlad merged commit adf63d0 into main Dec 2, 2025
94 of 96 checks passed
@simvlad simvlad deleted the simvlad/track-size-header-user-metadata branch December 2, 2025 20:43
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.

3 participants