Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogExporter ¶ added in v16.9.0
type LogExporter struct {
// contains filtered or unexported fields
}
LogExporter is a trace2 hook that adds trace2 api event logs to Gitaly's logs.
func NewLogExporter ¶ added in v16.9.0
func NewLogExporter(rl *rate.Limiter, logger log.Logger) *LogExporter
NewLogExporter initializes LogExporter, which is a hook that uses the parsed trace2 events from the manager to export them to the Gitaly log. It's invocations are limited by the rateLimiter. The limiter allows maxBurstToken number of events to happen at once and then replenishes by maxEventPerSecond. It works on the token bucket algorithm where you have a number of tokens in the bucket to start and you can consume them in each call whilst the bucket gets refilled at the specified rate.
func (*LogExporter) Handle ¶ added in v16.9.0
Handle will log the trace in a readable json format in Gitaly's logs. Metadata is also collected and additional information is added to the log. It is also rate limited to protect it from overload when there are a lot of trace2 events triggered from git operations.
func (*LogExporter) Name ¶ added in v16.9.0
func (t *LogExporter) Name() string
Name returns the name of tracing exporter
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 ¶
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 ¶
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