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

Add counter to track custom order by usage in Elasticsearch #4064

Merged
merged 1 commit into from Mar 21, 2023

Conversation

rodrigozhou
Copy link
Contributor

What changed?
Add counter to track custom order by usage in Elasticsearch.

Why?

How did you test it?

Potential risks
No risks.

Is hotfix candidate?
No.

@rodrigozhou rodrigozhou requested a review from a team as a code owner March 20, 2023 19:21
@@ -735,6 +735,7 @@ func (s *visibilityStore) setDefaultFieldSort(fieldSorts []*elastic.FieldSort) [
return defaultSorter
}

s.metricsHandler.Counter(metrics.ElasticsearchCustomOrderByClauseCount.GetMetricName()).Record(1)
Copy link
Member

Choose a reason for hiding this comment

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

Can we check if the order by is not the same as default order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In a way, it's always different. If the user specifies ORDER BY, we're always adding run_id as tie breaker (L744 below). The default sort keys for ES is only close time and start time.

Copy link
Member

Choose a reason for hiding this comment

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

We get here only if custom sort order is specified. If it is not there is an early exit at L735.

@rodrigozhou rodrigozhou merged commit e7b4276 into temporalio:master Mar 21, 2023
7 checks passed
@rodrigozhou rodrigozhou deleted the custom-order-by-counter branch March 21, 2023 22:17
yycptt pushed a commit that referenced this pull request Mar 24, 2023
wxing1292 pushed a commit that referenced this pull request Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants