Skip to content

Conversation

@michaely520
Copy link
Contributor

@michaely520 michaely520 commented Dec 16, 2025

What changed?

Extracting workflow id during redirection based on interface

Why?

Configurable checks if needed based on workflow id

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)
michaely520 ~/projects/temporal % TEMPORAL_TEST_LOG_LEVEL=debug go test -tags test_dep -v ./tests/xdc -run TestStreamBasedReplicationTestSuite/EnableTransitionHistory/TestCloseTransferTaskAckedReplication -timeout 5m -count=1 | grep "business ID extraction"
2026-01-06T07:49:53.339-0800	debug	business ID extraction: adding business ID to context	{"cluster-name": "active_daada", "host": "127.0.0.1:49884", "wf-id": "test-replication-2ded185d-d93c-4fd7-af59-65b794156a02", "grpc-method": "/temporal.api.workflowservice.v1.WorkflowService/StartWorkflowExecution", "logging-call-at": "/Users/michaely520/projects/temporal/common/rpc/interceptor/business_id_interceptor.go:127"}
2026-01-06T07:49:53.351-0800	debug	business ID extraction: adding business ID to context	{"cluster-name": "active_daada", "host": "127.0.0.1:49884", "wf-id": "test-replication-2ded185d-d93c-4fd7-af59-65b794156a02", "grpc-method": "/temporal.api.workflowservice.v1.WorkflowService/RespondWorkflowTaskCompleted", "logging-call-at": "/Users/michaely520/projects/temporal/common/rpc/interceptor/business_id_interceptor.go:127"}
2026-01-06T07:49:53.455-0800	debug	business ID extraction: adding business ID to context	{"cluster-name": "active_daada", "host": "127.0.0.1:49884", "wf-id": "test-replication-2ded185d-d93c-4fd7-af59-65b794156a02", "grpc-method": "/temporal.api.workflowservice.v1.WorkflowService/DescribeWorkflowExecution", "logging-call-at": "/Users/michaely520/projects/temporal/common/rpc/interceptor/business_id_interceptor.go:127"}
2026-01-06T07:49:58.461-0800	debug	business ID extraction: adding business ID to context	{"cluster-name": "standby_daada", "host": "127.0.0.1:49896", "wf-id": "test-replication-2ded185d-d93c-4fd7-af59-65b794156a02", "grpc-method": "/temporal.api.workflowservice.v1.WorkflowService/DescribeWorkflowExecution", "logging-call-at": "/Users/michaely520/projects/temporal/common/rpc/interceptor/business_id_interceptor.go:127"}
2026-01-06T07:50:00.569-0800	debug	business ID extraction: adding business ID to context	{"cluster-name": "standby_daada", "host": "127.0.0.1:49896", "wf-id": "test-replication-2ded185d-d93c-4fd7-af59-65b794156a02", "grpc-method": "/temporal.api.workflowservice.v1.WorkflowService/DescribeWorkflowExecution", "logging-call-at": "/Users/michaely520/projects/temporal/common/rpc/interceptor/business_id_interceptor.go:127"}

@michaely520 michaely520 requested review from a team as code owners December 16, 2025 16:58
@michaely520 michaely520 changed the title Extract workflow id during redirect Extract workflow id interceptor Dec 17, 2025
@michaely520 michaely520 enabled auto-merge (squash) January 5, 2026 21:23
// Try each extractor until one returns a non-empty businessID
for _, extractor := range i.extractors {
if businessID := extractor(ctx, req, info.FullMethod); businessID != "" {
i.logger.Debug("business ID extraction: adding business ID to context",
Copy link
Contributor

Choose a reason for hiding this comment

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

My concern is that this is in a pretty hot code path, even the debug log is not emitted, but still consume cpu cycle...

@michaely520 michaely520 merged commit de358b8 into main Jan 6, 2026
63 checks passed
@michaely520 michaely520 deleted the workflow-id branch January 6, 2026 18:31
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