Documentation
¶
Overview ¶
Package trace provides tracing functionality. In ZAP mode (default), tracing is disabled - no OpenTelemetry dependencies. Use -tags=grpc to enable full OpenTelemetry tracing support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.15.6
type Config struct {
ExporterConfig ExporterConfig `json:"exporterConfig"`
TraceSampleRate float64 `json:"traceSampleRate"`
AppName string `json:"appName"`
Version string `json:"version"`
}
Config holds tracing configuration
type ExporterConfig ¶ added in v0.15.6
type ExporterConfig struct {
Type ExporterType `json:"type"`
Endpoint string `json:"endpoint"`
Headers map[string]string `json:"headers"`
Insecure bool `json:"insecure"`
}
ExporterConfig holds exporter configuration
type ExporterType ¶ added in v0.15.6
type ExporterType byte
ExporterType represents the type of trace exporter
const ( Disabled ExporterType = iota GRPC HTTP ZAP )
func ExporterTypeFromString ¶ added in v0.15.6
func ExporterTypeFromString(s string) (ExporterType, error)
ExporterTypeFromString parses an exporter type string
func (ExporterType) MarshalJSON ¶ added in v0.15.6
func (t ExporterType) MarshalJSON() ([]byte, error)
func (ExporterType) String ¶ added in v0.15.6
func (t ExporterType) String() string
func (*ExporterType) UnmarshalJSON ¶ added in v0.15.6
func (t *ExporterType) UnmarshalJSON(b []byte) error
type KeyValue ¶ added in v1.23.4
KeyValue represents a key-value attribute pair (otel compatible name)
type Span ¶ added in v1.23.4
type Span interface {
End(options ...SpanEndOption)
SetStatus(code StatusCode, description string)
RecordError(err error, options ...EventOption)
AddEvent(name string, options ...EventOption)
SetAttributes(kv ...KeyValue)
}
Span represents a trace span
type SpanEndOption ¶ added in v1.23.4
type SpanEndOption interface{}
SpanEndOption configures span ending
type SpanStartOption ¶ added in v1.23.4
type SpanStartOption interface {
// contains filtered or unexported methods
}
SpanStartOption configures span creation
func WithAttributes ¶ added in v1.23.4
func WithAttributes(...KeyValue) SpanStartOption
WithAttributes returns a SpanStartOption
type StatusCode ¶ added in v1.23.4
type StatusCode int
StatusCode represents span status
const ( StatusUnset StatusCode = iota StatusOK StatusError )
Click to show internal directories.
Click to hide internal directories.