internal

package
v0.103.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package internal contains an interface for detecting resource information, and a provider to merge the resources returned by a slice of custom detectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientFromContext

func ClientFromContext(ctx context.Context) (*http.Client, error)

ClientFromContext attempts to extract an *http.Client from the provided context.Context.

func ContextWithClient

func ContextWithClient(ctx context.Context, client *http.Client) context.Context

ContextWithClient returns a new context.Context with the provided *http.Client stored as a value.

func IsEmptyResource

func IsEmptyResource(res pcommon.Resource) bool

func MergeResource

func MergeResource(to, from pcommon.Resource, overrideTo bool)

func MergeSchemaURL

func MergeSchemaURL(currentSchemaURL string, newSchemaURL string) string

Types

type Detector

type Detector interface {
	Detect(ctx context.Context) (resource pcommon.Resource, schemaURL string, err error)
}

type DetectorConfig

type DetectorConfig any

type DetectorFactory

type DetectorFactory func(processor.Settings, DetectorConfig) (Detector, error)

type DetectorType

type DetectorType string

type ResourceDetectorConfig

type ResourceDetectorConfig interface {
	GetConfigFromType(DetectorType) DetectorConfig
}

type ResourceProvider

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

func NewResourceProvider

func NewResourceProvider(logger *zap.Logger, timeout time.Duration, attributesToKeep map[string]struct{}, detectors ...Detector) *ResourceProvider

func (*ResourceProvider) Get

func (p *ResourceProvider) Get(ctx context.Context, client *http.Client) (resource pcommon.Resource, schemaURL string, err error)

type ResourceProviderFactory

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

func NewProviderFactory

func NewProviderFactory(detectors map[DetectorType]DetectorFactory) *ResourceProviderFactory

func (*ResourceProviderFactory) CreateResourceProvider

func (f *ResourceProviderFactory) CreateResourceProvider(
	params processor.Settings,
	timeout time.Duration,
	attributes []string,
	detectorConfigs ResourceDetectorConfig,
	detectorTypes ...DetectorType) (*ResourceProvider, error)

Directories

Path Synopsis
aws
ec2
ecs
eks
aks
Package env provides a detector that loads resource information from the OTEL_RESOURCE environment variable.
Package env provides a detector that loads resource information from the OTEL_RESOURCE environment variable.
gcp

Jump to

Keyboard shortcuts

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