Skip to content

Conversation

@jar-stripe
Copy link
Contributor

Why?

Stripe.NET supports two different service usage patterns: direct Service class construction, and accessing services via StripeClient. We want to be able to differentiate these patterns in our client telemetry.

What?

  • adds defaultUsage construction parameter to LiveApiRequestor to let callers specify telemetry usage strings for each request
  • adds telemetry usage strings to LiveApiRequestor constructor in StripeClient
  • add DefaultStripeClient IStripeClient implementation (without a usage string)
  • modifies StripeConfiguration.BuildDefaultStripeClient to create a DefaultStripeClient
  • adds tests to verify correct telemetry usage strings

See Also

Changelog

  • Adds usage string to telemetry on API calls made through StripeClient service accessors

…pport the default StripeConfiguration.StripeClient

added defaultUsage construction parameter to LiveApiRequestor to let callers specify telemetry usage strings to include in every request
modified StripeConfiguration.BuildDefaultStripeClient to build a DefualtStripeClient instead of StripeClient
added tests to StripeClientTest and StripeConfigurationTest to verify the changes
refactored BaseStripeTest to ensure we let StripeClient create the LiveApiRequestor (with the correct default usage)
@jar-stripe jar-stripe requested a review from a team as a code owner July 21, 2025 23:56
@jar-stripe jar-stripe requested review from helenye-stripe and removed request for a team July 21, 2025 23:56
Copy link
Contributor

@helenye-stripe helenye-stripe left a comment

Choose a reason for hiding this comment

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

👍 (except tests are failing)

@jar-stripe jar-stripe enabled auto-merge (squash) July 23, 2025 01:50
@jar-stripe jar-stripe merged commit bac1fa7 into master Jul 23, 2025
4 checks passed
@jar-stripe jar-stripe deleted the jar/telemetry-for-client-user branch July 23, 2025 02:35
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.

3 participants