observability

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package observability provides abstractions for tracing, metrics, etc.

TODO https://github.com/FerretDB/FerretDB/issues/3244

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommentFromSpanContext added in v1.24.0

func CommentFromSpanContext(sc trace.SpanContext) (string, error)

CommentFromSpanContext creates a json-encoded string with tracing information (see commentData) from span context.

func SpanContextFromComment added in v1.24.0

func SpanContextFromComment(comment string) (trace.SpanContext, error)

SpanContextFromComment extracts OpenTelemetry tracing information from an operation comment. The comment is expected to be a json string (see commentData).

If the comment is empty, it returns an empty span context and no error.

Types

type OTelTraceExporter added in v1.23.0

type OTelTraceExporter struct {
	// contains filtered or unexported fields
}

OTelTraceExporter represents the OTLP trace exporter using HTTP with protobuf payloads.

func NewOTelTraceExporter added in v1.23.0

func NewOTelTraceExporter(opts *OTelTraceExporterOpts) (*OTelTraceExporter, error)

NewOTelTraceExporter sets up OTelTraceExporter and global tracer provider that is available via `otel.Tracer("")`.

It must be called only once.

func (*OTelTraceExporter) Run added in v1.23.0

func (ot *OTelTraceExporter) Run(ctx context.Context)

Run runs OTLP trace exporter until ctx is canceled.

type OTelTraceExporterOpts added in v1.23.0

type OTelTraceExporterOpts struct {
	Logger *slog.Logger

	Service string
	Version string
	URL     string
}

OTelTraceExporterOpts represents OTelTraceExporter options.

Jump to

Keyboard shortcuts

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