Skip to content

feat: Add automatic AST-based tracing for Gentrace API#316

Draft
viveknair wants to merge 6 commits intonextfrom
vivek/auto-tracing
Draft

feat: Add automatic AST-based tracing for Gentrace API#316
viveknair wants to merge 6 commits intonextfrom
vivek/auto-tracing

Conversation

@viveknair
Copy link
Contributor

@viveknair viveknair commented Jun 7, 2025

TLDR

Adds automatic AST-based function tracing to Gentrace API for seamless instrumentation

Summary

This PR introduces an automatic tracing feature that uses Abstract Syntax Tree (AST) analysis to automatically instrument all functions in specified modules without requiring manual decoration. This simplifies the process of adding observability to Python applications using Gentrace.

Key Changes

  • Removed CLAUDE.md guidelines file
  • Added new auto_trace example demonstrating automatic AST-based tracing
  • Implemented pipeline ID support for automatic tracing
  • Created example application showing multi-layer function call tracing
  • Added comprehensive documentation for the auto-tracing feature

Impact

  • Examples: New auto-trace example added to demonstrate the feature
  • Documentation: New README added for auto-tracing guidance
  • API: Introduces automatic instrumentation capabilities to the Gentrace Python SDK

Testing Considerations

  • Verify automatic function instrumentation works across different module structures
  • Test pipeline ID association with auto-traced functions
  • Ensure deep function call trees are properly traced
  • Validate that environment variables (GENTRACE_API_KEY, GENTRACE_PIPELINE_ID, OPENAI_API_KEY) are correctly handled

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 this pull request may close these issues.

1 participant