otelresty

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 7 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