Trace Level Metadata
Add metadata as key-value pairs for your real-time trace logs
Users can add custom information to real-time traces, if needed. While open telemetry data is logged automatically, customer-specific metadata can be attached to individual traces on the go. This can be done using dedicated functions as follows.
Step 1: Define Metadata Fields
When initializing the RagaAI Catalyst tracer in your application, define the various metadata fields (key-value) you might require through the course of the complete flow. Only fields defined here can be edited further in the code.
In the above example, "name", "age", and "company" are the three metadata fields defined, which can be assigned values for each individual trace going ahead.
Step 2: Update Metadata Fields
Using the add_metadata
method, users can update one or more metadata fields as shown:
This function can be called right before your LLM call to update the values as required. When the LLM call is successful and the trace is uploaded onto the RagaAI Catalyst platform, these fields will show as different columns, with default values wherever not set.
Note: If metadata fields are not set explicitly for each trace (as shown above), the respective columns will be populated with default values set during initialization. Values are only set at the trace level and do not persist once a trace is uploaded successfully.
Last updated
Was this helpful?