Skip to main content

Crate aster_forge_metrics

Crate aster_forge_metrics 

Source
Expand description

Shared metrics recorder traits and subsystem registration primitives.

Applications often share the same infrastructure metrics while exposing different product-domain metrics. This crate keeps the common recorder surface small and provides a instance-owned provider so each subsystem can register the metrics it owns without forcing every product-specific method into a single shared trait. Concrete backends are selected once at the product entrypoint through Forge feature flags, so business modules record metric semantics without depending on exporter crates.

Macros§

product_metrics
Declare one typed schema and register it atomically against an explicit provider.

Structs§

DbQueryMetric
Product-neutral database query metric emitted by database adapters.
InfrastructureMetricsRecorder
MetricDescriptor
Static metric descriptor registered by a subsystem.
MetricHandle
MetricsLimits
Limits apply to each instance and cannot be overridden by SDK environment variables.
MetricsProvider
Clones share one instance; instruments always remain bound to their original instance.
MetricsProviderBuilder
Builder with independent pull and push capabilities. No global SDK provider is installed.
MetricsResource
Bounded deployment identity, separate from instrument labels and product IDs.
NoopDbMetrics
Metrics recorder that ignores every database query.
NoopMetrics
Metrics recorder that ignores every event.
OtlpExportDiagnostics
This snapshot is local and remains readable when the push destination fails.
OtlpExportSnapshot
OtlpMetricsConfig
Credentials and endpoint are deliberately omitted from Debug and errors.
ProductCounter
ProductGauge
ProductHistogram

Enums§

DbMetricBackend
Normalized database backend label used by infrastructure metrics.
DbQueryKind
Normalized database query kind used by infrastructure metrics.
MetricError
Stable, deliberately redacted errors: never contain labels or exporter credentials.
MetricKind
Kind of metric described by a subsystem.

Traits§

DbMetricsRecorder
Minimal metrics hook used by database connection helpers.
MetricsRecorder
Application-wide metrics recorder interface.

Type Aliases§

MetricResult
SharedDbMetricsRecorder
Shared trait object for database metrics recorders.
SharedMetricsRecorder
Shared trait object for application metrics recorders.