Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

During Eval Agent trace ids are 00000000000000000000000000000000 #136

Closed
jlewi opened this issue May 30, 2024 · 2 comments · Fixed by #138
Closed

During Eval Agent trace ids are 00000000000000000000000000000000 #136

jlewi opened this issue May 30, 2024 · 2 comments · Fixed by #138

Comments

@jlewi
Copy link
Owner

jlewi commented May 30, 2024

In #133 we added code to link eval results to the generate trace. The key here was to return the trace id from the Agent prediction.
However, it looks like the trace id ends up being 00000000000000000000000000000000

Here's an example log message

2024-05-30T15:36:38.079-0700    INFO    agent/agent.go:114      Agent.Generate returning response       {"traceId": "00000000000000000000000000000000", "evalMode": true, "response": {"blocks": [{"kind": "MARKUP", "language": "", "contents": "To get the ids of the execution traces for block `01HZ0W9X2XF914XMG6REX1WVWG`, you can use the following command:", "outputs": [], "trace_ids": [], "id": "01HZ5TBS9ZCPKVRTZCYYFT1HJB"}, {"kind": "CODE", "language": "bash", "contents": "curl http://localhost:8080/api/blocklogs/01HZ0W9X2XF914XMG6REX1WVWG | jq .execTraceIds ", "outputs": [], "trace_ids": [], "id": "01HZ5TBS9ZCPKVRTZCZ23PYSPD"}, {"kind": "MARKUP", "language": "", "contents": "Please execute this command to retrieve the ids of the execution traces for the specified block. Let me know if you need any further assistance!", "outputs": [], "trace_ids": [], "id": "01HZ5TBS9ZCPKVRTZCZ4NCMW0V"}], "trace_id": "00000000000000000000000000000000"}}

I suspect the problem is that we aren't setting up the OTEL trace provider during evaluation.
I think we need to call

func (a *App) SetupOTEL() error {

@jlewi
Copy link
Owner Author

jlewi commented May 30, 2024

It looks like that isn't the problem. It looks like no span is defined so we get
a noopspan. I suspect this is because we are calling it as a library function and not as an RPC.

@jlewi
Copy link
Owner Author

jlewi commented May 30, 2024

It seems like there are two possible ways we could potentially deal with this

  1. Inside Agent.Generate we could start a new span if no span is set

    • We can't test for a noopspan because that's private
    • I think we can test if its recording
  2. In the Eval code we could create initialize a trace and add it to the context

I think I like the second idea better. Its cleaner and it also allows us to link together all the processing in the evaluator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant