traceloop / traceloop/openllmetry

🚀 Feature: log variable names in prompts

Open
#389 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.4k
Forks
1.1k
Avg merge
8d 14h
Merged PRs (30d)
2

Description

Which component is this feature for?

OpenAI Instrumentation

🔖 Feature description

Want to log a variable's value in the trace of llm. Where llm is called from a async task. Currently the association_properties are shared by all the tasks.
So basically a way to report a variable's value.

🎤 Why is this feature needed ?

To add more details to the LLM trace that are specific to each llm call made in the same context.

✌️ How do you aim to achieve this?

Give a way to log variables inside a llm traces. This should only be set for local scope of the function or the linked functions/processes. Should not be updated globally.

🔄️ Additional Information

I tried setting the association_properties within each task those were called from a common parent. But the variable's value was getting overwritten globally. Each time I was getting the most recent value.

👀 Have you spent some time to check if this feature request has been raised before?
  • I checked and didn't find similar issue
Are you willing to submit PR?

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the OpenAI Instrumentation code that handles association_properties and trace creation, then examine how values flow across async tasks. Done means a variable can be recorded for an individual LLM call or linked task without overwriting values in sibling tasks or global state.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.