otelresty

package
v0.0.0-...-95754d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectTracing

func InjectTracing(c *resty.Client)

InjectTracing injects, should keep singleton in one resty.Client.

Example
client := resty.New()
otelresty.InjectTracing(client)

// pretend this to be a trace context, passed as parameter.
ctx := context.Background()

resp, err := client.
	R().
	// !!! make sure you called set context to pass trace context to middleware.
	SetContext(ctx).
	Get("https://example.com/api/resource/4396")

// handle response and error
_, _ = resp, err
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL