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

Adding metrics for minion tasks status #6549

Merged
merged 2 commits into from Feb 10, 2021
Merged

Conversation

xiangfu0
Copy link
Contributor

@xiangfu0 xiangfu0 commented Feb 5, 2021

Description

Adding metrics for minion tasks status and JMX query to extract metrics

Sample metrics reported by JMX:
image

# HELP pinot_controller_taskStatus_Value Attribute exposed for management ("org.apache.pinot.common.metrics"<type="ControllerMetrics", name="pinot.controller.taskStatus.SegmentGenerationAndPushTask.IN_PROGRESS"><>Value)
# TYPE pinot_controller_taskStatus_Value untyped
pinot_controller_taskStatus_Value{status="IN_PROGRESS",taskType="SegmentGenerationAndPushTask",} 0.0
pinot_controller_taskStatus_Value{status="COMPLETED",taskType="SegmentGenerationAndPushTask",} 1.0

Upgrade Notes

Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)

  • Yes (Please label as backward-incompat, and complete the section below on Release Notes)

Does this PR fix a zero-downtime upgrade introduced earlier?

  • Yes (Please label this as backward-incompat, and complete the section below on Release Notes)

Does this PR otherwise need attention when creating release notes? Things to consider:

  • New configuration options
  • Deprecation of configurations
  • Signature changes to public methods/interfaces
  • New plugins added or old plugins removed
  • Yes (Please label this PR as release-notes and complete the section on Release Notes)

Release Notes

If you have tagged this as either backward-incompat or release-notes,
you MUST add text here that you would like to see appear in release notes of the
next release.

If you have a series of commits adding or enabling a feature, then
add this section only in final commit that marks the feature completed.
Refer to earlier release notes to see examples of text

Documentation

If you have introduced a new feature or configuration, please add it to the documentation as well.
See https://docs.pinot.apache.org/developers/developers-and-contributors/update-document

@codecov-io
Copy link

codecov-io commented Feb 5, 2021

Codecov Report

Merging #6549 (56c7925) into master (1beaab5) will decrease coverage by 22.46%.
The diff coverage is 42.08%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #6549       +/-   ##
===========================================
- Coverage   66.44%   43.98%   -22.47%     
===========================================
  Files        1075     1336      +261     
  Lines       54773    65849    +11076     
  Branches     8168     9609     +1441     
===========================================
- Hits        36396    28965     -7431     
- Misses      15700    34440    +18740     
+ Partials     2677     2444      -233     
Flag Coverage Δ
integration 43.98% <42.08%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ot/broker/broker/AllowAllAccessControlFactory.java 100.00% <ø> (ø)
.../helix/BrokerUserDefinedMessageHandlerFactory.java 52.83% <0.00%> (-13.84%) ⬇️
...org/apache/pinot/broker/queryquota/HitCounter.java 0.00% <0.00%> (-100.00%) ⬇️
...che/pinot/broker/queryquota/MaxHitRateTracker.java 0.00% <0.00%> (ø)
...ache/pinot/broker/queryquota/QueryQuotaEntity.java 0.00% <0.00%> (-50.00%) ⬇️
...ker/routing/instanceselector/InstanceSelector.java 100.00% <ø> (ø)
...ceselector/StrictReplicaGroupInstanceSelector.java 0.00% <0.00%> (ø)
...roker/routing/segmentpruner/TimeSegmentPruner.java 0.00% <0.00%> (ø)
...roker/routing/segmentpruner/interval/Interval.java 0.00% <0.00%> (ø)
...r/routing/segmentpruner/interval/IntervalTree.java 0.00% <0.00%> (ø)
... and 1346 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9708292...56c7925. Read the comment docs.

@xiangfu0 xiangfu0 linked an issue Feb 7, 2021 that may be closed by this pull request
taskStateToCountMap.put(taskState, taskStateToCountMap.get(taskState) + 1);
}
// Reset all the status to 0
for (TaskState taskState : _taskStateToCountMap.keySet()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to maintain the member _taskStateToCountMap, the local map should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's not, as we need to update the already reported metrics.
e.g.
in run 1, we report:

pinot_controller_taskStatus_Value{status="IN_PROGRESS",taskType="SegmentGenerationAndPushTask",} 0.0

in run 2, we need report:

pinot_controller_taskStatus_Value{status="IN_PROGRESS",taskType="SegmentGenerationAndPushTask",} 0.0
pinot_controller_taskStatus_Value{status="COMPLETED",taskType="SegmentGenerationAndPushTask",} 1.0

Without tracking the previous metrics, we cannot reset the value.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, make sense

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

taskStateToCountMap.put(taskState, taskStateToCountMap.get(taskState) + 1);
}
// Reset all the status to 0
for (TaskState taskState : _taskStateToCountMap.keySet()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see, make sense

@xiangfu0 xiangfu0 merged commit a6196ba into master Feb 10, 2021
@xiangfu0 xiangfu0 deleted the report_pending_tasks_number branch February 10, 2021 06:19
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.

Metrics for pending minion tasks
3 participants