trace2hooks

package
v16.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackObjectsMetrics

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

PackObjectsMetrics is a trace2 hook that export pack-objects Prometheus metrics and stats log fields. This information is extracted by traversing the trace2 event tree.

func NewPackObjectsMetrics

func NewPackObjectsMetrics() *PackObjectsMetrics

NewPackObjectsMetrics is the initializer for PackObjectsMetrics

func (*PackObjectsMetrics) Collect

func (p *PackObjectsMetrics) Collect(c chan<- prometheus.Metric)

Collect collects Prometheus metrics exposed by the PackObjectsMetrics structure.

func (*PackObjectsMetrics) Describe

func (p *PackObjectsMetrics) Describe(descs chan<- *prometheus.Desc)

Describe describes Prometheus metrics exposed by the PackObjectsMetrics structure.

func (*PackObjectsMetrics) Handle

func (p *PackObjectsMetrics) Handle(rootCtx context.Context, trace *trace2.Trace) error

Handle traverses input trace2 event tree for data nodes containing relevant pack-objects data. When it finds one, it updates Prometheus objects and log fields accordingly.

func (*PackObjectsMetrics) Name

func (p *PackObjectsMetrics) Name() string

Name returns the name of the hooks

type TracingExporter

type TracingExporter struct{}

TracingExporter is a trace2 hook that converts the trace2 tree to corresponding distributed tracing's spans. These spans are then collected if the process initializes labkit's tracing utility.

func NewTracingExporter

func NewTracingExporter() *TracingExporter

NewTracingExporter initializes TracingExporter, which is a hook to convert Trace2 events to corresponding distributed tracing

func (*TracingExporter) Handle

func (t *TracingExporter) Handle(rootCtx context.Context, trace *trace2.Trace) error

Handle is the main method that converts each trace not in the tree to the corresponding nested span. All the spans will have `git:` prefix, followed by the operation. Trace metadata fields are copied as span tags.

func (*TracingExporter) Name

func (t *TracingExporter) Name() string

Name returns the name of tracing exporter

Jump to

Keyboard shortcuts

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