Beckn ONIX Observability and Telemetry Setup
Beckn ONIX Observability and Telemetry Setup
1. Overview
This document explains how to enable and validate the observability stack for Beckn ONIX, including Grafana, Prometheus, Loki, Jaeger, Zipkin, and the OpenTelemetry collectors for BAP, BPP, and new BPP onboarding.
It covers:
Starting the observability stack
Changing the Grafana port to avoid conflict with the OAN UI
Creating separate BAP and BPP adapter policy/config files
Enabling telemetry for seeker and weather provider adapters
Extending telemetry setup for a new BPP such as knowledge-advisory
2. Start the Observability Stack
Go to:
cd /home/ubuntu/beckn-onix/install/network-observability/all-in-one
2.1 Update Grafana Port
Because Grafana conflicts with the OAN UI port, update the Grafana port in:
install/network-observability/all-in-one/docker-compose.yml
Replace the Grafana service configuration with the following:
grafana: image: grafana/grafana:latest container_name: grafana environment: - GF_SECURITY_ADMIN_USER=admin - GF_SECURITY_ADMIN_PASSWORD=admin - GF_USERS_ALLOW_SIGN_UP=false - GF_SERVER_ROOT_URL=http://localhost:3003 volumes: - grafana_data:/var/lib/grafana - ./grafana/provisioning:/etc/grafana/provisioning:ro ports: - "3003:3000" networks: - observability restart: unless-stopped depends_on: - prometheus - jaeger - zipkin - loki
2.2 Start the Observability Services
Run:
docker compose up -d otel-collector-bap otel-collector-bpp otel-collector-network loki prometheus jaeger zipkin grafana
3. Correct the BAP and BPP Adapter Configuration
A previous issue occurred while starting the BPP. The setup should have used separate policy/config YAML files for BAP and BPP. We are now creating the BPP-specific file with no major functional changes.
3.1 Update config/local-simple.yaml
In:
config/local-simple.yaml
update the otelsetup plugin as follows:
plugins: otelsetup: id: otelsetup config: serviceName: "oan-seeker-onix" serviceVersion: "1.0.0" enableMetrics: "true" environment: "development" domain: "weather-forecast:oan:kenya" enableMetrics: "true" networkMetricsGranularity: "2min" networkMetricsFrequency: "4min" enableTracing: "true" enableLogs: "true" timeInterval: "5" auditFieldsConfig: "./config/audit-fields.yaml" otlpEndpoint: "otel-collector-bap:4317" cacheTTL: "3600"
3.2 Create config/local-simple-bpp.yaml
Create a duplicate of:
config/local-simple.yaml
as:
config/local-simple-bpp.yaml
Use the same contents, with the following BPP-specific settings.
Full BPP configuration
appName: "onix-local" log: level: debug destinations: - type: stdout contextKeys: - transaction_id - message_id - subscriber_id - module_id plugins: otelsetup: id: otelsetup config: serviceName: "weather-bpp-onix" serviceVersion: "1.0.0" enableMetrics: "true" environment: "development" domain: "weather-forecast:oan:kenya" enableMetrics: "true" networkMetricsGranularity: "2min" networkMetricsFrequency: "4min" enableTracing: "true" enableLogs: "true" timeInterval: "5" auditFieldsConfig: "./config/audit-fields.yaml" otlpEndpoint: "otel-collector-bpp:4317" cacheTTL: "3600" http: port: 8081 timeout: read: 30 write: 30 idle: 30 pluginManager: root: ./plugins modules: - name: bapTxnReceiver path: /bap/receiver/ handler: type: std role: bap subscriberId: bap-network httpClientConfig: maxIdleConns: 1000 maxIdleConnsPerHost: 200 idleConnTimeout: 300s responseHeaderTimeout: 5s plugins: registry: id: registry config: url: http://registry:3030/subscribers retry_max: 3 retry_wait_min: 100ms retry_wait_max: 500ms keyManager: id: simplekeymanager config: networkParticipant: bap-network keyId: bap-network-key signingPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8=" signingPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4=" encrPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8=" encrPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4=" cache: id: cache config: addr: redis:6379 schemaValidator: id: schemavalidator config: schemaDir: ./schemas signValidator: id: signvalidator signer: id: signer router: id: router config: routingConfig: ./config/local-simple-routing-BAPReceiver.yaml checkPolicy: id: opapolicychecker config: networkPolicyConfig: ./config/opa-network-policies.yaml refreshInterval: "5m" middleware: - id: reqpreprocessor config: contextKeys: transaction_id,message_id role: bap steps: - validateSign - checkPolicy - addRoute - signAck - name: bapTxnCaller path: /bap/caller/ handler: type: std role: bap httpClientConfig: maxIdleConns: 1000 maxIdleConnsPerHost: 200 idleConnTimeout: 300s responseHeaderTimeout: 5s plugins: registry: id: registry config: url: http://registry:3030/subscribers retry_max: 3 retry_wait_min: 100ms retry_wait_max: 500ms keyManager: id: simplekeymanager config: networkParticipant: bap-network keyId: bap-network-key signingPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8=" signingPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4=" encrPrivateKey: "B0e6TLBQRxQWx0rlXD2LvdIydNFeSR93I2Z13jPIGl8=" encrPublicKey: "6qOGduDX3gvFP7XWpPBnh0mlx+xvAVZRYfIsU3nZEH4=" cache: id: cache config: addr: redis:6379 router: id: router config: routingConfig: ./config/local-simple-routing-BAPCaller.yaml signer: id: signer middleware: - id: reqpreprocessor config: contextKeys: transaction_id,message_id role: bap steps: - addRoute - sign - name: bppTxnReceiver path: /bpp/receiver/ handler: type: std role: bpp httpClientConfig: maxIdleConns: 1000 maxIdleConnsPerHost: 200 idleConnTimeout: 300s responseHeaderTimeout: 5s plugins: registry: id: registry config: url: http://registry:3030/subscribers retry_max: 3 retry_wait_min: 100ms retry_wait_max: 500ms keyManager: id: simplekeymanager config: networkParticipant: bpp-network keyId: bpp-network-key signingPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw=" signingPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE=" encrPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw=" encrPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE=" cache: id: cache config: addr: redis:6379 schemaValidator: id: schemavalidator config: schemaDir: ./schemas signValidator: id: signvalidator signer: id: signer router: id: router config: routingConfig: ./config/local-simple-routing-BPPReceiver.yaml checkPolicy: id: opapolicychecker config: networkPolicyConfig: ./config/opa-network-policies.yaml refreshInterval: "5m" steps: - validateSign - checkPolicy - addRoute - signAck - name: bppTxnCaller path: /bpp/caller/ handler: type: std role: bpp subscriberId: bpp-network httpClientConfig: maxIdleConns: 1000 maxIdleConnsPerHost: 200 idleConnTimeout: 300s responseHeaderTimeout: 5s plugins: registry: id: registry config: url: http://registry:3030/subscribers retry_max: 3 retry_wait_min: 100ms retry_wait_max: 500ms keyManager: id: simplekeymanager config: subscriberId: bpp-network networkParticipant: bpp-network keyId: bpp-network-key signingPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw=" signingPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE=" encrPrivateKey: "csDesDASs5rb18s/etNea5IW3ruNGDi5Ksedk6iNsFw=" encrPublicKey: "8izVJpQUU01xpjAPJOho+bg9ViB3u5sMl/CDe1x7uXE=" cache: id: cache config: addr: redis:6379 router: id: router config: routingConfig: ./config/local-simple-routing-BPPCaller.yaml signer: id: signer steps: - addRoute - sign
The only change here is:
otlpEndpoint: "otel-collector-bpp:4317"
serviceName: "weather-bpp-onix"
4. Restart the BAP and BPP ONIX Adapters
These adapters are used by seeker (OAN UI) and the weather provider BPP.
Stop and remove the existing containers:
docker stop bap-onix-adapter docker rm bap-onix-adapter docker stop bpp-onix-adapter docker rm bpp-onix-adapter
Run the BPP adapter:
docker run -p 8081:8081 \ -v $(pwd)/config:/app/config \ -v $(pwd)/schemas:/app/schemas \ -e CONFIG_FILE="/app/config/local-simple-bpp.yaml" \ -e OTEL_EXPORTER_OTLP_INSECURE="true" \ --network=beckn_network \ -d \ --name bpp-onix-adapter \ fidedocker/onix-adapter
Run the BAP adapter:
docker run -p 8080:8081 \ -v $(pwd)/config:/app/config \ -v $(pwd)/schemas:/app/schemas \ -e CONFIG_FILE="/app/config/local-simple.yaml" \ -e OTEL_EXPORTER_OTLP_INSECURE="true" \ --network=beckn_network \ -d \ --name bap-onix-adapter \ fidedocker/onix-adapter
5. View Grafana Dashboards
Now you can either tunnel the Grafana port 3003 or create a domain for Grafana.
5.1 Access Grafana
Open Grafana.
Log in using:
Username: admin Password: admin
Click Dashboards.
View the readily available dashboards.
5.2 Drilldown Views
In Grafana:
Go to Drilldown > Metrics to view detailed metrics.
Go to Drilldown > Logs to view container logs.
Go to Explore.
Select Jaeger as the data source.
Select a service.
Click Run Query.
6. View Jaeger
You can tunnel the Jaeger port 16686 or create a domain for Jaeger.
This allows you to inspect traces generated by the ONIX adapters and the observability stack.
7. Enable Telemetry for a New BPP
The same telemetry pattern can be extended to newly onboarded BPPs such as knowledge-advisory.
7.1 Create a New Collector Directory
Duplicate:
install/network-observability/all-in-one/otel-collector-bpp
and rename it to:
install/network-observability/all-in-one/otel-collector-knowledge-bpp
7.2 Update the New Collector Config
Update:
install/network-observability/all-in-one/otel-collector-knowledge-bpp/config.yaml
Change:
observability: otel-collector-bpp
to:
observability: otel-collector-knowledge-bpp
and change:
service_name: beckn-one-bpp
to:
service_name: knowledge-bpp
8. Add the New Collector to docker-compose.yml
In:
install/network-observability/all-in-one/docker-compose.yml
add the following service:
otel-collector-knowledge-bpp: image: otel/opentelemetry-collector-contrib:latest container_name: otel-collector-knowledge-bpp command: ["--config=/etc/otel/config.yaml"] volumes: - ./otel-collector-knowledge-bpp/config.yaml:/etc/otel/config.yaml:ro ports: - "4331:4317" - "4332:4318" - "8892:8891" networks: - observability - beckn_network restart: unless-stopped depends_on: - otel-collector-network
Start the new collector:
docker compose up -d otel-collector-knowledge-bpp
9. Update the Knowledge BPP ONIX Configuration
Go to the cloned Beckn ONIX setup for the knowledge BPP and update the telemetry configuration.
9.1 Update config/local-simple.yaml
Update the otelsetup block as follows:
otelsetup: id: otelsetup config: serviceName: "knowledge-bpp-onix" serviceVersion: "1.0.0" enableMetrics: "true" environment: "development" domain: "knowledge-advisory:oan:kenya" enableMetrics: "true" networkMetricsGranularity: "2min" networkMetricsFrequency: "4min" enableTracing: "true" enableLogs: "true" timeInterval: "5" auditFieldsConfig: "./config/audit-fields.yaml" otlpEndpoint: "otel-collector-knowledge-bpp:4317" cacheTTL: "3600"
10. Update install/docker-compose-adapter.yml
In:
install/docker-compose-adapter.yml
update the ONIX adapter service as follows:
onix-adapter: image: fidedocker/onix-adapter container_name: bpp-k-adapter platform: linux/amd64 networks: - beckn_network ports: - "8083:8081" environment: CONFIG_FILE: "/app/config/local-simple.yaml" VAULT_ADDR: http://vault:8200 VAULT_TOKEN: root REDIS_ADDR: redis:6379 RABBITMQ_ADDR: rabbitmq:5672 RABBITMQ_USER: admin RABBITMQ_PASS: admin123 OTEL_EXPORTER_OTLP_INSECURE: "true" volumes: - ../config:/app/config - ../schemas:/app/schemas command: ["./server", "--config=/app/config/local-simple.yaml"]
The important addition is:
OTEL_EXPORTER_OTLP_INSECURE: "true"
Restart the service:
docker compose -f docker-compose-adapter.yml up -d --force-recreate onix-adapter
11. Validation Checklist
After completing the setup, verify the following:
Grafana is accessible on port 3003.
Grafana login works with admin / admin.
Dashboards are visible under Dashboards.
Metrics are visible under Drilldown > Metrics.
Logs are visible under Drilldown > Logs.
Jaeger is reachable on port 16686.
BAP telemetry is pointing to otel-collector-bap:4317.
BPP telemetry is pointing to otel-collector-bpp:4317.
Knowledge BPP telemetry is pointing to otel-collector-knowledge-bpp:4317.
The new ONIX adapter starts successfully after recreation.
Last updated