This document describes the observability capabilities currently landed in LingFrame.
LingFrame provides real-time event streams based on Server-Sent Events (SSE) via the Dashboard.
Endpoint: GET /lingframe/dashboard/stream
Currently Supported Event Types:
| Event Type | Description |
|---|---|
trace |
Invocation trace event |
audit |
Audit event |
lifecycle |
Lifecycle event |
circuit-breaker |
Circuit breaker state change |
leak-detection |
Leak detection event |
Usage Example:
const eventSource = new EventSource('/lingframe/dashboard/stream');
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Event:', data);
};JVM metric snapshots can be fetched via the Dashboard API:
Endpoint: GET /lingframe/dashboard/lings/metrics
Current Output Fields:
| Metric Category | Specific Metrics |
|---|---|
| CPU | System CPU usage, Process CPU load |
| Memory | Total memory, Heap, Non-heap, Metaspace |
| JVM | GC count/time, Class loading, Threads |
| System | System load |
Single Ling Health Snapshot:
GET /lingframe/dashboard/lings/{lingId}/health
All Lings Health Snapshot:
GET /lingframe/dashboard/lings/health/all
The response includes:
- A ling-level
summary - Version-level
versionslist
Covered fields include:
qpserrorRateavgLatencyMsp99LatencyMsactiveRequestshealthStatus
The Dashboard UI natively consumes and displays this data for overviews and version comparisons.
All Governance Signals:
GET /lingframe/dashboard/lings/governance/all
Currently observable points:
rateLimitedRequeststimeoutRequestscircuitOpenedCountcircuitOpenRejectionsbulkheadRejectedRequestsrecoveryCount
These similarly support a ling-level summary and version-level versions list.
Get Traffic Statistics for a Ling:
GET /lingframe/dashboard/lings/{lingId}/stats
Returns:
- Total request count
- Version routing counts
- Active requests
- The start timestamp of the statistical window
Reset Statistics:
POST /lingframe/dashboard/lings/{lingId}/stats/reset
lingframe-dashboard has an optional built-in Micrometer bridge.
When the host application provides a MeterRegistry, the following gauges will automatically be registered:
lingframe.ling.health.qpslingframe.ling.health.error_ratelingframe.ling.health.p99_latency_mslingframe.ling.health.active_requestslingframe.ling.version.health.qpslingframe.ling.version.health.error_ratelingframe.ling.governance.rate_limited_totallingframe.ling.governance.timeout_totallingframe.ling.governance.circuit_opened_totallingframe.ling.governance.circuit_rejected_total
Clarifications:
- LingFrame has prepared the metric bridging but does not force the host to adopt a specific monitoring backend.
- If the host imports
micrometer-registry-prometheusand exposes the actuator endpoint, these metrics can be scraped by Prometheus.
LingFrame features a built-in EventBus supporting two subscription modes:
Ling-Level Subscription (Cleaned up automatically when the ling is unloaded):
eventBus.subscribe(lingId, MyEvent.class, event -> {
// Process event
});Global Subscription (Used by framework-level components):
eventBus.subscribeGlobal(MyEvent.class, event -> {
// Process event
});Minimum requirements for integration:
- Host imports
spring-boot-starter-actuator - Host imports
micrometer-registry-prometheus - Host exposes
/actuator/prometheus
Example configuration:
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
prometheus:
enabled: trueThe example application lingframe-example-lingcore-app has already adopted this configuration and can be used directly as a scraping reference.
logging:
level:
root: INFO
com.lingframe: INFO
# Turn on during debugging:
com.lingframe.core.fsm: DEBUG
com.lingframe.core.pipeline: DEBUG
com.lingframe.core.classloader: DEBUGMethods annotated with @Auditable automatically generate audit logs:
@Auditable(action = "createOrder", resource = "order")
public OrderInfo createOrder(CreateOrderRequest request) {
// ...
}The Dashboard is currently the main interface for these observability capabilities. See the Dashboard Documentation for more details.