runtimeapiprocess

package
v0.0.0-...-804b954 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Package runtimeapiprocess composes the separately runnable public API role from explicit operator configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(config Config, lookup SecretLookup) error

Check validates the strict declaration and required injected values without binding a listener or contacting dependencies.

func CheckWithTelemetry

func CheckWithTelemetry(config Config, lookup SecretLookup, providers TelemetryProviders) error

CheckWithTelemetry validates the strict declaration and explicit telemetry composition without binding a listener or contacting dependencies.

func Run

func Run(ctx context.Context, config Config, lookup SecretLookup, ready func(string)) error

Run starts the public API role and blocks until cancellation or server failure.

func RunWithExportingTelemetry

func RunWithExportingTelemetry(ctx context.Context, config Config, lookup SecretLookup, ready func(string)) error

RunWithExportingTelemetry starts the API with its declared paired OTLP telemetry pipeline and flushes it during process shutdown.

func RunWithTelemetry

func RunWithTelemetry(ctx context.Context, config Config, lookup SecretLookup, providers TelemetryProviders, ready func(string)) error

RunWithTelemetry starts the public API role with explicit OpenTelemetry provider composition and blocks until cancellation or server failure.

func Serve

func Serve(ctx context.Context, config Config, lookup SecretLookup, listener net.Listener) error

Serve runs the role on an already-owned listener so process tests need no timing guesses.

func ServeWithTelemetry

func ServeWithTelemetry(ctx context.Context, config Config, lookup SecretLookup, providers TelemetryProviders, listener net.Listener) error

ServeWithTelemetry runs the API role with explicit OpenTelemetry provider composition on an already-owned listener.

Types

type Config

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

Config is a validated immutable runtime API process declaration.

func Parse

func Parse(input io.Reader) (Config, error)

Parse decodes exactly one strict, versioned process declaration.

func (Config) HasOTLPExporter

func (config Config) HasOTLPExporter() bool

HasOTLPExporter reports whether this exact declaration opts into the explicit paired exporter path. It never reads ambient environment settings.

type ExportingTelemetry

type ExportingTelemetry struct {
	Providers TelemetryProviders
	// contains filtered or unexported fields
}

ExportingTelemetry owns paired OTLP providers for one API process. It uses an explicit in-cluster gRPC target, no ambient exporter environment, no headers, and no credential configuration.

func NewExportingTelemetry

func NewExportingTelemetry(ctx context.Context, endpoint string) (*ExportingTelemetry, error)

NewExportingTelemetry creates the paired OTLP trace and metric exporters. Call Shutdown after RunWithTelemetry returns so both pipelines flush their bounded pending batches before the process exits.

func (*ExportingTelemetry) Shutdown

func (telemetry *ExportingTelemetry) Shutdown(ctx context.Context) error

Shutdown flushes traces then metrics without exposing transport failures or endpoint data through logs. The first failure is returned only to the local process supervisor.

type SecretLookup

type SecretLookup func(string) (string, bool)

SecretLookup resolves only explicitly named, injected environment values at composition time.

type TelemetryProviders

type TelemetryProviders struct {
	MeterProvider  metric.MeterProvider
	TracerProvider trace.TracerProvider
}

TelemetryProviders supplies the OpenTelemetry SDK composition for the API process. A caller either supplies both providers, including any configured exporters, or leaves both nil to use the process-wide OpenTelemetry providers. Endpoints, headers, and credentials deliberately do not cross this seam.

Jump to

Keyboard shortcuts

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