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 the Stripe object name to instrumentation event payloads #1168

Closed
wants to merge 1 commit into from

Conversation

agrobbin
Copy link

This is my first contribution to the stripe-ruby gem, so please let me know if there's anything I've missed, or if I've not followed a particular contribution guideline!

I was looking at adding Stripe instrumentation to our APM (in this case, DataDog), and something that would be really helpful is having access to the object name (i.e. customer) in the instrumentation payload.

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2023

CLA assistant check
All committers have signed the CLA.

Having the object name in event payloads can be really helpful when sending Stripe-related information to an APM tool (rather than, say, the request path).
@agrobbin
Copy link
Author

agrobbin commented Feb 3, 2023

@richardm-stripe sorry to ping you directly here, but you seem to be the most recently active contributor! When you or someone else from Stripe has some time, it'd be great to get some feedback on if this change is acceptable.

@pakrym-stripe
Copy link
Contributor

Sorry for the delayed response. We have the entire request/response body available on the end event is it possible for you to extract the object type from there?

@agrobbin
Copy link
Author

agrobbin commented Feb 7, 2023

No worries, @pakrym-stripe! It is possible, but relying on parsing the JSON request to retrieve the type struck me as too... implicit. When building the APM integration, having the explicit name of the object required much less downstream functionality to correctly parse out the object name.

@pakrym-stripe
Copy link
Contributor

@agrobbin the reason I'm asking is we are planning some changes that will make OBJECT_NAME impossible to know before making the request. This would mean that OBJECT_NAME won't be available both on the request and the response event.

In addition the current definition for OBJECT_NAME is a bit vague. Do you want to know which class made the request or which object type was returned? It's completely possible for a method one resource type to return a different resource type.

@agrobbin
Copy link
Author

agrobbin commented Feb 7, 2023

Ah that's good to know! It might make sense for the class name to be the "thing" here, then. The idea would be that there is a key in the instrumentation event payload that represents the concept you're interacting with in Stripe. If that's object_name or class, I definitely would want to defer to Stripe!

@pakrym-stripe
Copy link
Contributor

I wonder if this is something that path can be used for. Do you mind filing an issue so we can judge interest in this feature and clarify the design before coming up with the implementation?

@agrobbin
Copy link
Author

@pakrym-stripe I opened #1178, which hopefully includes enough context for the feature request!

@pakrym-stripe
Copy link
Contributor

@agrobbin I'll close this PR for housekeeping purposes until we have an overall design for distributed tracing ready.

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.

None yet

3 participants