otel

package
v1.28.0 Latest Latest
Warning

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

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

Documentation

Overview

Package otel provides OpenTelemetry tracing and metrics for HTTP client requests.

The package provides 3 types of telemetry: 1. otelhttptrace low-level telemetry:

  • It provides spans for HTTP request parts, for example: "http.dns", "http.tls", "http.getconn".
  • Span names start with "http".
  • Metrics are not provided.

2. Low-level telemetry

  • It provides span and metrics for every sent HTTP request, including redirects and retries.
  • Span name is "http.request".
  • Metrics names start with "keboola.go.http." (httpMeterPrefix const).
  • For full list of metrics see the httpMeters struct.
  • The package otelhttp (its client part) is not used, because it doesn't provide metrics.

3. High-level telemetry implemented in this package.

  • It provides span and metrics for each "logical" HTTP request send by the client.
  • Main span "keboola.go.http.client.request" wraps all redirects and retries together.
  • Span "keboola.go.http.client.request.body.parse" tracks response receiving and parsing (as a stream).
  • Span "keboola.go.http.client.retry.delay" tracks delay before retry.
  • Metrics names start with "keboola.go.http.client" (clientMeterPrefix const).
  • For full list of metrics see the clientMeters and parseMeters structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTrace

func NewTrace(tracerProvider otelTrace.TracerProvider, meterProvider otelMetric.MeterProvider, opts ...Option) trace.Factory

Types

type Option

type Option func(*config)

func WithPropagators added in v1.16.0

func WithPropagators(v propagation.TextMapPropagator) Option

func WithRedactedHeaders

func WithRedactedHeaders(headers ...string) Option

func WithRedactedPathParam

func WithRedactedPathParam(params ...string) Option

func WithRedactedQueryParam

func WithRedactedQueryParam(params ...string) Option

Jump to

Keyboard shortcuts

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