Skip to content

Emit installed extensions in telemetry for all commands#6918

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/emit-installed-extensions-info
Draft

Emit installed extensions in telemetry for all commands#6918
Copilot wants to merge 2 commits intomainfrom
copilot/emit-installed-extensions-info

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Extension telemetry (id, version) is currently only emitted for extension commands (ext.run). For standard commands like azd up or azd deploy, we have no visibility into what extensions the user has installed—relevant when extensions hook into core command lifecycles.

Changes

  • internal/tracing/fields/fields.go — New AttributeKey definitions: extensions.installed.ids and extensions.installed.versions (string slices, SystemMetadata/FeatureInsight)
  • cmd/middleware/telemetry.gosetInstalledExtensionsAttributes lists installed extensions via the manager and sets sorted ID/version pairs on the command span. Called unconditionally for all commands; no-ops when manager is nil or no extensions are installed.

Example span output for azd up with two extensions installed:

{
  "Name": "cmd.up",
  "Attributes": [
    {
      "Key": "extensions.installed.ids",
      "Value": ["microsoft.azd.ai", "microsoft.azd.demo"]
    },
    {
      "Key": "extensions.installed.versions",
      "Value": ["1.2.0", "0.5.0"]
    }
  ]
}

IDs are sorted lexicographically; versions are positionally aligned.

Original prompt

This section details on the original issue you should resolve

<issue_title>tracing - emit installed extensions for non-extension commands</issue_title>
<issue_description>Currently, for custom extension commands we emit something like:

{
"Name": "ext.run",
"Attributes" [
{
    "Key": "cmd.entry",
    "Value": {
        "Type": "STRING",
        "Value": "cmd.demo.ai"
    }
},
{
    "Key": "extension.id",
    "Value": {
        "Type": "STRING",
        "Value": "microsoft.azd.demo"
    }
},
{
    "Key": "extension.version",
    "Value": {
        "Type": "STRING",
        "Value": "0.5.0"
    }
},
]
}

However, for standard azd commands like azd up, azd deploy, etc. we do not currently emit any info on what extensions the user has installed, which can be valuable especially if extensions are invoked as part of core commands via custom service/framework target or lifecycle event hooks.

As a first step we can start by emitting the list of installed extension IDs and versions.</issue_description>

<agent_instructions>cli/azd/docs/tracing-in-azd.md may be helpful, as well as existing patterns</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Add new telemetry fields `extensions.installed.ids` and
`extensions.installed.versions` to capture the list of installed
extensions on every command span. This enables tracking which
extensions users have installed, even for non-extension commands
like `azd up` or `azd deploy`.

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI changed the title [WIP] Add emitted extensions for non-extension commands Emit installed extensions in telemetry for all commands Feb 27, 2026
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.

tracing - emit installed extensions for non-extension commands

2 participants