-
Notifications
You must be signed in to change notification settings - Fork 878
feat: Add OTel auto-instrumentation for Python and TypeScript scripts (EE) #7513
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
base: main
Are you sure you want to change the base?
Conversation
… (EE)
Add OpenTelemetry auto-instrumentation as an enterprise feature that
automatically instruments Python and TypeScript scripts to collect traces.
Backend changes:
- Add database migration for job_otel_traces table to store trace spans
- Add otel_auto_instrumentation_oss.rs with OSS stub implementation
- Inject OTel environment variables in Python, Bun, and Deno executors
- Add API endpoint GET /api/w/{workspace}/jobs/get_otel_traces/{id}
- Add OTEL_AUTO_INSTRUMENTATION_SETTING constant
Frontend changes:
- Add OTel auto-instrumentation settings in instance settings (OTEL/Prom tab)
- Add JobOtelTraces.svelte component for viewing traces
- Add "Traces" tab to job details page
When enabled, scripts using OpenTelemetry libraries will automatically
send traces to a built-in collector. Traces are stored in the database
and can be viewed in the job details.
Closes #7512
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Deploying windmill with
|
| Latest commit: |
dc5811b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7645a04f.windmill.pages.dev |
| Branch Preview URL: | https://claude-issue-7512-20260107-0.windmill.pages.dev |
|
/ai implement the otel_auto_instrumentation_ee.rs file, it will be splitted manually later by us. Also write a test that uses bun and fetch to test that the trace specific to the fetch call is properly stored. You will likely have to inject an otel auto instrumentation library in the ts wrapper file. |
|
Claude finished @rubenfiszel's task in 16m 14s —— View job Implementation Complete ✅I've implemented the OTel auto-instrumentation feature for Windmill. Here's a summary of the changes: Changes Made1. Enterprise Backend Implementation (
2. Bun OTel Loader (
3. Bun Executor Integration (
4. Dependencies (
5. Bug Fix (
TestingAll 7 unit tests pass:
Both OSS and Enterprise builds compile successfully. How it WorksWhen a script runs with OTel auto-instrumentation enabled:
NoteThe EE implementation file ( |
- Add otel_bun_loader.js for automatic fetch span tracing in Bun scripts - Inject OTel loader via -r flag when WINDMILL_OTEL_AUTO_INSTRUMENTATION is set - Add prost and axum as optional enterprise dependencies for OTLP parsing - Fix ansible_executor.rs compilation warnings for OSS build 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
/ai make otel_auto_instrumentation_ee.rs -> otel_auto_instrumentation_eee.rs so that it's not ignored for now and write the implementation |
|
Claude finished @rubenfiszel's task in 6m 46s —— View job Task: Rename and Implement OTel Auto-Instrumentation EE File
SummaryI've implemented the OTel auto-instrumentation EE module. Since the gitignore pattern Created
Updated imports in:
Both OSS and Enterprise builds compile successfully ✅ |
…rumentation_impl.rs) - Create full EE implementation with config caching from global_settings - Add environment variable generation for Python and TypeScript scripts - Add OTLP JSON trace parsing with resource/span attribute extraction - Add built-in HTTP collector server using Axum - Add database storage for spans in job_otel_traces table - Include comprehensive unit tests - Update imports in bun_executor, deno_executor, python_executor - Update OSS stub to re-export from impl module when enterprise feature enabled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Ruben Fiszel <[email protected]>
Summary
This PR implements OTel auto-instrumentation as an enterprise feature per issue #7512:
Database migration: Adds
job_otel_tracestable to store OpenTelemetry trace spans with all standard span fields (trace_id, span_id, parent_span_id, operation_name, status, attributes, events, etc.)Backend OSS stub: Creates
otel_auto_instrumentation_oss.rswith stub implementations that return empty results in the open-source versionEnvironment variable injection: Modifies Python, Bun, and Deno executors to inject OTel environment variables (
OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_SERVICE_NAME,OTEL_RESOURCE_ATTRIBUTES, etc.) when auto-instrumentation is enabledAPI endpoint: Adds
GET /api/w/{workspace}/jobs/get_otel_traces/{id}endpoint to retrieve traces for a specific jobFrontend settings: Adds OTel auto-instrumentation configuration in instance settings (OTEL/Prom tab) with toggles for:
Traces viewer: Adds new "Traces" tab in job details page with timeline visualization showing span duration, status, and expandable details
Architecture Notes
The EE implementation (
otel_auto_instrumentation_ee.rs) is gitignored and provides:Test plan
Closes #7512
🤖 Generated with Claude Code