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

[GOBBLIN-1736] Add metrics for change stream monitor and mysql quota manager #3593

Merged
merged 10 commits into from
Nov 14, 2022

Conversation

ZihanLi58
Copy link
Contributor

Dear Gobblin maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

  • Here are some details about my PR, including screenshots (if applicable):
    Add metrics for change stream monitor and mysql quota manager to monitor the health of the components in warm standby mode

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    unit test

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

@@ -80,18 +87,21 @@ public void init(Collection<Dag<JobExecutionPlan>> dags) {

@Override
public void checkQuota(Collection<Dag.DagNode<JobExecutionPlan>> dagNodes) throws IOException {
try (Connection connection = this.quotaStore.dataSource.getConnection()) {
try (Connection connection = this.quotaStore.dataSource.getConnection();
Timer.Context context = metricContext.timer(RuntimeMetrics.GOBBLIN_MYSQL_QUOTA_MANAGER_CHECK_QUOTA_TIME).time()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

when do we call stop for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is in try clause, when this try section finish, the context will close automatically

Comment on lines 50 to 51
public static final String GOBBLIN_MYSQL_QUOTA_MANAGER_QUOTA_EXCEEDS_REQUESTS = ServiceMetricNames.GOBBLIN_SERVICE_PREFIX + "gobblin.mysql.quota.manager.quotaExceeds.requests";
public static final String GOBBLIN_MYSQL_QUOTA_MANAGER_CHECK_QUOTA_TIME = ServiceMetricNames.GOBBLIN_SERVICE_PREFIX + "gobblin.mysql.quota.manager.check.quota.time";
Copy link
Contributor

Choose a reason for hiding this comment

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

Names are a bit hard to understand without reading the code GOBBLIN_MYSQL_QUOTA_MANAGER_QUOTA_REQUESTS_EXCEEDED so it implies number of requests exceeding quota. gobblin_mysql_quota_manager_time_to_check_quota for the second, is it measuring amount of time it takes to do the whole check?

@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2022

Codecov Report

Merging #3593 (acc9ad2) into master (7eaa6e8) will decrease coverage by 0.00%.
The diff coverage is 33.33%.

@@             Coverage Diff              @@
##             master    #3593      +/-   ##
============================================
- Coverage     46.88%   46.87%   -0.01%     
- Complexity    10660    10673      +13     
============================================
  Files          2118     2120       +2     
  Lines         82981    83078      +97     
  Branches       9238     9252      +14     
============================================
+ Hits          38902    38943      +41     
- Misses        40515    40565      +50     
- Partials       3564     3570       +6     
Impacted Files Coverage Δ
...apache/gobblin/runtime/metrics/RuntimeMetrics.java 0.00% <ø> (ø)
...ervice/monitoring/DagActionStoreChangeMonitor.java 0.00% <0.00%> (ø)
...lin/service/monitoring/SpecStoreChangeMonitor.java 0.00% <0.00%> (ø)
...e/modules/orchestration/MysqlUserQuotaManager.java 47.18% <33.33%> (-0.16%) ⬇️
...odules/orchestration/AbstractUserQuotaManager.java 100.00% <100.00%> (ø)
...a/org/apache/gobblin/util/limiter/NoopLimiter.java 40.00% <0.00%> (-20.00%) ⬇️
...he/gobblin/source/PartitionAwareFileRetriever.java 48.14% <0.00%> (-7.41%) ⬇️
...lin/util/filesystem/FileSystemInstrumentation.java 92.85% <0.00%> (-7.15%) ⬇️
.../gobblin/cluster/GobblinHelixTaskStateTracker.java 62.50% <0.00%> (-6.25%) ⬇️
...a/management/copy/publisher/CopyDataPublisher.java 74.17% <0.00%> (-1.33%) ⬇️
... and 24 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

private ContextAwareMeter killsInvoked;
private ContextAwareMeter resumesInvoked;
private ContextAwareMeter unexpectedErrors;
private Meter messageProcessedMeter;
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you use normal Meter instead of ContextAwareMeter? Also we should end all the names in "Meter" or none of them ie: messagesProcessed or killsInvokedMeter

@ZihanLi58 ZihanLi58 merged commit 47b9bb0 into apache:master Nov 14, 2022
ZihanLi58 added a commit that referenced this pull request Nov 14, 2022
@homatthew homatthew mentioned this pull request Nov 14, 2022
4 tasks
phet pushed a commit to phet/gobblin that referenced this pull request Dec 3, 2022
…manager (apache#3593)

* address comments

* use connectionmanager when httpclient is not cloesable

* [GOBBLIN-1730] Include flow execution id when try to cancel/submit job using SimpleKafkaSpecProducer

* remove unnecessary dependency

* [GOBBLIN-1736] Add metrics for change stream monitor and mysql quota manager

* Revert "remove unnecessary dependency"

This reverts commit d6871dc.

* Revert "[GOBBLIN-1730] Include flow execution id when try to cancel/submit job using SimpleKafkaSpecProducer"

This reverts commit f13e6ea.

* address comments

* address comments

Co-authored-by: Zihan Li <[email protected]>
phet added a commit to phet/gobblin that referenced this pull request Dec 5, 2022
* upstream/master:
  [GOBBLIN-1747] add job.name and job.id to kafka and compaction workunits (apache#3607)
  [GOBBLIN-1746] Add fs.uri to FsDatasetDescriptor to support copy between volumes in GaaS (apache#3605)
  [GOBBLIN-1743] Ensure GobblinTaskRunner works without Yarn use (apache#3602)
  [GOBBLIN-1745] Fix bug in SimpleKafkaSpecProducer (apache#3604)
  [GOBBLIN-1739]Define Datanodes and Dataset Descriptor for Iceberg (apache#3596)
  do not close DestinationDatasetHandlerService prematurely (apache#3601)
  [GOBBLIN-1720]Add ancestors owner permissions preservations for iceberg distcp (apache#3577)
  [HOTFIX] Fix checkstyleMain (apache#3600)
  [GOBBLIN-1736] Add metrics for change stream monitor and mysql quota manager (apache#3593)
  [GOBBLIN-1737] Fix bug when using mysql user quota manager (apache#3595)
  Correct a log line and GTE with currect number of total task count (apache#3591)
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