instrumentation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var NoopMeasure = func(_ MetricType, _ MetricName, _ int64) {}

NoopMeasure no-op Measure function type.

Functions

func SetupPrometheusIntegrationConfig

func SetupPrometheusIntegrationConfig(ctx context.Context, agentMetricsEndpoint string) error

Types

type Instrumenter

type Instrumenter interface {
	GetHandler() http.Handler
	Measure(metricType MetricType, name MetricName, val int64)
	GetHttpTransport(base http.RoundTripper) http.RoundTripper
}

func New

func New() (Instrumenter, error)

New creates a new instrumentation bundle (exporter + measure fn...).

func NewNoop

func NewNoop() (exporter Instrumenter)

NewNoop creates a new no-op Instrumenter.

type Measure

type Measure func(metricType MetricType, name MetricName, val int64)

type MetricName

type MetricName int
const (
	DMRequestsForwarded MetricName = iota // integration payload received
	DMDatasetsReceived
	EntityRegisterEntitiesRegistered
	EntityRegisterEntitiesRegisteredWithWarning
	EntityRegisterEntitiesRegistrationFailed
	LoggedErrors
)

type MetricType

type MetricType int
const (
	Counter MetricType = iota
	Gauge
)

Jump to

Keyboard shortcuts

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