collector

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiKeyHeader = "X-API-Key"
)

Variables

View Source
var (
	ErrProjectNotFound         = errors.New("project not found (x-api-key header is missing or invalid)")
	ErrClickhouseNotConfigured = errors.New("clickhouse integration is not configured")
)

Functions

func SelectIP added in v1.3.0

func SelectIP(ips []netaddr.IP) *netaddr.IP

func StackHash

func StackHash(s []string) uint64

Types

type ApplicationInstrumentation added in v1.9.0

type ApplicationInstrumentation struct {
	Type        model.ApplicationType `json:"type"`
	Host        string                `json:"host"`
	Port        string                `json:"port"`
	Credentials model.Credentials     `json:"credentials"`
	Params      map[string]string     `json:"params"`
	Instance    string                `json:"instance"`
}

type Collector

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

func New

func New(cfg config.CollectorConfig, database *db.DB, cache *cache.Cache, globalClickHouse *db.IntegrationClickhouse, globalPrometheus *db.IntegrationPrometheus, grpcServer *grpc.Server) *Collector

func (*Collector) Close

func (c *Collector) Close()

func (*Collector) Config added in v1.3.0

func (c *Collector) Config(w http.ResponseWriter, r *http.Request)

func (*Collector) GetClickhouseClusterInfo added in v1.15.1

func (c *Collector) GetClickhouseClusterInfo(project *db.Project) (ch.ClickHouseInfo, error)

func (*Collector) Logs

func (c *Collector) Logs(w http.ResponseWriter, r *http.Request)

func (*Collector) Metrics

func (c *Collector) Metrics(w http.ResponseWriter, r *http.Request)

func (*Collector) MigrateClickhouseDatabase added in v1.7.3

func (c *Collector) MigrateClickhouseDatabase(ctx context.Context, project *db.Project) error

func (*Collector) Profiles

func (c *Collector) Profiles(w http.ResponseWriter, r *http.Request)

func (*Collector) Traces

func (c *Collector) Traces(w http.ResponseWriter, r *http.Request)

func (*Collector) UpdateClickhouseClient

func (c *Collector) UpdateClickhouseClient(ctx context.Context, project *db.Project) error

type ConfigData added in v1.9.0

type ConfigData struct {
	ApplicationInstrumentation []ApplicationInstrumentation `json:"application_instrumentation"`

	AWSConfig *db.IntegrationAWS `json:"aws_config"`
}

type GRPCLogsService added in v1.14.3

type GRPCLogsService struct {
	logsv1.UnimplementedLogsServiceServer
	// contains filtered or unexported fields
}

func NewGRPCLogsService added in v1.14.3

func NewGRPCLogsService(collector *Collector) *GRPCLogsService

func (*GRPCLogsService) Export added in v1.14.3

type GRPCTracesService added in v1.14.3

type GRPCTracesService struct {
	tracesv1.UnimplementedTraceServiceServer
	// contains filtered or unexported fields
}

func NewGRPCTracesService added in v1.14.3

func NewGRPCTracesService(collector *Collector) *GRPCTracesService

func (*GRPCTracesService) Export added in v1.14.3

type LogsBatch

type LogsBatch struct {
	Timestamp          *chproto.ColDateTime64
	TraceId            *chproto.ColStr
	SpanId             *chproto.ColStr
	TraceFlags         *chproto.ColUInt32
	SeverityText       *chproto.ColLowCardinality[string]
	SeverityNumber     *chproto.ColInt32
	ServiceName        *chproto.ColLowCardinality[string]
	ResourceAttributes *chproto.ColMap[string, string]
	LogAttributes      *chproto.ColMap[string, string]
	Body               *chproto.ColStr
	// contains filtered or unexported fields
}

func NewLogsBatch

func NewLogsBatch(limit int, timeout time.Duration, exec func(query ch.Query) error) *LogsBatch

func (*LogsBatch) Add

func (b *LogsBatch) Add(req *v1.ExportLogsServiceRequest)

func (*LogsBatch) Close

func (b *LogsBatch) Close()

type MetricsBatch added in v1.16.0

type MetricsBatch struct {
	Timestamp  *chproto.ColDateTime64
	MetricHash *chproto.ColUInt64
	Value      *chproto.ColFloat64
	MetricName *chproto.ColLowCardinality[string]
	Labels     *chproto.ColMap[string, string]

	MetricFamilyName *chproto.ColLowCardinality[string]
	Type             *chproto.ColLowCardinality[string]
	Help             *chproto.ColStr
	Unit             *chproto.ColLowCardinality[string]
	// contains filtered or unexported fields
}

func NewMetricsBatch added in v1.16.0

func NewMetricsBatch(limit int, timeout time.Duration, exec func(query ch.Query) error) *MetricsBatch

func (*MetricsBatch) Add added in v1.16.0

func (b *MetricsBatch) Add(req *prompb.WriteRequest)

func (*MetricsBatch) Close added in v1.16.0

func (b *MetricsBatch) Close()

type ProfilesBatch

type ProfilesBatch struct {
	ServiceName *chproto.ColLowCardinality[string]
	Type        *chproto.ColLowCardinality[string]
	Start       *chproto.ColDateTime64
	End         *chproto.ColDateTime64
	Labels      *chproto.ColMap[string, string]
	Value       *chproto.ColInt64
	StackHash   *chproto.ColUInt64
	Stack       *chproto.ColArr[string]
	// contains filtered or unexported fields
}

func NewProfilesBatch

func NewProfilesBatch(limit int, timeout time.Duration, exec func(query ch.Query) error) *ProfilesBatch

func (*ProfilesBatch) Add

func (b *ProfilesBatch) Add(serviceName string, labels model.Labels, p *profile.Profile)

func (*ProfilesBatch) Close

func (b *ProfilesBatch) Close()

type TracesBatch

type TracesBatch struct {
	Timestamp          *chproto.ColDateTime64
	TraceId            *chproto.ColStr
	SpanId             *chproto.ColStr
	ParentSpanId       *chproto.ColStr
	TraceState         *chproto.ColStr
	SpanName           *chproto.ColLowCardinality[string]
	SpanKind           *chproto.ColLowCardinality[string]
	ServiceName        *chproto.ColLowCardinality[string]
	ResourceAttributes *chproto.ColMap[string, string]
	SpanAttributes     *chproto.ColMap[string, string]
	Duration           *chproto.ColInt64
	StatusCode         *chproto.ColLowCardinality[string]
	StatusMessage      *chproto.ColStr
	EventsTimestamp    *chproto.ColArr[time.Time]
	EventsName         *chproto.ColArr[string]
	EventsAttributes   *chproto.ColArr[map[string]string]
	LinksTraceId       *chproto.ColArr[string]
	LinksSpanId        *chproto.ColArr[string]
	LinksTraceState    *chproto.ColArr[string]
	LinksAttributes    *chproto.ColArr[map[string]string]
	// contains filtered or unexported fields
}

func NewTracesBatch

func NewTracesBatch(limit int, timeout time.Duration, exec func(query ch.Query) error) *TracesBatch

func (*TracesBatch) Add

func (*TracesBatch) Close

func (b *TracesBatch) Close()

Jump to

Keyboard shortcuts

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