otlp

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package otlp provides an OpenTelemetry Protocol (OTLP) exporter for observops. OTLP is vendor-agnostic and can export telemetry to any OTLP-compatible backend including the OpenTelemetry Collector, Jaeger, Tempo, New Relic, Datadog, and others.

Usage

import (
	"github.com/agentplexus/omniobserve/observops"
	_ "github.com/agentplexus/omniobserve/observops/otlp"
)

provider, err := observops.Open("otlp",
	observops.WithEndpoint("localhost:4317"),
	observops.WithServiceName("my-service"),
)

Endpoints

The OTLP exporter supports both gRPC and HTTP protocols:

  • gRPC: localhost:4317 (default)
  • HTTP: localhost:4318

Environment Variables

The exporter respects standard OpenTelemetry environment variables:

  • OTEL_EXPORTER_OTLP_ENDPOINT
  • OTEL_EXPORTER_OTLP_HEADERS
  • OTEL_SERVICE_NAME
  • OTEL_RESOURCE_ATTRIBUTES

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New creates a new OTLP provider.

Types

type Provider

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

Provider implements observops.Provider using OpenTelemetry OTLP exporters.

func (*Provider) ForceFlush

func (p *Provider) ForceFlush(ctx context.Context) error

ForceFlush forces any buffered telemetry to be exported.

func (*Provider) Logger

func (p *Provider) Logger() observops.Logger

Logger returns the structured logger.

func (*Provider) Meter

func (p *Provider) Meter() observops.Meter

Meter returns the metric meter.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

func (*Provider) Shutdown

func (p *Provider) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the provider.

func (*Provider) Tracer

func (p *Provider) Tracer() observops.Tracer

Tracer returns the tracer.

Jump to

Keyboard shortcuts

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