Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added feature to index context header in visibility #6066

Merged
merged 3 commits into from
May 29, 2024

Conversation

shijiesheng
Copy link
Member

What changed?

Context headers are now searchable using visibility.

API

As users, they can search workflows by headers through List*Workflows / CountWorkflows with [SQL-like queries]

Header.uberctx-tenancy = "uber/testing" AND CloseStatus != "completed" ORDER BY StartTime DESC

Onboarding Steps

  • Add "Header.XXX" to frontend.validSearchAttributes
  • Enable "history.enableContextHeaderInVisibility"

Why?

Context headers are user propagated headers, including tracing baggages. Enable search-ability will enhance debugging and better observability.

How did you test it?

Unit Test

Potential risks

Release notes

Documentation Changes

@shijiesheng shijiesheng changed the title Header viz Added feature to index context header in visibility May 28, 2024
@@ -2532,6 +2538,8 @@ const (
// Default value: 400ms (400*time.Millisecond)
// Allowed filters: N/A
TransferProcessorVisibilityArchivalTimeLimit
//
Copy link
Member

Choose a reason for hiding this comment

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

empty comment section

// Attr is prefix of custom search attributes
Attr = "Attr"
// HeaderFormat is the format of context headers in search attributes
HeaderFormat = "Header.%s"
Copy link
Member

Choose a reason for hiding this comment

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

do we need to add validation somewhere to ensure that users don't create Header.Something search attributes?

Copy link
Member Author

Choose a reason for hiding this comment

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

We use admin API AddSearchAttribute from admin CLI to onboard a new search attributes. If we block there, it's going to be manual to update schema on visibility storage directly, which is not ideal.
The validation thus has to be manual

@shijiesheng shijiesheng merged commit 2f77e62 into cadence-workflow:master May 29, 2024
17 of 18 checks passed
timl3136 pushed a commit to timl3136/cadence that referenced this pull request Jun 6, 2024
…#6066)

What changed?

Context headers are now searchable using visibility.

API
As users, they can search workflows by headers through List*Workflows / CountWorkflows with [SQL-like queries]

Header.uberctx-tenancy = "uber/testing" AND CloseStatus != "completed" ORDER BY StartTime DESC
Onboarding Steps
Add "Header.XXX" to frontend.validSearchAttributes
Enable "history.enableContextHeaderInVisibility"
Why?

Context headers are user propagated headers, including tracing baggages. Enable search-ability will enhance debugging and better observability.

How did you test it?

Unit Test
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