push

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package push sends a sink's batch over HTTP, the way the sinks that talk to services share: gzip, status codes mapped to retries, and Retry-After.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, r Request) error

Do sends r. Errors that retrying can fix (connection errors, 408, 429 and 5xx) are returned as they are, or with logging.RetryAfter; the rest are logging.Permanent.

func ParseHeaders

func ParseHeaders(s string) http.Header

ParseHeaders reads ParsePairs' format as headers.

Types

type Pair

type Pair struct{ Key, Value string }

Pair is a key and its value.

func ParsePairs

func ParsePairs(s string) []Pair

ParsePairs reads "k=v,k2=v2", as OTEL_EXPORTER_OTLP_HEADERS and OTEL_RESOURCE_ATTRIBUTES have them, with URL-encoded values.

type Request

type Request struct {
	Client      *http.Client // nil: http.DefaultClient
	URL         string
	ContentType string
	Header      http.Header
	Body        []byte
	Gzip        bool
}

Request is one push.

Jump to

Keyboard shortcuts

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