config

package
v0.1.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OTELConfig

type OTELConfig struct {
	// GitHub configuration for API authentication
	GitHub struct {
		Token string `json:"token" yaml:"token"` // GitHub personal access token
	} `json:"github" yaml:"github"`

	// Service metadata
	ServiceName    string            `json:"service_name" yaml:"service_name"`
	ServiceVersion string            `json:"service_version" yaml:"service_version"`
	Environment    string            `json:"environment" yaml:"environment"`
	ResourceAttrs  map[string]string `json:"resource_attributes" yaml:"resource_attributes"`

	// Instrumentations to enable (per language these map to specific packages)
	Instrumentations []string `json:"instrumentations" yaml:"instrumentations"`

	// Context propagation
	Propagators []string `json:"propagators" yaml:"propagators"`

	// Sampling configuration
	Sampler struct {
		Type   string   `json:"type" yaml:"type"`     // e.g., always_on, always_off, traceidratio
		Ratio  float64  `json:"ratio" yaml:"ratio"`   // used for ratio-based samplers
		Parent string   `json:"parent" yaml:"parent"` // reserved for parentbased variants
		Rules  []string `json:"rules" yaml:"rules"`   // reserved for advanced/language-specific
	} `json:"sampler" yaml:"sampler"`

	// Exporters and endpoints
	Exporters struct {
		Traces struct {
			Type      string            `json:"type" yaml:"type"`         // e.g., otlp, console, jaeger (only otlp supported in templates for now)
			Protocol  string            `json:"protocol" yaml:"protocol"` // http/http+protobuf, grpc
			Endpoint  string            `json:"endpoint" yaml:"endpoint"`
			Headers   map[string]string `json:"headers" yaml:"headers"`
			Insecure  bool              `json:"insecure" yaml:"insecure"`
			TimeoutMs int               `json:"timeout_ms" yaml:"timeout_ms"`
		} `json:"traces" yaml:"traces"`
		Metrics struct {
			Type     string `json:"type" yaml:"type"`
			Protocol string `json:"protocol" yaml:"protocol"`
			Endpoint string `json:"endpoint" yaml:"endpoint"`
			Insecure bool   `json:"insecure" yaml:"insecure"`
		} `json:"metrics" yaml:"metrics"`
		Logs struct {
			Type     string `json:"type" yaml:"type"`
			Protocol string `json:"protocol" yaml:"protocol"`
			Endpoint string `json:"endpoint" yaml:"endpoint"`
			Insecure bool   `json:"insecure" yaml:"insecure"`
		} `json:"logs" yaml:"logs"`
	} `json:"exporters" yaml:"exporters"`

	// Span processors and additional SDK knobs
	SpanProcessors []string          `json:"span_processors" yaml:"span_processors"`
	SDK            map[string]string `json:"sdk" yaml:"sdk"`
}

OTELConfig represents advanced OpenTelemetry configuration that can be provided via a YAML file and applied across languages.

func LoadOTELConfig

func LoadOTELConfig(yamlContent []byte) (*OTELConfig, error)

LoadOTELConfig parses YAML content into an OTELConfig.

func (*OTELConfig) Validate

func (c *OTELConfig) Validate() error

Validate checks the configuration for common mistakes and unsupported values.

Jump to

Keyboard shortcuts

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