Skip to content

Conversation

chrisale000
Copy link

Description

This pull request implements comprehensive monitoring enhancements and performance optimizations:

Core Functionality:

  • Implemented TokenPaginationCrawler metrics integration for enhanced monitoring.
  • Integrated comprehensive M365 telemetry including API payload size, latency, and success rate measurements.
  • Enhanced M365 Partition Execution Logic with per-record buffer writing capabilities.

Testing and Validation:

  • Verified metrics emission to CloudWatch through local testing
  • Expanded unit test coverage for new metrics implementation
  • Updated crawler client test suite to validate buffer writing logic
  • Resolved logging-related build configuration issues in build.gradle

The changes have been thoroughly tested and documented, with all tests passing successfully. The implementation follows established coding standards and includes appropriate unit test coverage.

Issues Resolved

N/A

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
  • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

new ParameterizedTypeReference<>() {}
);
// Record search request size.
searchRequestSizeSummary.record(response.getHeaders().getContentLength());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we recording the response header length for the search request size?

Copy link
Author

Choose a reason for hiding this comment

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

This method returns the size of the body in terms of bytes: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpHeaders.html#getContentLength()

I could match the implementation with getAuditLog or vice versa. The main difference here was one is the size of bytes from the string and the other is from responseEntity itself.

private static final String AUDIT_LOG_FETCH_LATENCY = "auditLogFetchLatency";
private static final String SEARCH_CALL_LATENCY = "searchCallLatency";
private static final String AUDIT_LOGS_REQUESTED = "auditLogsRequested";
private static final String AUDIT_LOG_REQUEST_SIZE = "auditLogRequestSizeBytes";
Copy link
Member

Choose a reason for hiding this comment

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

Isn't naming these RequestSize a little misleading? It looks like this is measuring the response size / the size of the audit logs?

Copy link
Author

Choose a reason for hiding this comment

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

Updated

if (configuration.isAcknowledgments()) {
acknowledgementSet.add(record.getData());
buffer.write(record, (int) Duration.ofSeconds(BUFFER_TIMEOUT_IN_SECONDS).toMillis());
acknowledgementSet.complete();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not think this is correct. The "acknowledgementSet.complete();" should be done outside of the loop.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or create an acknowledgementset inside the loop

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the feedback. You are correct - I will move the acknowledgementSet.Add(record.getData()) outside of the loop to ensure proper handling of the acknowledgment set. This will prevent potential duplicate events in the acknowledgementSet.

Copy link
Author

Choose a reason for hiding this comment

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

Also, pushed acknowledgementSet.complete() to execute partition logic where all events are being processed.

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