Documentation
¶
Overview ¶
Package telemetry is what Tern's logging and tracing exporters share: sending a batch over HTTP with gzip, status codes mapped to retries and Retry-After, and OTLP's JSON encoding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Do ¶
Do sends r. Errors that retrying can fix (connection errors, 408, 429 and 5xx) are returned as they are, or with batch.RetryAfter; the rest are batch.Permanent.
func Endpoint ¶
Endpoint is where an OTLP signal ("logs", "traces") is posted: explicit, or OTEL_EXPORTER_OTLP_<SIGNAL>_ENDPOINT, or OTEL_EXPORTER_OTLP_ENDPOINT with /v1/<signal> added, or a collector on localhost.
func ParseHeaders ¶
ParseHeaders reads ParsePairs' format as headers.
Types ¶
type AnyValue ¶
type AnyValue struct {
StringValue *string `json:"stringValue,omitempty"`
IntValue *string `json:"intValue,omitempty"`
DoubleValue *float64 `json:"doubleValue,omitempty"`
BoolValue *bool `json:"boolValue,omitempty"`
KvlistValue *KVList `json:"kvlistValue,omitempty"`
}
AnyValue is an attribute's value: one of its fields is set.
type KVList ¶
type KVList struct {
Values []KeyValue `json:"values"`
}
KVList is a group of attributes.
type Pair ¶
type Pair struct{ Key, Value string }
Pair is a key and its value.
func ParsePairs ¶
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.