Prompt Chain

Trace LLM Provider Operations with OpenTelemetry

Python example demonstrating OpenTelemetry integration with Promptfoo to trace LLM provider operations during evaluations using protobuf format.

Works with pythonopentelemetry

87
Spark score
out of 100
Updated 3 months ago
Version 1.0.0

Add to Favorites

Why it matters

Integrate OpenTelemetry with Python to trace and analyze the internal operations of your LLM providers during Promptfoo evaluations. Optimize your LLM performance by understanding execution flow and identifying bottlenecks.

Outcomes

What it gets done

01

Set up OpenTelemetry tracing for Python LLM provider interactions.

02

Export trace data using the efficient protobuf format.

03

Analyze LLM evaluation performance with detailed operational insights.

04

Debug and optimize LLM provider execution within Promptfoo.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-python | bash

Capabilities

What this chain does

Generate code

Writes source code or scripts from a description.

Debug

Traces errors to their root cause and suggests fixes.

Review code

Analyzes code for bugs, style issues, and improvements.

Write tests

Creates unit, integration, or end-to-end test cases.

Overview

Python

What it does

A Python implementation example showing OpenTelemetry integration with Promptfoo for tracing LLM provider operations using protobuf export format.

How it connects

Use this when you want to add OpenTelemetry tracing to your Promptfoo evaluations in Python and need to trace internal operations of LLM providers using the efficient protobuf format.

Source README

This example demonstrates how to use OpenTelemetry with Python to trace the internal operations of your LLM providers during Promptfoo evaluations. It uses the protobuf format for trace export, which is the default and most efficient format for the Python OpenTelemetry SDK.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.