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

Emit action metrics for batch of markers #4905

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

yiminc
Copy link
Member

@yiminc yiminc commented Sep 27, 2023

What changed?
Add action metric for batch of markers

Why?
Markers in one workflow task maybe counted as one action.

How did you test it?

Potential risks

Is hotfix candidate?

@yiminc yiminc requested a review from a team as a code owner September 27, 2023 00:55
// One workflow task response may contain multiple marker commands. Each marker will emit one
// command_RecordMarker_Xxx action metric. Depending on pricing model, you may want to ignore all individual
// command_RecordMarker_Xxx and use command_BatchMarkers instead.
metricsHandler.Counter(metrics.ActionCounter.GetMetricName()).Record(1, metrics.ActionType("command_BatchMarkers"))
Copy link
Member

Choose a reason for hiding this comment

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

so action metric will double count? and people need to change the query to exclude either all of command_RecordMarker_Xxx or command_BatchMarkers to get the right count?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Current OSS action metrics include all commands, but not all commands are billable actions.

Copy link
Member

Choose a reason for hiding this comment

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

cc @feihuang after ^ is deployed, the sum of action metric across action_type will double count.

@yiminc yiminc merged commit 5ab5265 into temporalio:main Oct 6, 2023
10 checks passed
rodrigozhou pushed a commit that referenced this pull request Oct 30, 2023
<!-- Describe what has changed in this PR -->
**What changed?**
Add action metric for batch of markers

<!-- Tell your future self why have you made these changes -->
**Why?**
Markers in one workflow task maybe counted as one action.

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**


<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**


<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**
rodrigozhou pushed a commit that referenced this pull request Oct 30, 2023
<!-- Describe what has changed in this PR -->
**What changed?**
Add action metric for batch of markers

<!-- Tell your future self why have you made these changes -->
**Why?**
Markers in one workflow task maybe counted as one action.

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**


<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**


<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**
rodrigozhou pushed a commit that referenced this pull request Oct 31, 2023
<!-- Describe what has changed in this PR -->
**What changed?**
Add action metric for batch of markers

<!-- Tell your future self why have you made these changes -->
**Why?**
Markers in one workflow task maybe counted as one action.

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**


<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**


<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**
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

2 participants