Documentation
¶
Index ¶
Constants ¶
const ( MeterName = "github.com/probe-lab/ants-watch" TracerName = "github.com/probe-lab/ants-watch" )
Variables ¶
var HealthStatus = atomic.NewBool(false)
HealthStatus is a global variable that indicates the health of the current process. This could either be "hey, I've started crawling and everything works fine" or "hey, I'm monitoring the network and all good".
Functions ¶
func ListenAndServe ¶
ListenAndServe starts an HTTP server and exposes prometheus and pprof metrics. It also exposes a health endpoint that can be probed with `ants health`.
func NewMeterProvider ¶
func NewMeterProvider() (metric.MeterProvider, error)
NewMeterProvider initializes a new opentelemetry meter provider that exports metrics using prometheus. To serve the prometheus endpoint call ListenAndServe down below.
func NewTracerProvider ¶
NewTracerProvider initializes a new tracer provider to send traces to the given host and port combination. If any of the two values is the zero value this function will return a no-op tracer provider which effectively disables tracing.
Types ¶
type Telemetry ¶
type Telemetry struct {
Tracer trace.Tracer
AntsCountGauge metric.Int64Gauge
TrackedRequestsCounter metric.Int64Counter
BulkInsertCounter metric.Int64Counter
BulkInsertSizeHist metric.Int64Histogram
BulkInsertLatencyMsHist metric.Int64Histogram
DroppedRequestsCounter metric.Int64Counter
ConnectCounter metric.Int64Counter
DisconnectCounter metric.Int64Counter
}
func NewTelemetry ¶
func NewTelemetry(tp trace.TracerProvider, mp metric.MeterProvider) (*Telemetry, error)