genericotel

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package genericotel receives OpenTelemetry metrics over OTLP/HTTP (JSON encoding) and converts them to canonical OmniDevX events, written directly to the local event store. It exists so AI coding agents with native OTel export (Claude Code, Codex CLI) can stream token usage and cost live, instead of relying on retrospective session-history imports that are subject to local retention limits.

Only the JSON encoding of OTLP is supported (configure exporters with OTEL_EXPORTER_OTLP_PROTOCOL=http/json); protobuf would require heavy dependencies that do not belong in omnidevx-core.

Metadata only: metric names, numeric values, models, session identifiers. No log bodies or content attributes are stored.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Store receives converted events. Required.
	Store *store.Store
	// Subject is stamped onto every event.
	Subject omnidevx.SubjectRef
	// OnWrite, when set, is called after each successful batch write.
	OnWrite func(result *store.WriteResult, service string)
}

Options configures a Receiver.

type Receiver

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

Receiver converts OTLP/JSON metric posts into canonical events.

func New

func New(opts Options) (*Receiver, error)

New returns a Receiver for the given options.

func (*Receiver) Handler

func (r *Receiver) Handler() http.Handler

Handler returns the HTTP handler exposing OTLP/HTTP endpoints: POST /v1/metrics (parsed) and POST /v1/logs (accepted and discarded, so exporters configured for both do not error).

Jump to

Keyboard shortcuts

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