otel

package module
v0.77.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Overview

Package otel provides utilities for the otel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayUsage

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

GatewayUsage wraps the attributes.GatewayUsage type to provide gateway usage functionality and reading env variable DD_OTELCOLLECTOR_GATEWAY_MODE (set by helm chart or operator) to indicate usage of gateway mode. Env. variable has priority over attributes! GetHostFromAttributesHandler() handles an important nil check distinction: A nil *attributes.GatewayUsage and a nil attributes.HostFromAttributesHandler interface are different types, even though both are nil. An interface contains both type information and a value, so a nil interface is not equal to a nil concrete type pointer.

This wrapper ensures proper nil handling when converting between the concrete *attributes.GatewayUsage type and the attributes.HostFromAttributesHandler interface to avoid nil pointer panics.

func NewDisabledGatewayUsage

func NewDisabledGatewayUsage() GatewayUsage

NewDisabledGatewayUsage creates and returns a new GatewayUsage instance with no underlying gateway usage

func NewGatewayUsage

func NewGatewayUsage(gatewayModeSet bool) GatewayUsage

NewGatewayUsage creates and returns a new GatewayUsage instance with an initialized underlying gateway usage

func (*GatewayUsage) EnvVarValue added in v0.75.0

func (g *GatewayUsage) EnvVarValue() float64

Gauge returns the value of gateway env. variable 1 - set to true 0 - set to false or not set

func (*GatewayUsage) Gauge

func (g *GatewayUsage) Gauge() (float64, bool)

Gauge returns the current gateway usage gauge value and a boolean indicating if gateway usage is enabled.

func (GatewayUsage) GetHostFromAttributesHandler

func (g GatewayUsage) GetHostFromAttributesHandler() attributes.HostFromAttributesHandler

GetHostFromAttributesHandler returns a handler for extracting host information from attributes.

Jump to

Keyboard shortcuts

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