Enable Observability for NeMo Guardrails#
To enable observability for the guardrail executions in the NeMo Guardrails microservice, you need an OTLP-compatible backend that receives the OpenTelemetry traces. You can update your Helm chart to either use the provided OpenTelemetry collector or configure it to use your own collector.
Option 1: Use the Provided OpenTelemetry Collector#
The NeMo Guardrails Helm chart includes an optional OpenTelemetry collector service that can be deployed as a separate pod alongside the service. To enable it, update your values.yaml
file:
guardrails:
# -- Whether to enable OpenTelemetry for the NeMo Guardrails microservice.
otelExporterEnabled: true
# -- Configuration for the "opentelemetry-collector" service.
opentelemetry-collector:
enabled: true
The following is the default guardrails.opentelemetry-collector
configuration. The guardrails.opentelemetry-collector.enabled
field is set to false
by default.
Change it to true
to enable the OpenTelemetry collector.
You can override the default configuration in the guardrails.opentelemetry-collector.config
section as needed. Use the OpenTelemetry Collector values file as a reference.
guardrails:
opentelemetry-collector:
enabled: false
mode: deployment
config:
receivers:
otlp:
protocols:
grpc: {}
http:
cors:
allowed_origins:
- "*"
exporters:
debug:
verbosity: detailed
processors:
batch: {}
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
processors: [batch]
metrics:
receivers: [otlp]
exporters: [debug]
processors: [batch]
logs:
receivers: [otlp]
exporters: [debug]
processors: [batch]
Verify the Collector Is Running#
You can verify the default Collector is running ready to accept connections by ensuring the opentelmetry-collector
pod was deployed in your Kubernetes namespace.
kubectl get pods -n <your_namespace>
Verify the opentelemetry-collector
pod’s status is “Running”.
NAME READY STATUS RESTARTS AGE
nemo-opentelemetry-collector-7f6856896d-w99sk 1/1 Running 0 2d6h
Option 2: Use Your Own Collector#
If you have an existing OpenTelemetry infrastructure, you can configure the NeMo Guardrails service to export telemetry data to your collector. In the values.yaml
file, set the OTEL_EXPORTER_OTLP_ENDPOINT
environment variable in the guardrails.otelEnvVars
section.
guardrails:
# -- Whether to enable OpenTelemetry for the NeMo Guardrails microservice.
otelExporterEnabled: true
# -- OpenTelemetry environment configuration variables for the NeMo Guardrails microservice.
otelEnvVars:
OTEL_EXPORTER_OTLP_ENDPOINT: "<your-endpoint>"