You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -70,6 +71,7 @@ The main configuration file follows this structure:
70
71
```yaml
71
72
appName: "onix-local"
72
73
log: {...}
74
+
metrics: {...}
73
75
http: {...}
74
76
pluginManager: {...}
75
77
modules: [...]
@@ -187,6 +189,120 @@ log:
187
189
188
190
---
189
191
192
+
## Application-Level Plugins Configuration
193
+
194
+
### `plugins`
195
+
**Type**: `object`
196
+
**Required**: No
197
+
**Description**: Application-level plugin configurations. These plugins apply to the entire application and are shared across all modules.
198
+
199
+
#### `plugins.otelsetup`
200
+
**Type**: `object`
201
+
**Required**: No
202
+
**Description**: OpenTelemetry configuration controlling whether the Prometheus exporter is enabled.
203
+
204
+
**Important**: This block is optional—omit it to run without telemetry. When present, the `/metrics` endpoint is exposed on a separate port (configurable via `metricsPort`) only if `enableMetrics: true`.
205
+
206
+
##### Parameters:
207
+
208
+
###### `id`
209
+
**Type**: `string`
210
+
**Required**: Yes
211
+
**Description**: Plugin identifier. Must be `"otelsetup"`.
212
+
213
+
###### `config`
214
+
**Type**: `object`
215
+
**Required**: Yes
216
+
**Description**: Plugin configuration parameters.
217
+
218
+
###### `config.enableMetrics`
219
+
**Type**: `string` (boolean)
220
+
**Required**: No
221
+
**Default**: `"true"`
222
+
**Description**: Enables metrics collection and the `/metrics` endpoint. Must be `"true"` or `"false"` as a string.
223
+
224
+
###### `config.serviceName`
225
+
**Type**: `string`
226
+
**Required**: No
227
+
**Default**: `"beckn-onix"`
228
+
**Description**: Sets the `service.name` resource attribute.
229
+
230
+
###### `config.serviceVersion`
231
+
**Type**: `string`
232
+
**Required**: No
233
+
**Description**: Sets the `service.version` resource attribute.
234
+
235
+
###### `config.environment`
236
+
**Type**: `string`
237
+
**Required**: No
238
+
**Default**: `"development"`
239
+
**Description**: Sets the `deployment.environment` attribute (e.g., `development`, `staging`, `production`).
240
+
241
+
###### `config.metricsPort`
242
+
**Type**: `string`
243
+
**Required**: No
244
+
**Default**: `"9090"`
245
+
**Description**: Port on which the metrics HTTP server will listen. The metrics endpoint is hosted on a separate server from the main application.
When `plugins.otelsetup.config.enableMetrics: "true"`, the metrics endpoint is hosted on a separate HTTP server. Scrape metrics at:
263
+
264
+
```
265
+
http://your-server:9090/metrics
266
+
```
267
+
268
+
**Note**: The metrics server runs on the port specified by `config.metricsPort` (default: `9090`), which is separate from the main application port configured in `http.port`.
269
+
270
+
### Metrics Collected
271
+
272
+
Metrics are organized by module for better maintainability and encapsulation:
273
+
274
+
#### OTel Setup (from `otelsetup` plugin)
275
+
- Prometheus exporter & `/metrics` endpoint on separate HTTP server
276
+
- Go runtime instrumentation (`go_*`), resource attributes, and meter provider wiring
- Go runtime metrics (`go_*`) and Redis instrumentation via `redisotel`
294
+
295
+
Each metric includes consistent labels such as `module`, `role`, `action`, `status`, `step`, `plugin_id`, and `schema_version` to enable low-cardinality dashboards.
296
+
297
+
**Note**: Metric definitions are now located in their respective modules:
- Optional metrics collection (available on separate port when enabled)
1048
1165
1049
1166
**Use Case**: Quick local development and testing
1050
1167
1051
1168
```yaml
1052
1169
appName: "onix-local"
1053
1170
log:
1054
1171
level: debug
1172
+
metrics:
1173
+
enabled: true
1174
+
exporterType: prometheus
1175
+
serviceName: onix-local
1055
1176
http:
1056
1177
port: 8081
1057
1178
modules:
@@ -1063,6 +1184,8 @@ modules:
1063
1184
config: {}
1064
1185
```
1065
1186
1187
+
**Metrics Access**: When enabled, access metrics at `http://localhost:9090/metrics` (default metrics port, configurable via `plugins.otelsetup.config.metricsPort`)
1188
+
1066
1189
### 2. Local Development (Vault Mode)
1067
1190
1068
1191
**File**: `config/local-dev.yaml`
@@ -1096,10 +1219,21 @@ modules:
1096
1219
- Production Redis
1097
1220
- Remote plugin loading
1098
1221
- Pub/Sub integration
1222
+
- OpenTelemetry metrics enabled (available on separate port, default: 9090)
1099
1223
1100
1224
**Use Case**: Single deployment serving both roles
1101
1225
1102
1226
```yaml
1227
+
appName: "onix-production"
1228
+
log:
1229
+
level: info
1230
+
destinations:
1231
+
- type: stdout
1232
+
metrics:
1233
+
enabled: true
1234
+
exporterType: prometheus
1235
+
serviceName: beckn-onix
1236
+
serviceVersion: "1.0.0"
1103
1237
pluginManager:
1104
1238
root: /app/plugins
1105
1239
remoteRoot: /mnt/gcs/plugins/plugins_bundle.zip
@@ -1122,6 +1256,9 @@ modules:
1122
1256
topic: bapNetworkReciever
1123
1257
```
1124
1258
1259
+
**Metrics Access**:
1260
+
- Prometheus scraping: `http://your-server:9090/metrics`(default metrics port, configurable via `plugins.otelsetup.config.metricsPort`)
- `docs/METRICS_RUNBOOK.md`– runbook with PromQL recipes & troubleshooting
105
+
70
106
### 🌐 **Multi-Domain Support**
71
107
- **Retail & E-commerce**: Product search, order management, fulfillment tracking
72
108
- **Mobility Services**: Ride-hailing, public transport, vehicle rentals
@@ -356,6 +392,15 @@ modules:
356
392
| POST | `/bpp/receiver/*` | Receives all BAP requests |
357
393
| POST | `/bpp/caller/on_*` | Sends responses back to BAP |
358
394
395
+
### Observability Endpoints
396
+
397
+
| Method | Endpoint | Description |
398
+
|--------|----------|-------------|
399
+
| GET | `/health` | Health check endpoint |
400
+
| GET | `/metrics` | Prometheus metrics endpoint (when telemetry is enabled) |
401
+
402
+
**Note**: The `/metrics` endpoint is available when `telemetry.enableMetrics: true` in the configuration file. It returns metrics in Prometheus format.
403
+
359
404
## Documentation
360
405
361
406
- **[Setup Guide](SETUP.md)**: Complete installation, configuration, and deployment instructions
0 commit comments