feat: add control plane event tracking#149
Merged
datasciencemonkey merged 2 commits intomainfrom Apr 29, 2026
Merged
Conversation
Adds SDK User-Agent based event tracking so CoDA usage appears on the
shared Labs usage dashboard. Events fire in background daemon threads
and never block Flask request handling or terminal I/O.
Active events tracked:
- app_startup (initialize_app)
- agent session creation with agent type (create_session)
- file_upload (upload_file)
- pat_rotation (_rotate_once)
- workspace_sync (sync_project)
Passive: all existing WorkspaceClient instances now carry product_info
('coda', version) so regular SDK calls also identify CoDA.
Reference: https://github.com/databrickslabs/dqx/blob/main/src/databricks/labs/dqx/telemetry.py
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clusters.select_spark_version()Control Plane Events
Active Events (explicit
log_telemetry()calls)eventapp_startupapp.py:initialize_app()agentclaude|codex|gemini|opencode|hermes|shellapp.py:create_session()eventfile_uploadapp.py:upload_file()eventpat_rotationpat_rotator.py:_rotate_once()eventworkspace_syncsync_to_workspace.py:sync_project()~/projects/Passive Events (product_info on existing SDK calls)
All existing
WorkspaceClientinstances now carry_product_info = ('coda', version), so regular SDK calls (identity lookups, Apps API, workspace sync) also identify CoDA in the User-Agent header:app.py:_setup_git_config()— git identity lookupapp.py:get_token_owner()— owner resolution (Apps API + PAT fallback)sync_to_workspace.py:get_user_email()— workspace sync user lookupFiles Changed
telemetry.pylog_telemetry(),@telemetry_logger(),set_product_info()tests/test_telemetry.pyapp.pyset_product_infoon 3 WS clientspat_rotator.pylog_telemetrycall after successful rotationsync_to_workspace.pylog_telemetrycall after successful sync +set_product_infoDesign Decisions
~/.databrickscfgwhichpat_rotator.pykeeps updated@telemetry_loggerexpectsself.wson class methods; CoDA's version works on standalone functions by creating its own WS clientTest plan
tests/test_telemetry.py— all passingtest_session_detach.py, unrelated)