Index
All Classes and Interfaces|All Packages|Serialized Form
A
- aggregate(Collection) - Static method in enum class cloud.opencode.base.observability.health.HealthStatus
-
Aggregates a collection of statuses into a single worst-case status.
- allBaggage() - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Returns all baggage as an unmodifiable map.
- attach() - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Attaches this context to the current thread, returning a
ObservabilityContext.Scopethat restores the previous context when closed. - avgDuration() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Returns the value of the
avgDurationrecord component.
B
- baggage(String) - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Returns the baggage value for the given key.
C
- check() - Method in interface cloud.opencode.base.observability.health.HealthCheck
-
Executes the health check and returns the result.
- check() - Method in class cloud.opencode.base.observability.health.HealthRegistry
-
Executes all registered health checks and returns their results.
- clear() - Static method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Clears the current thread's observability context.
- clear() - Method in class cloud.opencode.base.observability.health.HealthRegistry
-
Removes all registered health checks.
- clear() - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Removes all registered metrics.
- clear() - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Clears all buffered slow log entries and resets the current-size counter.
- close() - Method in class cloud.opencode.base.observability.context.ObservabilityContext.Scope
-
Restores the previous context (or removes the current one if there was no previous).
- close() - Method in class cloud.opencode.base.observability.OpenTelemetryTracer
- close() - Method in interface cloud.opencode.base.observability.Span
-
Closes this span by calling
Span.end(). - close() - Method in interface cloud.opencode.base.observability.Tracer
-
Closes this tracer and releases any underlying resources.
- close() - Method in class cloud.opencode.base.observability.Tracer.NoopTracer
- cloud.opencode.base.observability - module cloud.opencode.base.observability
-
OpenCode Base Observability Module OpenCode 基础可观测性模块
- cloud.opencode.base.observability - package cloud.opencode.base.observability
- cloud.opencode.base.observability.context - package cloud.opencode.base.observability.context
- cloud.opencode.base.observability.exception - package cloud.opencode.base.observability.exception
- cloud.opencode.base.observability.health - package cloud.opencode.base.observability.health
- cloud.opencode.base.observability.metric - package cloud.opencode.base.observability.metric
- count() - Method in interface cloud.opencode.base.observability.metric.Counter
-
Returns the current count.
- count() - Method in interface cloud.opencode.base.observability.metric.Histogram
-
Returns the number of recorded values.
- count() - Method in interface cloud.opencode.base.observability.metric.Timer
-
Returns the number of recorded durations.
- count() - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Returns the total number of slow operations ever recorded (cumulative, never reset by clear).
- counter(String, Tag...) - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Registers or returns an existing counter.
- Counter - Interface in cloud.opencode.base.observability.metric
-
Counter - A monotonically increasing counter metric Counter - 单调递增的计数器指标
- create() - Static method in class cloud.opencode.base.observability.health.HealthRegistry
-
Creates a new empty
HealthRegistrywith the default limit (1000). - create() - Static method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Creates a registry with the default max metrics limit (10,000).
- create() - Static method in class cloud.opencode.base.observability.SlowLogCollector
-
Creates a collector with the default 10ms threshold and 1024 max entries.
- create(int) - Static method in class cloud.opencode.base.observability.health.HealthRegistry
-
Creates a new empty
HealthRegistrywith the specified limit. - create(int) - Static method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Creates a registry with the specified max metrics limit.
- create(String) - Static method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Creates a new context with the given trace ID and an auto-generated span ID.
- create(String) - Static method in class cloud.opencode.base.observability.OpenTelemetryTracer
-
Creates an
OpenTelemetryTracerfor the given service name. - create(String, String) - Static method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Creates a new context with the given trace ID and span ID.
- create(Duration) - Static method in class cloud.opencode.base.observability.SlowLogCollector
-
Creates a collector with the given threshold and the default 1024 max entries.
- create(Duration, int) - Static method in class cloud.opencode.base.observability.SlowLogCollector
-
Creates a collector with the given threshold and max entries.
- current() - Static method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Returns the current thread's observability context, or
nullif none is attached.
D
- degraded(String, String, Duration) - Static method in record class cloud.opencode.base.observability.health.HealthResult
-
Creates a DEGRADED result with a detail message.
- DEGRADED - Enum constant in enum class cloud.opencode.base.observability.health.HealthStatus
-
The component is partially healthy.
- detail() - Method in record class cloud.opencode.base.observability.health.HealthResult
-
Returns the value of the
detailrecord component. - down(String, String, Duration) - Static method in record class cloud.opencode.base.observability.health.HealthResult
-
Creates a DOWN result with a detail message.
- DOWN - Enum constant in enum class cloud.opencode.base.observability.health.HealthStatus
-
The component is unhealthy.
- duration() - Method in record class cloud.opencode.base.observability.health.HealthResult
-
Returns the value of the
durationrecord component.
E
- elapsed() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Returns the value of the
elapsedrecord component. - EMPTY - Static variable in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Empty stats instance returned when no slow operations have been recorded.
- end() - Method in interface cloud.opencode.base.observability.Span
-
Ends this span, recording its duration.
- Entry(String, String, Duration, Instant, String) - Constructor for record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Compact canonical constructor with null validation.
- equals(Object) - Method in class cloud.opencode.base.observability.context.ObservabilityContext
- equals(Object) - Method in record class cloud.opencode.base.observability.health.HealthResult
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class cloud.opencode.base.observability.metric.MetricId
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class cloud.opencode.base.observability.metric.MetricSnapshot
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class cloud.opencode.base.observability.metric.Tag
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Indicates whether some other object is "equal to" this one.
F
- find(String) - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Finds the first metric matching the given name.
G
- gauge(String, Supplier, Tag...) - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Registers or returns an existing gauge.
- Gauge - Interface in cloud.opencode.base.observability.metric
-
Gauge - A metric that reports a current value from a supplier Gauge - 从供应者报告当前值的指标
- getEntries() - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Returns all buffered slow log entries ordered from newest to oldest.
- getEntries(int) - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Returns up to
limitof the latest slow log entries.
H
- hashCode() - Method in class cloud.opencode.base.observability.context.ObservabilityContext
- hashCode() - Method in record class cloud.opencode.base.observability.health.HealthResult
-
Returns a hash code value for this object.
- hashCode() - Method in record class cloud.opencode.base.observability.metric.MetricId
-
Returns a hash code value for this object.
- hashCode() - Method in record class cloud.opencode.base.observability.metric.MetricSnapshot
-
Returns a hash code value for this object.
- hashCode() - Method in record class cloud.opencode.base.observability.metric.Tag
-
Returns a hash code value for this object.
- hashCode() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Returns a hash code value for this object.
- hashCode() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Returns a hash code value for this object.
- HealthCheck - Interface in cloud.opencode.base.observability.health
-
Functional interface for performing a health check.
- HealthRegistry - Class in cloud.opencode.base.observability.health
-
Registry for managing and executing health checks.
- HealthResult - Record Class in cloud.opencode.base.observability.health
-
Immutable result of a single health check execution.
- HealthResult(String, HealthStatus, String, Duration) - Constructor for record class cloud.opencode.base.observability.health.HealthResult
-
Compact constructor with validation.
- HealthStatus - Enum Class in cloud.opencode.base.observability.health
-
Enumeration of possible health check statuses.
- histogram(String, Tag...) - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Registers or returns an existing histogram.
- Histogram - Interface in cloud.opencode.base.observability.metric
-
Histogram - A metric for recording value distributions Histogram - 用于记录值分布的指标
I
- id() - Method in interface cloud.opencode.base.observability.metric.Counter
-
Returns the metric identifier.
- id() - Method in interface cloud.opencode.base.observability.metric.Gauge
-
Returns the metric identifier.
- id() - Method in interface cloud.opencode.base.observability.metric.Histogram
-
Returns the metric identifier.
- id() - Method in record class cloud.opencode.base.observability.metric.MetricSnapshot
-
Returns the value of the
idrecord component. - id() - Method in interface cloud.opencode.base.observability.metric.Timer
-
Returns the metric identifier.
- increment() - Method in interface cloud.opencode.base.observability.metric.Counter
-
Increments the counter by one.
- increment(long) - Method in interface cloud.opencode.base.observability.metric.Counter
-
Increments the counter by the given amount.
- isOtelAvailable() - Method in class cloud.opencode.base.observability.OpenTelemetryTracer
-
Returns whether OpenTelemetry API was detected on the classpath.
K
- key() - Method in record class cloud.opencode.base.observability.metric.Tag
-
Returns the value of the
keyrecord component. - key() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Returns the value of the
keyrecord component.
M
- max() - Method in interface cloud.opencode.base.observability.metric.Histogram
-
Returns the maximum recorded value.
- max() - Method in interface cloud.opencode.base.observability.metric.Timer
-
Returns the maximum recorded duration.
- maxDuration() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Returns the value of the
maxDurationrecord component. - maxEntries() - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Returns the configured maximum number of buffered entries.
- mean() - Method in interface cloud.opencode.base.observability.metric.Histogram
-
Returns the mean of all recorded values.
- mean() - Method in interface cloud.opencode.base.observability.metric.Timer
-
Returns the mean recorded duration.
- MetricId - Record Class in cloud.opencode.base.observability.metric
-
MetricId - Unique identifier for a metric, composed of name and tags MetricId - 指标的唯一标识符,由名称和标签组成
- MetricId(String, List) - Constructor for record class cloud.opencode.base.observability.metric.MetricId
-
Creates an instance of a
MetricIdrecord class. - MetricRegistry - Class in cloud.opencode.base.observability.metric
-
MetricRegistry - Central registry for creating and managing metrics MetricRegistry - 创建和管理指标的中央注册表
- MetricSnapshot - Record Class in cloud.opencode.base.observability.metric
-
MetricSnapshot - An immutable snapshot of a metric's current state MetricSnapshot - 指标当前状态的不可变快照
- MetricSnapshot(MetricId, String, Map) - Constructor for record class cloud.opencode.base.observability.metric.MetricSnapshot
-
Compact constructor with validation and defensive copy.
N
- name() - Method in record class cloud.opencode.base.observability.health.HealthResult
-
Returns the value of the
namerecord component. - name() - Method in record class cloud.opencode.base.observability.metric.MetricId
-
Returns the value of the
namerecord component. - names() - Method in class cloud.opencode.base.observability.health.HealthRegistry
-
Returns the names of all registered health checks.
- noop() - Static method in interface cloud.opencode.base.observability.Tracer
-
Returns a no-op Tracer that creates no-op spans with zero overhead.
- NOOP - Static variable in interface cloud.opencode.base.observability.Span
-
A shared no-op Span instance with zero overhead.
O
- ObservabilityContext - Class in cloud.opencode.base.observability.context
-
Thread-local observability context carrying trace ID, span ID, and baggage.
- ObservabilityContext.Scope - Class in cloud.opencode.base.observability.context
-
A scope that restores the previous
ObservabilityContextwhen closed. - ObservabilityException - Exception Class in cloud.opencode.base.observability.exception
-
ObservabilityException - Exception for observability component errors ObservabilityException - 可观测性组件异常
- ObservabilityException(String) - Constructor for exception class cloud.opencode.base.observability.exception.ObservabilityException
-
Creates an exception with message.
- ObservabilityException(String, String) - Constructor for exception class cloud.opencode.base.observability.exception.ObservabilityException
-
Creates an exception with error code and message.
- ObservabilityException(String, String, Throwable) - Constructor for exception class cloud.opencode.base.observability.exception.ObservabilityException
-
Creates an exception with error code, message and cause.
- ObservabilityException(String, Throwable) - Constructor for exception class cloud.opencode.base.observability.exception.ObservabilityException
-
Creates an exception with message and cause.
- of(String, Tag...) - Static method in record class cloud.opencode.base.observability.metric.MetricId
-
Creates a MetricId with the given name and optional tags.
- of(String, String) - Static method in record class cloud.opencode.base.observability.metric.Tag
-
Creates a new Tag with the given key and value.
- OpenTelemetryTracer - Class in cloud.opencode.base.observability
-
OpenTelemetry integration for operation tracing with graceful no-op fallback.
- operation() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Returns the value of the
operationrecord component.
P
- percentile(double) - Method in interface cloud.opencode.base.observability.metric.Histogram
-
Returns the value at the given percentile.
R
- record(double) - Method in interface cloud.opencode.base.observability.metric.Histogram
-
Records a value in the histogram.
- record(String, String, Duration) - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Records an operation if its elapsed time exceeds the configured threshold.
- record(Duration) - Method in interface cloud.opencode.base.observability.metric.Timer
-
Records the given duration.
- register(String, HealthCheck) - Method in class cloud.opencode.base.observability.health.HealthRegistry
-
Registers a health check under the given name, replacing any existing check with the same name.
- remove(MetricId) - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Removes the metric with the given id.
- reset() - Method in interface cloud.opencode.base.observability.metric.Counter
-
Resets the counter to zero.
S
- serviceName() - Method in class cloud.opencode.base.observability.OpenTelemetryTracer
-
Returns the configured service name.
- setAttribute(String, String) - Method in interface cloud.opencode.base.observability.Span
-
Sets a custom string attribute on this span.
- setError(Throwable) - Method in interface cloud.opencode.base.observability.Span
-
Records an error that occurred during this operation.
- setHit(boolean) - Method in interface cloud.opencode.base.observability.Span
-
Records whether this operation was a hit or a miss.
- size() - Method in class cloud.opencode.base.observability.health.HealthRegistry
-
Returns the number of registered health checks.
- size() - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Returns the number of registered metrics.
- slowestOperation() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Returns the value of the
slowestOperationrecord component. - SlowLogCollector - Class in cloud.opencode.base.observability
-
Bounded slow-operation log collector, inspired by Redis SLOWLOG.
- SlowLogCollector.Entry - Record Class in cloud.opencode.base.observability
-
A single slow log entry capturing details of a slow operation.
- SlowLogCollector.Stats - Record Class in cloud.opencode.base.observability
-
Aggregated statistics for recorded slow operations.
- snapshot() - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Returns a snapshot of all registered metrics.
- Span - Interface in cloud.opencode.base.observability
-
Represents a single trace span for an operation, supporting
AutoCloseablefor try-with-resources. - spanId() - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Returns the span ID.
- startSpan(String, String) - Method in class cloud.opencode.base.observability.OpenTelemetryTracer
- startSpan(String, String) - Method in class cloud.opencode.base.observability.Tracer.NoopTracer
- startSpan(String, String) - Method in interface cloud.opencode.base.observability.Tracer
-
Starts a new trace span for the given operation.
- stats() - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Computes aggregated statistics for all currently buffered entries.
- Stats(long, Duration, Duration, String) - Constructor for record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Creates an instance of a
Statsrecord class. - status() - Method in class cloud.opencode.base.observability.health.HealthRegistry
-
Computes the aggregated health status of all registered checks.
- status() - Method in record class cloud.opencode.base.observability.health.HealthResult
-
Returns the value of the
statusrecord component.
T
- Tag - Record Class in cloud.opencode.base.observability.metric
-
Tag - A key-value pair for metric dimensioning Tag - 用于指标维度化的键值对
- Tag(String, String) - Constructor for record class cloud.opencode.base.observability.metric.Tag
-
Compact constructor with validation.
- tags() - Method in record class cloud.opencode.base.observability.metric.MetricId
-
Returns the value of the
tagsrecord component. - threadName() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Returns the value of the
threadNamerecord component. - threshold() - Method in class cloud.opencode.base.observability.SlowLogCollector
-
Returns the configured slow operation threshold.
- time(Runnable) - Method in interface cloud.opencode.base.observability.metric.Timer
-
Times the given task and records its duration.
- time(Callable) - Method in interface cloud.opencode.base.observability.metric.Timer
-
Times the given callable task and records its duration.
- timer(String, Tag...) - Method in class cloud.opencode.base.observability.metric.MetricRegistry
-
Registers or returns an existing timer.
- Timer - Interface in cloud.opencode.base.observability.metric
-
Timer - A metric for measuring duration of operations Timer - 用于测量操作持续时间的指标
- timestamp() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Returns the value of the
timestamprecord component. - toString() - Method in class cloud.opencode.base.observability.context.ObservabilityContext
- toString() - Method in record class cloud.opencode.base.observability.health.HealthResult
-
Returns a string representation of this record class.
- toString() - Method in record class cloud.opencode.base.observability.metric.MetricId
-
Returns a string representation of this record class.
- toString() - Method in record class cloud.opencode.base.observability.metric.MetricSnapshot
-
Returns a string representation of this record class.
- toString() - Method in record class cloud.opencode.base.observability.metric.Tag
-
Returns a string representation of this record class.
- toString() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Entry
-
Returns a string representation of this record class.
- toString() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Returns a string representation of this record class.
- toString() - Method in class cloud.opencode.base.observability.Tracer.NoopTracer
- totalAmount() - Method in interface cloud.opencode.base.observability.metric.Histogram
-
Returns the total sum of all recorded values.
- totalSlowOps() - Method in record class cloud.opencode.base.observability.SlowLogCollector.Stats
-
Returns the value of the
totalSlowOpsrecord component. - totalTime() - Method in interface cloud.opencode.base.observability.metric.Timer
-
Returns the total recorded time.
- traceId() - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Returns the trace ID.
- Tracer - Interface in cloud.opencode.base.observability
-
Framework-agnostic tracing abstraction for creating
Spaninstances around operations. - Tracer.NoopTracer - Class in cloud.opencode.base.observability
-
No-op implementation of
Tracerwith zero overhead. - type() - Method in record class cloud.opencode.base.observability.metric.MetricSnapshot
-
Returns the value of the
typerecord component.
U
- unregister(String) - Method in class cloud.opencode.base.observability.health.HealthRegistry
-
Unregisters the health check with the given name.
- up(String, Duration) - Static method in record class cloud.opencode.base.observability.health.HealthResult
-
Creates an UP result with no detail.
- UP - Enum constant in enum class cloud.opencode.base.observability.health.HealthStatus
-
The component is healthy.
V
- value() - Method in interface cloud.opencode.base.observability.metric.Gauge
-
Returns the current gauge value.
- value() - Method in record class cloud.opencode.base.observability.metric.Tag
-
Returns the value of the
valuerecord component. - valueOf(String) - Static method in enum class cloud.opencode.base.observability.health.HealthStatus
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class cloud.opencode.base.observability.health.HealthStatus
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Method in record class cloud.opencode.base.observability.metric.MetricSnapshot
-
Returns the value of the
valuesrecord component.
W
- withBaggage(String, String) - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Returns a new context with an additional baggage entry.
- withSpanId(String) - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Returns a new context with the same trace ID and baggage but a different span ID.
- wrap(Runnable) - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Wraps a
Runnableto propagate this context when executed. - wrap(Callable) - Method in class cloud.opencode.base.observability.context.ObservabilityContext
-
Wraps a
Callableto propagate this context when executed.
All Classes and Interfaces|All Packages|Serialized Form