Skip to main content
In some situations, you may need to modify the observability level of your tracing. For instance, you may want to keep sensitive information from being logged for security reasons, or you may want to limit the size of the base64 encoded images logged to reduce payload size.

Environment Variables

The OpenInference Specification defines a set of environment variables you can configure to suit your observability needs:

Redacted Content

When content is hidden due to privacy configuration settings, the value "__REDACTED__" is used as a placeholder. This constant value allows consumers of the trace data to identify that content was intentionally hidden rather than missing or empty.

Usage

To set up this configuration you can either:
  • Set environment variables as specified above
  • Define the configuration in code as shown below
  • Do nothing and fall back to the default values
  • Use a combination of the three, the order of precedence is:
    • Values set in the TraceConfig in code
    • Environment variables
    • Default values

Python Configuration

If you are working in Python, and want to set up a configuration different than the default you can define the configuration in code as shown below, passing it to the instrument() method of your instrumentator:

JavaScript Configuration

If you are working in JavaScript, and want to set up a configuration different than the default you can define the configuration as shown below and pass it into any OpenInference instrumentation:

Privacy Best Practices

When working with sensitive data, always configure privacy controls before instrumenting your application to prevent accidental exposure of personal information.

Common Privacy Scenarios

Hide all user inputs and outputs:
Hide only message content, keep metadata:
Hide embeddings but keep model parameters:
Limit image data size: