Skip to content

Add Opentelemetry support #2104

@yordis

Description

@yordis

Is your feature request related to a problem? Please describe.

We are trying to figure out what is the most optimal way to add OTEL to the Stripe API calls.

Describe the solution you'd like

Ideally, the library already comes with OTEL integration.

Or maybe we suppose to build a custom backend for it?! Unsure

It seems that the backend call takes the replaced URL, ideally we should be able to pass
https://opentelemetry.io/docs/specs/semconv/registry/attributes/url/#url-template

In this case, /v1/charges/{id}

func (c Client) Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) {
	path := stripe.FormatURLPath("/v1/charges/%s", id)
	charge := &stripe.Charge{}
	err := c.B.Call(http.MethodGet, path, c.Key, params, charge)
	return charge, err
}

Describe alternatives you've considered

Wraps manually every API call

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions