metricsfx

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

README ΒΆ

ajan/metricsfx

Overview

metricsfx package provides a comprehensive metrics solution built on OpenTelemetry SDK, designed for modern observability pipelines. The package emphasizes OpenTelemetry collector integration as the preferred approach, while maintaining backward compatibility with direct Prometheus exports.

Key Features
  • 🎯 OpenTelemetry Collector Ready - Native OTLP export to unified pipelines
  • πŸ“Š Simplified Metrics Builder - Intuitive API for creating metrics
  • ⚑ High Performance - Optimized for production workloads
  • πŸ”„ Unified Observability - Works seamlessly with logfx and tracesfx
  • πŸŽ›οΈ Flexible Configuration - Multiple export options and custom intervals

Quick Start

Basic Usage with OpenTelemetry Collector
package main

import (
    "context"
    "time"

    "github.com/eser/ajan/metricsfx"
)

func main() {
    ctx := context.Background()

    // Configure for OpenTelemetry collector (recommended)
    config := &metricsfx.Config{
        ServiceName:    "my-service",
        ServiceVersion: "1.0.0",
        OTLPEndpoint:   "http://otel-collector:4318",
        OTLPInsecure:   true,
        ExportInterval: 30 * time.Second,
    }

    // Create provider with collector integration
    provider := metricsfx.NewMetricsProvider(config)
    if err := provider.Init(); err != nil {
        panic(err)
    }
    defer provider.Shutdown(ctx)

    // Create metrics using the builder
    builder := provider.NewBuilder()

    requestCounter, err := builder.Counter(
        "requests_total",
        "Total number of requests",
    ).WithUnit("{request}").Build()
    if err != nil {
        panic(err)
    }

    // Use metrics in your application
    requestCounter.Inc(ctx, metricsfx.StringAttr("endpoint", "/api/users"))
}
HTTP Integration with Correlation
package main

import (
    "context"
    "net/http"
    "time"

    "github.com/eser/ajan/httpfx"
    "github.com/eser/ajan/httpfx/middlewares"
    "github.com/eser/ajan/metricsfx"
)

func main() {
    ctx := context.Background()

    // Setup metrics with OpenTelemetry collector
    provider := metricsfx.NewMetricsProvider(&metricsfx.Config{
        ServiceName:    "api-service",
        ServiceVersion: "1.0.0",
        OTLPEndpoint:   "http://otel-collector:4318",
        ExportInterval: 15 * time.Second,
    })
    _ = provider.Init()
    defer provider.Shutdown(ctx)

    // Create HTTP metrics
    httpMetrics, _ := metricsfx.NewHTTPMetrics(provider, "api-service", "1.0.0")

    // Setup HTTP router with observability middleware
    router := httpfx.NewRouter("/api")
    router.Use(middlewares.CorrelationIDMiddleware())        // Request correlation
    router.Use(middlewares.MetricsMiddleware(httpMetrics))   // Automatic metrics

    router.Route("GET /users/{id}", func(ctx *httpfx.Context) httpfx.Result {
        // Custom business metrics
        httpMetrics.RequestsTotal.Inc(ctx.Request.Context(),
            metricsfx.StringAttr("operation", "get_user"),
            metricsfx.StringAttr("user_type", "premium"),
        )

        return ctx.Results.JSON(map[string]string{"status": "success"})
    })

    http.ListenAndServe(":8080", router.GetMux())
}

Configuration

type Config struct {
	// Service information for resource attribution
	ServiceName    string        `conf:"service_name"    default:""`
	ServiceVersion string        `conf:"service_version" default:""`

	// OpenTelemetry Collector configuration (preferred)
	OTLPEndpoint string        `conf:"otlp_endpoint" default:""`
	OTLPInsecure bool          `conf:"otlp_insecure" default:"true"`

	// Export interval for batching
	ExportInterval time.Duration `conf:"export_interval" default:"30s"`

	// Legacy direct exporters (still supported)
	PrometheusEndpoint string `conf:"prometheus_endpoint" default:""`
}
Export Priority

The package automatically chooses the best export method:

  1. πŸ₯‡ OTLP Collector (OTLPEndpoint) - Preferred for production
  2. πŸ₯ˆ Direct Prometheus (PrometheusEndpoint) - Legacy/fallback option
  3. Both can run simultaneously if needed

OpenTelemetry Collector Integration

Why Use OpenTelemetry Collector?

The collector provides a unified observability pipeline that offers significant advantages over direct exports:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 β”‚    β”‚                     β”‚    β”‚                 β”‚
β”‚   Your App      │───▢│ OpenTelemetry       │───▢│   Backends      β”‚
β”‚                 β”‚    β”‚ Collector           β”‚    β”‚                 β”‚
β”‚ β€’ metricsfx     β”‚    β”‚                     β”‚    β”‚ β€’ Prometheus    β”‚
β”‚ β€’ logfx         β”‚    β”‚ β€’ Receives all 3    β”‚    β”‚ β€’ Grafana       β”‚
β”‚ β€’ tracesfx      β”‚    β”‚   pillars (L+M+T)   β”‚    β”‚ β€’ DataDog       β”‚
β”‚                 β”‚    β”‚ β€’ Routes & filters  β”‚    β”‚ β€’ New Relic     β”‚
β”‚                 β”‚    β”‚ β€’ Transforms        β”‚    β”‚ β€’ Custom        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Benefits:

  • πŸ”„ Unified Pipeline - All observability data flows through one point
  • πŸŽ›οΈ Flexibility - Change backends without code changes
  • ⚑ Performance - Built-in batching, compression, and retries
  • πŸ’° Cost Optimization - Sampling and filtering before expensive exports
  • πŸ”§ Data Processing - Transform, enrich, and route telemetry data
// Production setup
config := &metricsfx.Config{
    ServiceName:    "my-service",
    ServiceVersion: "1.2.3",
    OTLPEndpoint:   "http://otel-collector:4318",
    OTLPInsecure:   false,  // Use TLS in production
    ExportInterval: 30 * time.Second,
}

// Development setup
devConfig := &metricsfx.Config{
    ServiceName:    "my-service",
    ServiceVersion: "dev",
    OTLPEndpoint:   "http://localhost:4318",
    OTLPInsecure:   true,
    ExportInterval: 5 * time.Second,  // Faster for development
}
Example Collector Configuration
# otel-collector-config.yaml
receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318
      grpc:
        endpoint: 0.0.0.0:4317

processors:
  batch:
    timeout: 10s
    send_batch_size: 1024

  resource:
    attributes:
      - key: environment
        value: production
        action: upsert

exporters:
  prometheus:
    endpoint: "0.0.0.0:8889"

  # Add other exporters as needed
  datadog:
    api:
      key: ${DD_API_KEY}

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [batch, resource]
      exporters: [prometheus, datadog]

Metrics Builder API

The simplified metrics builder provides an intuitive interface for creating metrics:

Counter Metrics
builder := provider.NewBuilder()

// Simple counter
requestCounter, err := builder.Counter(
    "requests_total",
    "Total number of HTTP requests",
).Build()

// Counter with unit
bytesCounter, err := builder.Counter(
    "bytes_processed_total",
    "Total bytes processed",
).WithUnit("byte").Build()

// Usage
requestCounter.Inc(ctx,
    metricsfx.StringAttr("method", "GET"),
    metricsfx.StringAttr("status", "200"),
)
Histogram Metrics
// Request duration with custom buckets
requestDuration, err := builder.Histogram(
    "request_duration_seconds",
    "HTTP request processing time",
).WithDurationBuckets().Build()

// Custom buckets
responseSizeHist, err := builder.Histogram(
    "response_size_bytes",
    "HTTP response sizes",
).WithBuckets([]float64{100, 1024, 10240, 102400}).Build()

// Usage
requestDuration.RecordDuration(ctx, duration,
    metricsfx.StringAttr("endpoint", "/api/users"),
)
Gauge Metrics
// Current active connections
activeConnections, err := builder.Gauge(
    "active_connections",
    "Number of active connections",
).Build()

// Memory usage
memoryUsage, err := builder.Gauge(
    "memory_usage_bytes",
    "Current memory usage",
).WithUnit("byte").Build()

// Usage
activeConnections.Set(ctx, 42,
    metricsfx.StringAttr("pool", "database"),
)

HTTP Metrics Integration

Automatic HTTP Metrics
// Create HTTP metrics
httpMetrics, err := metricsfx.NewHTTPMetrics(provider, "web-service", "1.0.0")
if err != nil {
    panic(err)
}

// Add to router - automatically tracks all requests
router.Use(middlewares.MetricsMiddleware(httpMetrics))

Automatically tracked metrics:

  • http_requests_total - Counter of HTTP requests by method, path, status code
  • http_request_duration_seconds - Histogram of request durations
Custom HTTP Metrics
router.Route("POST /users", func(ctx *httpfx.Context) httpfx.Result {
    // Track business-specific metrics
    httpMetrics.RequestsTotal.Inc(ctx.Request.Context(),
        metricsfx.StringAttr("operation", "create_user"),
        metricsfx.StringAttr("user_type", "premium"),
        metricsfx.StringAttr("plan", "enterprise"),
    )

    // Track custom durations
    start := time.Now()
    // ... business logic ...
    businessDuration := time.Since(start)

    businessTimer.RecordDuration(ctx.Request.Context(), businessDuration,
        metricsfx.StringAttr("operation", "user_creation"),
    )

    return ctx.Results.JSON(response)
})

Advanced Usage

Multiple Export Destinations
config := &metricsfx.Config{
    ServiceName:        "my-service",
    OTLPEndpoint:       "http://otel-collector:4318",  // Primary
    PrometheusEndpoint: "/metrics",                    // Direct fallback
    ExportInterval:     30 * time.Second,
}
Resource Attribution
// Metrics automatically include resource information
config := &metricsfx.Config{
    ServiceName:    "user-service",      // service.name
    ServiceVersion: "2.1.0",             // service.version
    OTLPEndpoint:   "http://collector:4318",
}

// All metrics will include these resource attributes automatically
Correlation with Logs and Traces

When used with the complete ajan observability stack:

// All using the same collector endpoint
observabilityConfig := struct {
    ServiceName  string
    ServiceVersion string
    OTLPEndpoint string
}{
    ServiceName:    "my-service",
    ServiceVersion: "1.0.0",
    OTLPEndpoint:   "http://otel-collector:4318",
}

// Metrics
metricsProvider := metricsfx.NewMetricsProvider(&metricsfx.Config{
    ServiceName:    observabilityConfig.ServiceName,
    ServiceVersion: observabilityConfig.ServiceVersion,
    OTLPEndpoint:   observabilityConfig.OTLPEndpoint,
})
_ = metricsProvider.Init()

// Logs (with automatic correlation)
logger := logfx.NewLogger(
    logfx.WithOTLP(observabilityConfig.OTLPEndpoint, false),
)

// All telemetry data flows to the same collector with:
// - Consistent resource attribution (service name/version)
// - Automatic correlation via trace context
// - HTTP correlation IDs in logs
// - Unified export pipeline

Error Handling

The metrics provider handles export failures gracefully:

provider := metricsfx.NewMetricsProvider(config)
if err := provider.Init(); err != nil {
    log.Printf("Failed to create metrics provider: %v", err)
    // Fallback to basic provider or handle appropriately
}

// Metrics continue to work even if exports fail
// Failures are logged but don't affect application performance

Migration from Direct Exports

Before (Direct Prometheus)
// Old approach - direct to Prometheus
config := &metricsfx.Config{
    PrometheusEndpoint: "/metrics",
}
After (OpenTelemetry Collector)
// New approach - unified pipeline
config := &metricsfx.Config{
    ServiceName:    "my-service",
    ServiceVersion: "1.0.0",
    OTLPEndpoint:   "http://otel-collector:4318",
}

The collector configuration handles routing to Prometheus and other backends without any application code changes!

Performance Characteristics

  • Low Overhead - Optimized for production workloads
  • Async Exports - Non-blocking metric collection
  • Batching - Efficient data transmission
  • Memory Efficient - Bounded resource usage
  • High Throughput - Suitable for high-traffic applications

Best Practices

  1. Use OpenTelemetry Collector for production deployments
  2. Set appropriate export intervals (15-60 seconds typically)
  3. Include resource attribution (service name/version)
  4. Use consistent labeling across metrics
  5. Monitor export health via collector metrics
  6. Combine with logfx for complete observability

Legacy Interface Reference

The package maintains backward compatibility with the original interface:

Types Overview

The package defines several key types for metrics collection:

type MetricsProvider struct {
    // Internal implementation
}

type MetricsBuilder struct {
    // Builder for creating metrics
}

// Metric types
type Counter interface { Inc(ctx context.Context, attrs ...attribute.KeyValue) }
type Histogram interface { Record(ctx context.Context, value float64, attrs ...attribute.KeyValue) }
type Gauge interface { Set(ctx context.Context, value float64, attrs ...attribute.KeyValue) }
Provider Creation
provider := metricsfx.NewMetricsProvider(config)

err := provider.Init()
if err != nil {
    log.Fatal("Failed to register metrics collectors:", err)
}

The documentation below provides additional details about the package types, functions, and usage examples. For more detailed information, refer to the source code and tests.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var (
	ErrFailedToCreateCounter   = errors.New("failed to create counter")
	ErrFailedToCreateGauge     = errors.New("failed to create gauge")
	ErrFailedToCreateHistogram = errors.New("failed to create histogram")
)
View Source
var (
	ErrFailedToCreateOTLPExporter       = errors.New("failed to create OTLP exporter")
	ErrFailedToCreatePrometheusExporter = errors.New("failed to create Prometheus exporter")
	ErrFailedToCreateResource           = errors.New("failed to create resource")
	ErrFailedToShutdownProvider         = errors.New("failed to shutdown metrics provider")
)

Functions ΒΆ

This section is empty.

Types ΒΆ

type Attribute ΒΆ added in v0.7.0

type Attribute = attribute.KeyValue

Attribute represents a key-value pair for metric attributes. This wraps OpenTelemetry's attribute.KeyValue to hide the dependency.

func BoolAttr ΒΆ added in v0.7.0

func BoolAttr(key string, value bool) Attribute

func ErrorAttrs ΒΆ added in v0.7.0

func ErrorAttrs(err error) []Attribute

ErrorAttrs creates common error attributes.

func Float64Attr ΒΆ added in v0.7.0

func Float64Attr(key string, value float64) Attribute

func GRPCAttrs ΒΆ added in v0.7.0

func GRPCAttrs(method, code string) []Attribute

GRPCAttrs creates common gRPC request attributes.

func GRPCMethodAttrs ΒΆ added in v0.7.0

func GRPCMethodAttrs(method string) []Attribute

GRPCMethodAttrs creates gRPC method attributes.

func HTTPAttrs ΒΆ added in v0.7.0

func HTTPAttrs(method, endpoint, status string) []Attribute

HTTPAttrs creates common HTTP request attributes.

func HTTPEndpointAttrs ΒΆ added in v0.7.0

func HTTPEndpointAttrs(endpoint string) []Attribute

HTTPEndpointAttrs creates HTTP endpoint attributes.

func HTTPMethodAttrs ΒΆ added in v0.7.0

func HTTPMethodAttrs(method string) []Attribute

HTTPMethodAttrs creates HTTP method attributes.

func Int64Attr ΒΆ added in v0.7.0

func Int64Attr(key string, value int64) Attribute

func IntAttr ΒΆ added in v0.7.0

func IntAttr(key string, value int) Attribute

func StatusAttrs ΒΆ added in v0.7.0

func StatusAttrs(status string) []Attribute

StatusAttrs creates status attributes.

func StringAttr ΒΆ added in v0.7.0

func StringAttr(key, value string) Attribute

Convenience functions for creating attributes without needing the builder.

func TypeAttrs ΒΆ added in v0.7.0

func TypeAttrs(typ string) []Attribute

TypeAttrs creates type attributes.

func WorkerAttrs ΒΆ added in v0.7.0

func WorkerAttrs(workerName string) []Attribute

WorkerAttrs creates common worker attributes.

func WorkerErrorAttrs ΒΆ added in v0.7.0

func WorkerErrorAttrs(workerName string, err error) []Attribute

WorkerErrorAttrs combines worker and error attributes.

type AttributeBuilder ΒΆ added in v0.7.0

type AttributeBuilder struct{}

AttributeBuilder provides methods to create metric attributes without exposing OpenTelemetry.

func NewAttributeBuilder ΒΆ added in v0.7.0

func NewAttributeBuilder() *AttributeBuilder

NewAttributeBuilder creates a new attribute builder.

func (*AttributeBuilder) Bool ΒΆ added in v0.7.0

func (ab *AttributeBuilder) Bool(key string, value bool) Attribute

Bool creates a boolean attribute.

func (*AttributeBuilder) Float64 ΒΆ added in v0.7.0

func (ab *AttributeBuilder) Float64(key string, value float64) Attribute

Float64 creates a float64 attribute.

func (*AttributeBuilder) Int ΒΆ added in v0.7.0

func (ab *AttributeBuilder) Int(key string, value int) Attribute

Int creates an integer attribute.

func (*AttributeBuilder) Int64 ΒΆ added in v0.7.0

func (ab *AttributeBuilder) Int64(key string, value int64) Attribute

Int64 creates an int64 attribute.

func (*AttributeBuilder) String ΒΆ added in v0.7.0

func (ab *AttributeBuilder) String(key, value string) Attribute

String creates a string attribute.

type Config ΒΆ added in v0.7.2

type Config struct {
	// Service information
	ServiceName    string `conf:"service_name"    default:""`
	ServiceVersion string `conf:"service_version" default:""`

	// OpenTelemetry Collector configuration (preferred)
	OTLPEndpoint string `conf:"otlp_endpoint" default:""`

	// Legacy direct exporters (still supported)
	PrometheusEndpoint string `conf:"prometheus_endpoint" default:""`

	// Export interval
	ExportInterval time.Duration `conf:"export_interval" default:"30s"`

	RegisterNativeCollectors bool `conf:"register_native_collectors" default:"true"`

	OTLPInsecure bool `conf:"otlp_insecure" default:"true"`
}

Config holds configuration for metrics export.

type CounterBuilder ΒΆ added in v0.7.0

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

CounterBuilder provides a fluent interface for building counter metrics.

func (*CounterBuilder) Build ΒΆ added in v0.7.0

func (cb *CounterBuilder) Build() (*CounterMetric, error)

Build creates the counter metric and returns a CounterMetric wrapper.

func (*CounterBuilder) WithUnit ΒΆ added in v0.7.0

func (cb *CounterBuilder) WithUnit(unit string) *CounterBuilder

WithUnit sets the unit for the counter.

type CounterMetric ΒΆ added in v0.7.0

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

CounterMetric wraps a counter with convenient methods.

func (*CounterMetric) Add ΒΆ added in v0.7.0

func (cm *CounterMetric) Add(ctx context.Context, value int64, attrs ...Attribute)

Add increments the counter by the given value with optional attributes.

func (*CounterMetric) Inc ΒΆ added in v0.7.0

func (cm *CounterMetric) Inc(ctx context.Context, attrs ...Attribute)

Inc increments the counter by 1 with optional attributes.

type GaugeBuilder ΒΆ added in v0.7.0

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

GaugeBuilder provides a fluent interface for building gauge metrics.

func (*GaugeBuilder) Build ΒΆ added in v0.7.0

func (gb *GaugeBuilder) Build() (*GaugeMetric, error)

Build creates the gauge metric and returns a GaugeMetric wrapper.

func (*GaugeBuilder) WithUnit ΒΆ added in v0.7.0

func (gb *GaugeBuilder) WithUnit(unit string) *GaugeBuilder

WithUnit sets the unit for the gauge.

type GaugeMetric ΒΆ added in v0.7.0

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

GaugeMetric wraps a gauge with convenient methods.

func (*GaugeMetric) Set ΒΆ added in v0.7.0

func (gm *GaugeMetric) Set(ctx context.Context, value int64, attrs ...Attribute)

Set sets the gauge value with optional attributes.

func (*GaugeMetric) SetBool ΒΆ added in v0.7.0

func (gm *GaugeMetric) SetBool(ctx context.Context, value bool, attrs ...Attribute)

SetBool sets the gauge to 1 for true, 0 for false with optional attributes.

type HistogramBuilder ΒΆ added in v0.7.0

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

HistogramBuilder provides a fluent interface for building histogram metrics.

func (*HistogramBuilder) Build ΒΆ added in v0.7.0

func (hb *HistogramBuilder) Build() (*HistogramMetric, error)

Build creates the histogram metric and returns a HistogramMetric wrapper.

func (*HistogramBuilder) WithBuckets ΒΆ added in v0.7.0

func (hb *HistogramBuilder) WithBuckets(buckets ...float64) *HistogramBuilder

WithBuckets sets custom bucket boundaries for the histogram.

func (*HistogramBuilder) WithDurationBuckets ΒΆ added in v0.7.0

func (hb *HistogramBuilder) WithDurationBuckets() *HistogramBuilder

WithDurationBuckets sets predefined duration buckets for the histogram.

func (*HistogramBuilder) WithUnit ΒΆ added in v0.7.0

func (hb *HistogramBuilder) WithUnit(unit string) *HistogramBuilder

WithUnit sets the unit for the histogram.

type HistogramMetric ΒΆ added in v0.7.0

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

HistogramMetric wraps a histogram with convenient methods.

func (*HistogramMetric) Record ΒΆ added in v0.7.0

func (hm *HistogramMetric) Record(ctx context.Context, value float64, attrs ...Attribute)

Record records a value in the histogram with optional attributes.

func (*HistogramMetric) RecordDuration ΒΆ added in v0.7.0

func (hm *HistogramMetric) RecordDuration(
	ctx context.Context,
	duration time.Duration,
	attrs ...Attribute,
)

RecordDuration records a duration in seconds with optional attributes.

type MetricsBuilder ΒΆ added in v0.7.0

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

MetricsBuilder provides a fluent interface for creating and managing metrics.

func NewMetricsBuilder ΒΆ added in v0.7.0

func NewMetricsBuilder(provider *MetricsProvider) *MetricsBuilder

NewMetricsBuilder creates a new metrics builder with the given meter and name prefix.

func (*MetricsBuilder) Counter ΒΆ added in v0.7.0

func (mb *MetricsBuilder) Counter(name, description string) *CounterBuilder

Counter creates a new counter metric.

func (*MetricsBuilder) Gauge ΒΆ added in v0.7.0

func (mb *MetricsBuilder) Gauge(name, description string) *GaugeBuilder

Gauge creates a new gauge metric.

func (*MetricsBuilder) Histogram ΒΆ added in v0.7.0

func (mb *MetricsBuilder) Histogram(name, description string) *HistogramBuilder

Histogram creates a new histogram metric.

type MetricsProvider ΒΆ

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

func NewMetricsProvider ΒΆ

func NewMetricsProvider(config *Config) *MetricsProvider

NewMetricsProvider creates a new metrics provider with the given configuration.

func (*MetricsProvider) Init ΒΆ added in v0.7.2

func (mp *MetricsProvider) Init() error

func (*MetricsProvider) NewBuilder ΒΆ added in v0.7.2

func (mp *MetricsProvider) NewBuilder() *MetricsBuilder

func (*MetricsProvider) Shutdown ΒΆ added in v0.7.0

func (mp *MetricsProvider) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the metrics provider.

Jump to

Keyboard shortcuts

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