Documentation ¶
Index ¶
- Constants
- func ConfiguredCollectors() []prometheus.Collector
- func ConstructOTELMeterProvider(ctx context.Context, r *resource.Resource, reg prometheus.Registerer, ...) (*metricsdk.MeterProvider, func() error, error)
- func ConstructOTELResource(ctx context.Context, serviceName, version string) (*resource.Resource, error)
- func ConstructOTELTracingTools(ctx context.Context, r *resource.Resource, ...) (trace.TracerProvider, propagation.TextMapPropagator, func() error, error)
- func ConstructPromMeterTooling() (*prometheus.Registry, *http.ServeMux)
- func InstrumentHandlerFuncWithOpts(strip StripFunc, addMetrics AdditionalMetricsFunc) gin.HandlerFunc
- func NewDefaultMeter(mp *metricsdk.MeterProvider) metric.Meter
- func NewSubSpan(ctx context.Context, spanName string, spanKind trace.SpanKind) (context.Context, trace.Span)
- func NoOpAdditionalMetricsFunc(_ *http.Request, _, _, _ string)
- func NoOpStripFunc(str string) string
- func PrometheusMiddleware(next http.Handler, strip StripFunc, addMetrics AdditionalMetricsFunc) http.Handler
- func SetupLogger(logLevel string) (*zap.SugaredLogger, func(), zap.Config)
- type AdditionalMetricsFunc
- type StripFunc
Constants ¶
View Source
const (
ScopeName = "gitlab.com/gitlab-org/opstrace/opstrace/go/pkg/instrumentation"
)
Variables ¶
This section is empty.
Functions ¶
func ConfiguredCollectors ¶
func ConfiguredCollectors() []prometheus.Collector
func ConstructOTELMeterProvider ¶
func ConstructOTELMeterProvider( ctx context.Context, r *resource.Resource, reg prometheus.Registerer, otlpEndpoint, otlpCACertificate, otlpTokenSecretFile string, ) (*metricsdk.MeterProvider, func() error, error)
func ConstructOTELResource ¶
func ConstructOTELTracingTools ¶
func ConstructOTELTracingTools( ctx context.Context, r *resource.Resource, otlpEndpoint, otlpCACertificateFile, otlpTokenSecretFile string, ) ( trace.TracerProvider, propagation.TextMapPropagator, func() error, error, )
func ConstructPromMeterTooling ¶
func ConstructPromMeterTooling() (*prometheus.Registry, *http.ServeMux)
func InstrumentHandlerFuncWithOpts ¶
func InstrumentHandlerFuncWithOpts(strip StripFunc, addMetrics AdditionalMetricsFunc) gin.HandlerFunc
InstrumentHandlerFuncWithOpts is similar to PrometheusMiddleware but returns a gin specific middleware. This is only to be used as a middleware and uses the same metrics in use by its http.Handler counterpart.
func NewDefaultMeter ¶
func NewDefaultMeter(mp *metricsdk.MeterProvider) metric.Meter
func NewSubSpan ¶
func NoOpStripFunc ¶
NoOpStripFunc is a placeholder for strip function if path is to be kept as is
func PrometheusMiddleware ¶
func SetupLogger ¶
func SetupLogger(logLevel string) (*zap.SugaredLogger, func(), zap.Config)
Types ¶
type AdditionalMetricsFunc ¶
AdditionalMetricsFunc should be a helper method to add additional metrics derived from the request.
Click to show internal directories.
Click to hide internal directories.