Visualize and analyze distributed traces in OpenLIT platform with detailed span analysis and performance insights
openlit.init(tracer=tracer)
.
This integration ensures that OpenLIT utilizes your custom tracer settings, allowing for a unified tracing setup across your application.
Example:
OTEL_RESOURCE_ATTRIBUTES
environment variable allows you to provide additional OpenTelemetry resource attributes when starting your application with OpenLIT. OpenLIT already includes some default resource attributes:
telemetry.sdk.name: openlit
service.name: YOUR_SERVICE_NAME
deployment.environment: YOUR_ENVIRONMENT_NAME
OTEL_RESOURCE_ATTRIBUTES
variable. Your custom attributes will be added on top of the existing OpenLIT attributes, providing additional context to your telemetry data. Simply format your attributes as key1=value1,key2=value2
.
For example:
openlit.trace
, you get access to manually create traces, allowing you to record every process within a single function.
trace
function automatically groups any LLM function invoked within generate_one_liner
, providing you with organized groupings right out of the box.
You can do more with traces by running the start_trace
context generator:
trace.set_result('')
to set the final result of the trace and trace.set_metadata({})
to add custom metadata.
Full Example