jaeger

package
v0.25.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Host string `mapstructure:"host" yaml:"host" json:"host"` // Agent主机
	Port int    `mapstructure:"port" yaml:"port" json:"port"` // Agent端口
}

Agent Agent配置

type Collector

type Collector struct {
	Endpoint string `mapstructure:"endpoint" yaml:"endpoint" json:"endpoint"` // Collector端点
	Username string `mapstructure:"username" yaml:"username" json:"username"` // 用户名
	Password string `mapstructure:"password" yaml:"password" json:"password"` // 密码
}

Collector Collector配置

type Jaeger

type Jaeger struct {
	ModuleName  string            `mapstructure:"module-name" yaml:"module-name" json:"moduleName"`    // 模块名称
	Enabled     bool              `mapstructure:"enabled" yaml:"enabled" json:"enabled"`               // 是否启用Jaeger
	Endpoint    string            `mapstructure:"endpoint" yaml:"endpoint" json:"endpoint"`            // Jaeger端点
	ServiceName string            `mapstructure:"service-name" yaml:"service-name" json:"serviceName"` // 服务名称
	SampleRate  float64           `mapstructure:"sample-rate" yaml:"sample-rate" json:"sampleRate"`    // 采样率
	Agent       *Agent            `mapstructure:"agent" yaml:"agent" json:"agent"`                     // Agent配置
	Collector   *Collector        `mapstructure:"collector" yaml:"collector" json:"collector"`         // Collector配置
	Sampling    *Sampling         `mapstructure:"sampling" yaml:"sampling" json:"sampling"`            // 采样配置
	Tags        map[string]string `mapstructure:"tags" yaml:"tags" json:"tags"`                        // 全局标签
}

Jaeger Jaeger配置

func Default

func Default() *Jaeger

Default 创建默认Jaeger配置

func (*Jaeger) AddOperationSampling

func (j *Jaeger) AddOperationSampling(operation string, maxTracesPerSecond int, probabilisticSampling float64) *Jaeger

AddOperationSampling 添加操作采样

func (*Jaeger) AddTag

func (j *Jaeger) AddTag(key, value string) *Jaeger

AddTag 添加全局标签

func (*Jaeger) Clone

func (j *Jaeger) Clone() internal.Configurable

Clone 返回配置的副本

func (*Jaeger) Disable

func (j *Jaeger) Disable() *Jaeger

Disable 禁用Jaeger

func (*Jaeger) Enable

func (j *Jaeger) Enable() *Jaeger

Enable 启用Jaeger

func (*Jaeger) Get

func (j *Jaeger) Get() interface{}

Get 返回配置接口

func (*Jaeger) IsEnabled

func (j *Jaeger) IsEnabled() bool

IsEnabled 检查是否启用

func (*Jaeger) Set

func (j *Jaeger) Set(data interface{})

Set 设置配置数据

func (*Jaeger) Validate

func (j *Jaeger) Validate() error

Validate 验证配置

func (*Jaeger) WithAgent

func (j *Jaeger) WithAgent(host string, port int) *Jaeger

WithAgent 设置Agent配置

func (*Jaeger) WithCollector

func (j *Jaeger) WithCollector(endpoint, username, password string) *Jaeger

WithCollector 设置Collector配置

func (*Jaeger) WithEnabled

func (j *Jaeger) WithEnabled(enabled bool) *Jaeger

WithEnabled 设置是否启用

func (*Jaeger) WithEndpoint

func (j *Jaeger) WithEndpoint(endpoint string) *Jaeger

WithEndpoint 设置端点

func (*Jaeger) WithModuleName

func (j *Jaeger) WithModuleName(moduleName string) *Jaeger

WithModuleName 设置模块名称

func (*Jaeger) WithSampleRate

func (j *Jaeger) WithSampleRate(sampleRate float64) *Jaeger

WithSampleRate 设置采样率

func (*Jaeger) WithSampling

func (j *Jaeger) WithSampling(samplingType string, param float64, maxTracesPerSecond int) *Jaeger

WithSampling 设置采样配置

func (*Jaeger) WithServiceName

func (j *Jaeger) WithServiceName(serviceName string) *Jaeger

WithServiceName 设置服务名称

type OperationSampling

type OperationSampling struct {
	Operation             string  `mapstructure:"operation" yaml:"operation" json:"operation"`                                       // 操作名称
	MaxTracesPerSecond    int     `mapstructure:"max-traces-per-second" yaml:"max-traces-per-second" json:"maxTracesPerSecond"`      // 每秒最大追踪数
	ProbabilisticSampling float64 `mapstructure:"probabilistic-sampling" yaml:"probabilistic-sampling" json:"probabilisticSampling"` // 概率采样
}

OperationSampling 操作采样配置

type Sampling

type Sampling struct {
	Type               string              `mapstructure:"type" yaml:"type" json:"type"`                                                 // 采样类型
	Param              float64             `mapstructure:"param" yaml:"param" json:"param"`                                              // 采样参数
	MaxTracesPerSecond int                 `mapstructure:"max-traces-per-second" yaml:"max-traces-per-second" json:"maxTracesPerSecond"` // 每秒最大追踪数
	OperationSampling  []OperationSampling `mapstructure:"operation-sampling" yaml:"operation-sampling" json:"operationSampling"`        // 操作采样
}

Sampling 采样配置

Jump to

Keyboard shortcuts

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