Skip to content

Task/otel project connection - #38

Open
muzamilkm wants to merge 7 commits into
arbisoft:main-arbisoftfrom
muzamilkm:task/otel-project-connection
Open

Task/otel project connection#38
muzamilkm wants to merge 7 commits into
arbisoft:main-arbisoftfrom
muzamilkm:task/otel-project-connection

Conversation

@muzamilkm

@muzamilkm muzamilkm commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds DevLake project placement for Claude Code OTel connections so a team credential can be associated with one or more DevLake projects without treating project membership as telemetry attribution.

Project placement is stored as DevLake configuration metadata. The trusted devlake_team label still comes from the authenticated OTel credential, while project-scoped dashboards resolve the projects linked to those teams through MySQL.

Included

  • Adds _tool_claude_code_otel_connection_projects and migration support for many-to-many OTel connection/project placement.
  • Requires at least one existing DevLake project when creating or updating an OTel connection.
  • Adds APIs to list available projects, list a project's OTel connections, replace connection placements, validate project removal, and clean up project placements.
  • Adds project selection to the OTel connection create/edit flow and shows linked projects in the OTel management UI.
  • Adds a Claude Code OTel panel to project details with project-scoped connection visibility and a shortcut to create a connection for that project.
  • Adds project and OTel-team variables to the Claude Adoption Grafana dashboard. Prometheus panels filter by trusted devlake_team, while MySQL maps the selected DevLake project to its linked teams.
  • Explicitly removes any client-provided devlake_project attribute in the Collector. Project placement is not repository-level attribution and is never trusted from telemetry.
  • Prevents deleting the final project placement of an active OTel connection through the normal Config UI project-deletion flow. The connection must be revoked or placed in another project first.

Project Lifecycle Boundary

The normal Config UI delete flow performs OTel preflight and placement cleanup before deleting a project.

A direct client of the generic DELETE /projects/:projectName API can still bypass this plugin-owned lifecycle because upstream DevLake currently exposes no project-deletion extension hook. This can leave stale OTel placement metadata after direct API deletion.

Fixing that cleanly requires an upstream/core project lifecycle hook and is intentionally left outside this PR to avoid coupling the OTel feature directly into core deletion logic. Issue created: apache#9081

Scope and Upstream Coupling

Most backend changes remain isolated in backend/plugins/claude_otel, with Config UI integration limited to the existing OTel screens and project detail/delete flows.

The Grafana change only adds project/team filtering to the Claude dashboard. Metric attribution continues to use the trusted credential-derived devlake_team label rather than introducing a project label into telemetry.

Verification

This PR includes focused coverage for:

  • OTel project placement validation and replacement
  • final-active-placement deletion protection
  • project/OTel UI helpers
  • Claude dashboard project/team query wiring

Additional staging validation will cover creating shared-team placements, project-scoped dashboard filtering, moving a connection between projects, and project deletion behavior.

Deferred

  • Repository-level or per-event project attribution. OTel project placement is governance/display metadata only and must not be inferred as source-code attribution.
  • Any broader project-aware telemetry model beyond team-to-project placement.

@muzamilkm
muzamilkm marked this pull request as ready for review August 28, 2026 14:59
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.

2 participants