Skip to content

Conversation

@kotharironak
Copy link
Contributor

@kotharironak kotharironak commented Feb 23, 2022

Description

There are cases when we would like to if the event arrived late or not. As part of this PR, it added the metrics to measure that.
So, the metric span.processed.delay.time measure the different of current time to span start_time.

Testing

Added basic unit test

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

tenant ->
PlatformMetricsRegistry.registerTimer(
DELAY_IN_SPAN_PROCESSED_TIME_METRIC, Map.of("tenantId", tenant)))
.record(spanProcessedTime - spanStartTime, TimeUnit.MILLISECONDS);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you guys think, I should wrap this in Math.absolute?

@kotharironak
Copy link
Contributor Author

Checking why the build is failing here but passes locally.

@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #304 (9732798) into main (42cd6e7) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #304      +/-   ##
============================================
+ Coverage     79.70%   79.74%   +0.03%     
- Complexity     1297     1299       +2     
============================================
  Files           118      118              
  Lines          5159     5168       +9     
  Branches        467      467              
============================================
+ Hits           4112     4121       +9     
  Misses          837      837              
  Partials        210      210              
Flag Coverage Δ
unit 79.74% <100.00%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
.../spannormalizer/jaeger/JaegerSpanPreProcessor.java 84.61% <ø> (ø)
...re/spannormalizer/jaeger/JaegerSpanNormalizer.java 79.64% <100.00%> (+1.76%) ⬆️

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 42cd6e7...9732798. Read the comment docs.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

tenant ->
PlatformMetricsRegistry.registerTimer(
DELAY_IN_SPAN_PROCESSED_TIME_METRIC, Map.of("tenantId", tenant), true))
.record(spanProcessedTime - spanStartTime, TimeUnit.MILLISECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

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

corner case, but clock skews could result in spanStartTime being more than spanProcessedTime. Should we first check if difference is not negative?

Copy link
Contributor Author

@kotharironak kotharironak Feb 23, 2022

Choose a reason for hiding this comment

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

Same question I had - #304 (comment)

Let me do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@satish-mittal I have wrapped the difference around math.abs as if there is a very large skew we would like to know, right?

@github-actions

This comment has been minimized.

}

// register and update timer per tenant
// its uses absolute value to take care if any clock skewness too.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// its uses absolute value to take care if any clock skewness too.
// it uses absolute value to take care of any clock skewness too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done via UI to handle in a single commit.

private final JaegerResourceNormalizer resourceNormalizer = new JaegerResourceNormalizer();
private final TenantIdHandler tenantIdHandler;

// measure the span's start time and its processing time
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// measure the span's start time and its processing time
// measure the difference between span's start time and its processing time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done via UI to handle in a single commit.

private final TenantIdHandler tenantIdHandler;

// measure the span's start time and its processing time
private static final String DELAY_IN_SPAN_PROCESSED_TIME_METRIC = "span.processed.delay.time";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static final String DELAY_IN_SPAN_PROCESSED_TIME_METRIC = "span.processed.delay.time";
private static final String SPAN_PROCESSING_DELAY_TIME_METRIC = "span.processing.delay.time";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done via UI to handle in a single commit.

satish-mittal
satish-mittal previously approved these changes Feb 23, 2022
@github-actions

This comment has been minimized.

satish-mittal
satish-mittal previously approved these changes Feb 23, 2022
@github-actions

This comment has been minimized.

private final TenantIdHandler tenantIdHandler;

// measure the difference between span's start time and its processing time
private static final String SPAN_PROCESSING_DELAY_TIME_METRIC = "span.processing.delay.time";
Copy link
Contributor

Choose a reason for hiding this comment

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

Name: span.arrival.delay??

@github-actions
Copy link

Unit Test Results

  76 files  ±0    76 suites  ±0   1m 17s ⏱️ -1s
397 tests ±0  397 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9732798. ± Comparison against base commit 42cd6e7.

@kotharironak
Copy link
Contributor Author

Closing this one as we are going with - #306

@kotharironak kotharironak deleted the adding-late-event-timer branch February 24, 2022 05:01
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.

4 participants