package ocagent

import "golang.org/x/tools/internal/event/export/ocagent"

Package ocagent adds the ability to export all telemetry to an ocagent. This keeps the compile time dependencies to zero and allows the agent to have the exporters needed for telemetry aggregation and viewing systems.

Index

Types

type Config

type Config struct {
	Start   time.Time
	Host    string
	Process uint32
	Client  *http.Client
	Service string
	Address string
	Rate    time.Duration
}

func Discover

func Discover() *Config

Discover finds the local agent to export to, it will return nil if there is not one running. TODO: Actually implement a discovery protocol rather than a hard coded address

type Exporter

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

func Connect

func Connect(config *Config) *Exporter

Connect creates a process specific exporter with the specified serviceName and the address of the ocagent to which it will upload its telemetry.

func (*Exporter) Flush

func (e *Exporter) Flush()

func (*Exporter) ProcessEvent

func (e *Exporter) ProcessEvent(ctx context.Context, ev core.Event, lm label.Map) context.Context

Source Files

metrics.go ocagent.go

Directories

PathSynopsis
internal/event/export/ocagent/wire
Version
v0.30.0 (latest)
Published
Feb 10, 2025
Platform
linux/amd64
Imports
16 packages
Last checked
8 hours ago

Tools for package owners.