Skip to content

Add feature flag for Kinesis lag metric#9807

Closed
jon-wei wants to merge 2 commits intoapache:masterfrom
jon-wei:kinesis_lag_feature_flag
Closed

Add feature flag for Kinesis lag metric#9807
jon-wei wants to merge 2 commits intoapache:masterfrom
jon-wei:kinesis_lag_feature_flag

Conversation

@jon-wei
Copy link
Copy Markdown
Contributor

@jon-wei jon-wei commented May 2, 2020

This PR adds a new enableTimeLagMetrics property to the Kinesis supervisor tuningConfig that controls whether the millisBehindLatest-based metrics are emitted, and also whether such information is included in the supervisor status report.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths.
  • added integration tests.
  • been tested in a test Druid cluster.

@Test
public void testDiscoverExistingPublishingAndReadingTaskWithoutTimeLagMetrics() throws Exception
{
// Like testDiscoverExistingPublishingAndReadingTask, but with time lag metrics disabled
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps refactor this into helper method that also used by testDiscoverExistingPublishingAndReadingTask, since it looks like the only differences are (1) whether time lag metrics are enabled/disabled in the supervisor spec and (2) the assert for the proper lag metric value in the active report.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I refactored this into a helper, and added a check for the time lag metrics in the supervisor aggregate-level report

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There was another difference, whether supervisorRecordSupplier.getPartitionTimeLag is called or not

}

@Test
public void testTimeLagMetricsDisabled() throws Exception
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With regards to disabling the time lag metric, what behavior is tested by testDiscoverExistingPublishingAndReadingTaskWithoutTimeLagMetrics that is not covered by this test?

What do you think about refactoring some of the logic here so that it's reused by testNoInitialState?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

testDiscoverExistingPublishingAndReadingTaskWithoutTimeLagMetrics was checking for time lag metrics in the active tasks portion of the supervisor status report, which testNoInitialState didn't do.

testNoInitialState had checks for time lag metrics in the aggregate-level portion of the supervisor report which testDiscoverExistingPublishingAndReadingTaskWithoutTimeLagMetrics didn't

I ended up deleting testTimeLagMetricsDisabled and collapsed the time lag metrics tests into testDiscoverExistingPublishingAndReadingTask* test pair which now checks all 3 areas.

@clintropolis
Copy link
Copy Markdown
Member

#9819 might make this not necessary, but even still it feels lopsided to me that this setting only can only provide control over time lag and not both time and record count lag. Thoughts?

@jon-wei
Copy link
Copy Markdown
Contributor Author

jon-wei commented May 4, 2020

I'll close this for now as I agree with #9819 making this not needed

@jon-wei jon-wei closed this May 4, 2020
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.

4 participants