Conversation
| self.span_start_time: float = 0.0 | ||
| print(f"[DataDogTracer] Initialized for service: {service}") | ||
|
|
||
| def start_span(self, name: str, **attributes) -> Any: |
There was a problem hiding this comment.
Who is responsible for calling this method?
There was a problem hiding this comment.
Agent-Lightning's Runner calls this automatically.
The call flow is:
- Runner.step() begins → calls tracer.start_span()
- Agent executes and calls agl.emit_reward()→ triggers tracer.add_event()
- Runner.step()` completes → calls tracer.end_span()
There was a problem hiding this comment.
The runner doesn't call those methods automatically as far as I can remember.
There was a problem hiding this comment.
youre right - the tracer methods aren't called automatically by Runner.
Looking at the existing examples (apo, calc_x, etc.), I see the pattern now:
The tracer is passed to LitAgentRunner and used within runner.run_context(). The Runner manages the tracer lifecycle during runner.step() calls.
Let me revise the DataDog example to follow the correct pattern shown in apo_debug.py and calc_agent.py
‘’’
runner = agl.LitAgentRunner(DataDogTracer())
with runner.run_context(agent=my_agent, store=store):
await runner.step(task, resources=resources)
‘’’
|
revised the example acc to changes mentioned |
|
I'm not sure I understood why and how this tracer works since it didn't even implement the core abstract methods of tracer. Could you show some proof (screenshots or whatever) to prove it works in action? |
As discussed on PR #358 and PR #353 :
Add DataDog integration example
Shows how to plug Agent-Lightning into DataDog APM for production monitoring.
What it does: