Mask Span Attributes
There are scenarios where adjusting the observability level of your tracing is necessary. For example, you might want to prevent sensitive data from being logged for security purposes, or you might aim to reduce the payload size by limiting the size of base64 encoded images logged.
The traceAI Specification provides a set of environment variables that you can configure to meet your observability requirements. Additionally, the traceAI auto-instrumentors allow you to specify a trace configuration directly in your code, eliminating the need to set environment variables if you prefer.
The available settings include:
Environment Variable Name | Description | Type | Default |
---|---|---|---|
FI_HIDE_INPUTS | Hides input values, all input messages, and embedding input text | bool | False |
FI_HIDE_OUTPUTS | Hides output values and all output messages | bool | False |
FI_HIDE_INPUT_MESSAGES | Hides all input messages and embedding input text | bool | False |
FI_HIDE_OUTPUT_MESSAGES | Hides all output messages | bool | False |
FI_HIDE_INPUT_IMAGES | Hides images from input messages | bool | False |
FI_HIDE_INPUT_TEXT | Hides text from input messages and input embeddings | bool | False |
FI_HIDE_OUTPUT_TEXT | Hides text from output messages | bool | False |
FI_HIDE_EMBEDDING_VECTORS | Hides returned embedding vectors | bool | False |
FI_BASE64_IMAGE_MAX_LENGTH | Hides the character count of a base64 encoded image | int | 32,000 |
To configure these settings, you can:
- Set the environment variables as outlined above
- Define the configuration within your code as demonstrated below
- Opt for the default values by taking no action
You can use a combination of these methods, with the following order of precedence:
- Values defined in the TraceConfig within your code
- Environment variables
- Default values
Below is an example of how to configure these settings in code using our OpenAI Python instrumentor. This configuration is applicable to all of our auto-instrumentors.