otel

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

README

metrics/processors/otel

Import path: github.com/InsideGallery/core/metrics/processors/otel

This package registers the OpenTelemetry metrics processor. It records metrics through the global OpenTelemetry meter provider and does not configure an exporter by itself.

Main APIs

  • ProcessorName is the registration name: otel.
  • New(cfg metrics.Config, service string) creates the processor and is registered from init.

Usage

package main

import (
	_ "github.com/InsideGallery/core/metrics/processors/otel"

	"github.com/InsideGallery/core/metrics"
)

func newMetrics() (*metrics.Client, error) {
	cfg, err := metrics.GetEnvConfig()
	if err != nil {
		return nil, err
	}

	return metrics.New(cfg, "api")
}

Run with METRICS_PROCESSORS=otel after configuring the process OpenTelemetry meter provider.

Configuration

The package reads the METRICS_OTEL prefix:

  • METRICS_OTEL_METER_NAME: meter name, default github.com/InsideGallery/core/metrics.

Blank meter names fall back to the default. Metric names are sanitized before instrument creation. Attributes always include service=<service> plus sorted tags. Tags in key:value form become attributes, spaces in keys become underscores, and loose tags are recorded under the tag attribute key.

Live integration tests are gated by PTOLEMY_METRICS_OTEL_INTEGRATION=1.

Documentation

Index

Constants

View Source
const ProcessorName = "otel"

ProcessorName is the registration name for the OpenTelemetry metrics processor.

Variables

This section is empty.

Functions

func New

func New(_ metrics.Config, service string) (metrics.Processor, error)

New creates an OpenTelemetry metrics processor using the global meter provider.

Types

This section is empty.

Jump to

Keyboard shortcuts

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