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

Release 1.3.0 #135

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Release 1.3.0 #135

merged 1 commit into from
Nov 21, 2024

Conversation

armando-rodriguez-cko
Copy link
Contributor

Add Request Telemetry for Go SDK (#133, #134)

Key Updates

  1. Telemetry Implementation:

    • Request telemetry is now enabled by default in the Go SDK.
    • Monitors request latency, improving observability and allowing continuous performance improvements.
    • Added a configuration option to disable telemetry:
      api := checkout.Builder().
          Previous().
          WithSecretKey("CHECKOUT_PREVIOUS_SECRET_KEY").
          WithEnvironment(configuration.Sandbox()).
          WithEnableTelemetry(false).
          Build()
  2. Configuration and Client Enhancements:

    • The Configuration struct includes a EnableTelemetry flag.
    • The ApiClient was updated to handle telemetry logic, such as injecting metrics into the cko-sdk-telemetry HTTP header.
  3. New Telemetry Header:

    • Introduced the cko-sdk-telemetry HTTP header to include telemetry data for requests.
    • Populates the header with the last request's ID and duration from the telemetry queue.
  4. Telemetry Queue:

    • A new telemetry queue tracks the last 10 request metrics.
    • Metrics include:
      • PrevRequestId
      • RequestId
      • PrevRequestDuration (in milliseconds)
  5. Testing:

    • Unit and integration tests added to verify:
      • Telemetry headers are sent by default.
      • Telemetry is not sent when explicitly disabled.
      • Concurrency handling for the telemetry queue.
      • Bottleneck scenarios where request delays simulate real-world latency.
  6. Documentation:

    • A new section in README.md describes telemetry functionality and usage:
      ## Telemetry
      Request telemetry is enabled by default in the Go SDK. Request latency is included in the telemetry data. Recording the request latency allows Checkout.com to continuously monitor and improve the merchant experience.
      

- Adds request telemetry
@armando-rodriguez-cko armando-rodriguez-cko requested a review from a team November 21, 2024 14:08
@armando-rodriguez-cko armando-rodriguez-cko merged commit 4d16f39 into master Nov 21, 2024
4 checks passed
@armando-rodriguez-cko armando-rodriguez-cko deleted the release/1.3.0 branch November 21, 2024 14:21
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.

2 participants