#598 - Fix service observability doc

This commit is contained in:
Mayuresh Nirhali
2026-01-21 14:09:06 +05:30
parent 208102c2d6
commit 0f95a8bb97
2 changed files with 33 additions and 26 deletions

View File

@@ -64,29 +64,8 @@ The **Beckn Protocol** is an open protocol that enables location-aware, local co
### 📊 **Observability** ### 📊 **Observability**
- **Structured Logging**: JSON-formatted logs with contextual information - **Structured Logging**: JSON-formatted logs with contextual information
- **Transaction Tracking**: End-to-end request tracing with unique IDs - **Transaction Tracking**: End-to-end request tracing with unique IDs
- **OpenTelemetry Metrics**: Pull-based metrics exposed via `/metrics` - **OpenTelemetry Metrics**: Performance and business metrics collection
- RED metrics for every module and action (rate, errors, duration) - **Runtime Instrumentation**: Go runtime + Redis client metrics included
- Per-step histograms with error attribution
- Cache, routing, plugin, and business KPIs (signature/schema validations, Beckn messages)
- Native Prometheus exporter with Grafana dashboards & alert rules (`monitoring/`)
- Opt-in: add a `plugins.otelsetup` block in your config to wire the `otelsetup` plugin; omit it to run without metrics. Example:
```yaml
plugins:
otelsetup:
id: otelsetup
config:
serviceName: "beckn-onix"
serviceVersion: "1.0.0"
enableMetrics: "true"
environment: "development"
```
- **Modular Metrics Architecture**: Metrics are organized by module for better maintainability:
- OTel SDK wiring via `otelsetup` plugin
- Step execution metrics in `telemetry` package
- Handler metrics (signature, schema, routing) in `handler` module
- Cache metrics in `cache` plugin
- **Runtime Instrumentation**: Go runtime + Redis client metrics baked in
- **Health Checks**: Liveness and readiness probes for Kubernetes - **Health Checks**: Liveness and readiness probes for Kubernetes
#### Monitoring Quick Start #### Monitoring Quick Start

View File

@@ -12,9 +12,10 @@ This comprehensive guide walks you through setting up Beckn-ONIX from developmen
6. [GUI Component Setup](#gui-component-setup) 6. [GUI Component Setup](#gui-component-setup)
7. [Docker Deployment](#docker-deployment) 7. [Docker Deployment](#docker-deployment)
8. [Kubernetes Deployment](#kubernetes-deployment) 8. [Kubernetes Deployment](#kubernetes-deployment)
9. [Testing Your Setup](#testing-your-setup) 9. [Service Observability](#service-ob)
10. [Troubleshooting](#troubleshooting) 10. [Testing Your Setup](#testing-your-setup)
11. [Sample Payloads](#sample-payloads) 11. [Troubleshooting](#troubleshooting)
12. [Sample Payloads](#sample-payloads)
--- ---
@@ -1344,6 +1345,33 @@ autoscaling:
--- ---
## Service Observability
- Pull-based metrics exposed via `/metrics`
- RED metrics for every module and action (rate, errors, duration)
- Per-step histograms with error attribution
- Cache, routing, plugin, and business KPIs (signature/schema validations, Beckn messages)
- Native Prometheus exporter with Grafana dashboards & alert rules (`monitoring/`)
- Opt-in: add a `plugins.otelsetup` block in your config to wire the `otelsetup` plugin; omit it to run without metrics. Example:
```yaml
plugins:
otelsetup:
id: otelsetup
config:
serviceName: "beckn-onix"
serviceVersion: "1.0.0"
enableMetrics: "true"
environment: "development"
```
### Modular Metrics Architecture**:
Metrics are organized by module for better maintainability:
- OTel SDK wiring via `otelsetup` plugin
- Step execution metrics in `telemetry` package
- Handler metrics (signature, schema, routing) in `handler` module
- Cache metrics in `cache` plugin
---
## Testing Your Setup ## Testing Your Setup
### Health Check ### Health Check