telemetry

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package telemetry provides OpenTelemetry metric instruments for yaad.

All instruments are created lazily on first use via the global Meter. If no OTel exporter is configured, the default no-op implementation is used (zero overhead). To export metrics, configure an OTel SDK MeterProvider before calling any yaad functions.

Index

Constants

This section is empty.

Variables

View Source
var HNSWSearchCount, _ = meter.Int64Counter(
	"yaad.hnsw.search.count",
	metric.WithDescription("Total HNSW searches performed"),
	metric.WithUnit("{search}"),
)

HNSWSearchCount counts HNSW searches.

View Source
var HNSWSearchDuration, _ = meter.Float64Histogram(
	"yaad.hnsw.search.duration",
	metric.WithDescription("HNSW approximate nearest-neighbor search duration in seconds"),
	metric.WithUnit("s"),
	metric.WithExplicitBucketBoundaries(0.0001, 0.0005, 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5),
)

HNSWSearchDuration records HNSW nearest-neighbour search latency.

View Source
var HTTPRequestCount, _ = meter.Int64Counter(
	"yaad.http.request.count",
	metric.WithDescription("Total HTTP requests"),
	metric.WithUnit("{request}"),
)

HTTPRequestCount counts total HTTP requests, labelled by method, path, and status code.

View Source
var HTTPRequestDuration, _ = meter.Float64Histogram(
	"yaad.http.request.duration",
	metric.WithDescription("HTTP request duration in seconds"),
	metric.WithUnit("s"),
	metric.WithExplicitBucketBoundaries(0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10),
)

HTTPRequestDuration records the latency of HTTP requests, labelled by method, path, and status code.

View Source
var MemoryFusedRecallDuration, _ = meter.Float64Histogram(
	"yaad.memory.fused_recall.duration",
	metric.WithDescription("Memory FusedRecall (multi-signal search) duration in seconds"),
	metric.WithUnit("s"),
	metric.WithExplicitBucketBoundaries(0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5),
)

MemoryFusedRecallDuration records how long FusedRecall takes.

View Source
var MemoryRecallDuration, _ = meter.Float64Histogram(
	"yaad.memory.recall.duration",
	metric.WithDescription("Memory Recall (search) operation duration in seconds"),
	metric.WithUnit("s"),
	metric.WithExplicitBucketBoundaries(0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5),
)

MemoryRecallDuration records how long Recall (search) takes.

View Source
var MemoryRememberDuration, _ = meter.Float64Histogram(
	"yaad.memory.remember.duration",
	metric.WithDescription("Memory Remember (save) operation duration in seconds"),
	metric.WithUnit("s"),
	metric.WithExplicitBucketBoundaries(0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5),
)

MemoryRememberDuration records how long Remember takes (save operation).

View Source
var MemoryRetrieveDuration, _ = meter.Float64Histogram(
	"yaad.memory.retrieve.duration",
	metric.WithDescription("Memory Retrieve (GetNode) operation duration in seconds"),
	metric.WithUnit("s"),
	metric.WithExplicitBucketBoundaries(0.0005, 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1),
)

MemoryRetrieveDuration records how long single-node retrieval takes (GetNode).

View Source
var SQLiteQueryCount, _ = meter.Int64Counter(
	"yaad.sqlite.query.count",
	metric.WithDescription("Total SQLite queries executed"),
	metric.WithUnit("{query}"),
)

SQLiteQueryCount counts SQLite queries, labelled by operation name.

View Source
var SQLiteQueryDuration, _ = meter.Float64Histogram(
	"yaad.sqlite.query.duration",
	metric.WithDescription("SQLite query duration in seconds"),
	metric.WithUnit("s"),
	metric.WithExplicitBucketBoundaries(0.0001, 0.0005, 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1),
)

SQLiteQueryDuration records individual SQLite query latency.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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