metrics

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

func NewBuilder(adapters *adapter.Registry, pricing appcatalog.PricingResolver) *Builder

func (*Builder) Build

func (b *Builder) Build(
	ctx context.Context,
	requestTrace *trace.RequestTrace,
	req *infracontext.RequestContext,
	resp *infracontext.ResponseContext,
	startTime, endTime time.Time,
) *events.Event

type Exporter

type Exporter interface {
	Name() string
	Publish(ctx context.Context, evt *events.Event) error
	Close()
}

type ExporterCache

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

func NewExporterCache

func NewExporterCache(factory ExporterFactory, logger *slog.Logger) *ExporterCache

func (*ExporterCache) CloseAll

func (c *ExporterCache) CloseAll()

func (*ExporterCache) Resolve

type ExporterFactory

type ExporterFactory interface {
	Build(cfg telemetrydomain.ExporterConfig) (Exporter, error)
	Validate(cfg telemetrydomain.ExporterConfig) error
}

type Pipeline

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

func NewPipeline

func NewPipeline(
	builder *Builder,
	cache *ExporterCache,
	playgroundStore PlaygroundTraceStore,
	logger *slog.Logger,
	defaults ...Exporter,
) *Pipeline

type PlaygroundTraceStore

type PlaygroundTraceStore interface {
	Save(ctx context.Context, req *infracontext.RequestContext, evt *events.Event)
}

PlaygroundTraceStore persists the metrics Event of playground requests so the dashboard can fetch it by TraceID. It runs after the exporters as a best-effort side channel and must never block or fail the pipeline.

type Worker

type Worker interface {
	StartWorkers(n int)
	Shutdown()
	Process(
		requestTrace *trace.RequestTrace,
		req *infracontext.RequestContext,
		resp *infracontext.ResponseContext,
		startTime time.Time,
		endTime time.Time,
		exporters []telemetrydomain.ExporterConfig,
	)
}

func NewWorker

func NewWorker(logger *slog.Logger, pipeline *Pipeline) Worker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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