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

Add Telemetry Integration and Enhance SDK Configuration #454

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

armando-rodriguez-cko
Copy link
Contributor

@armando-rodriguez-cko armando-rodriguez-cko commented Dec 11, 2024

Description

This PR introduces telemetry support for tracking request performance, updates SDK configuration with enhanced flexibility, and improves test coverage to validate new and existing functionalities.

Changes Made

Telemetry Integration:

  • Added request telemetry to capture:
    • Unique request IDs.
    • Latency of requests.
    • Details of the previous request (ID and duration).
  • Enabled telemetry by default, with an option to disable it during SDK configuration.

Configuration Updates:

  • Updated DefaultCheckoutConfiguration and AbstractCheckoutSdkBuilder:
    • Added a recordTelemetry flag to enable or disable telemetry.
    • Enhanced concurrency support for configuration creation.
  • Modified ApacheHttpClientTransport to include telemetry headers in outgoing requests.

New Classes:

  • Introduced RequestMetrics to store and handle telemetry data.

Testing Enhancements:

  • Added CheckoutSdkTelemetryIntegrationTest:
    • Validates telemetry inclusion in headers.
    • Tests concurrent requests for telemetry uniqueness.
    • Simulates high-load scenarios to ensure telemetry integrity.
  • Enhanced configuration-related tests to validate telemetry toggling and thread safety:
    • DefaultCheckoutConfigurationTest.
    • PreviousStaticKeysSdkCredentialsTest.
    • StaticKeysSdkCredentialsTest.
  • Improved tests for backward compatibility:
    • WorkflowsTestIT.
    • TokensTestIT.
    • PaymentsTestIT.

Documentation Updates:

  • Updated README.md to include details on telemetry and its configuration.

Impact

  • Performance Monitoring: Provides valuable insights into API request performance and improves monitoring capabilities.
  • Configurable Telemetry: Allows users to enable or disable telemetry as needed, offering flexibility.
  • Enhanced Testing: Ensures robustness and compatibility under various scenarios, including concurrency and high-load environments.

Additional Notes

  • Telemetry is enabled by default but can be disabled during SDK configuration.
  • Changes are fully backward compatible.
  • Introduced updates do not alter existing API behaviors.

@armando-rodriguez-cko armando-rodriguez-cko changed the title Add telemetry Add Telemetry Integration and Enhance SDK Configuration Dec 12, 2024
@armando-rodriguez-cko armando-rodriguez-cko requested a review from a team December 12, 2024 11:22
@armando-rodriguez-cko armando-rodriguez-cko marked this pull request as ready for review December 12, 2024 11:25
@armando-rodriguez-cko armando-rodriguez-cko merged commit 5653179 into master Dec 12, 2024
4 checks passed
@armando-rodriguez-cko armando-rodriguez-cko deleted the feature/enable-telemetry-2 branch December 12, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants