Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlagsForMetrics ¶
func FlagsForMetrics(prefix string, c *MetricsConfig) *pflag.FlagSet
func FlagsForPProfConfig ¶
func FlagsForPProfConfig(prefix string, c *PProfConfig) *pflag.FlagSet
func FlagsForTracing ¶
func FlagsForTracing(prefix string, c *TracingConfig) *pflag.FlagSet
Types ¶
type MetricsConfig ¶
type MetricsConfig struct {
// Enabled metrics collection
Enabled bool `json:"enabled" yaml:"enabled"`
// Format of exposed metrics, one of [prometheus, otlp]
Format string `json:"format" yaml:"format"`
// Endpoint address for metrics/tracing collection,
// when format is prometheus: it's a listen address (SHOULD NOT be empty or use random port (:0))
// when format is otlp: it's the otlp collector address
Endpoint string `json:"endpoint" yaml:"endpoint"`
// HTTPPath for metrics collection, used when format is prometheus
HTTPPath string `json:"httpPath" yaml:"httpPath"`
// TLS config for client/server
TLS tlshelper.TLSConfig `json:"tls" yaml:"tls"`
}
func (*MetricsConfig) CreateIfEnabled ¶ added in v0.4.0
func (c *MetricsConfig) CreateIfEnabled(setGlobal bool) (otapimetric.MeterProvider, http.Handler, error)
type PProfConfig ¶
type PProfConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Listen string `json:"listen" yaml:"listen"`
HTTPPath string `json:"httpPath" yaml:"httpPath"`
CPUProfileFrequencyHz int `json:"cpuProfileFrequencyHz" yaml:"cpuProfileFrequencyHz"`
MutexProfileFraction int `json:"mutexProfileFraction" yaml:"mutexProfileFraction"`
BlockProfileFraction int `json:"blockProfileFraction" yaml:"blockProfileFraction"`
}
func (*PProfConfig) CreateHTTPHandlerIfEnabled ¶ added in v0.4.0
func (c *PProfConfig) CreateHTTPHandlerIfEnabled(applyProfileConfig bool) http.Handler
type TracingConfig ¶
type TracingConfig struct {
// Enabled tracing stats
Enabled bool `json:"enabled" yaml:"enabled"`
// Format of exposed tracing stats, one of [otlp, zipkin, jaeger]
Format string `json:"format" yaml:"format"`
// EndpointType the type of collector used by jaeger, can be one of [agent, collector]
EndpointType string `json:"endpointType" yaml:"endpointType"`
// Endpoint to report tracing stats
Endpoint string `json:"endpoint" yaml:"endpoint"`
// SampleRate
SampleRate float64 `json:"sampleRate" yaml:"sampleRate"`
// ServiceName used when reporting tracing stats
ServiceName string `json:"serviceName" yaml:"serviceName"`
// TLS config for client/server
TLS tlshelper.TLSConfig `json:"tls" yaml:"tls"`
}
func (*TracingConfig) CreateIfEnabled ¶ added in v0.4.0
func (c *TracingConfig) CreateIfEnabled(setGlobal bool, client *http.Client) (otapitrace.TracerProvider, error)
Click to show internal directories.
Click to hide internal directories.