Skip to content

telemetry: add metrics for pinned context #1051

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

avi-alpert
Copy link
Contributor

Add telemetry for pinned context

New Metrics Added:

Pinned Context Counts

  • cwsprChatPinnedCodeContextCount: Tracks the number of pinned code symbols added to context
  • cwsprChatPinnedFileContextCount: Tracks the number of pinned files added to context
  • cwsprChatPinnedFolderContextCount: Tracks the number of pinned folders added to context
  • cwsprChatPinnedPromptContextCount: Tracks the number of pinned saved prompts added to context

Rule Context Tracking

  • cwsprChatTotalRuleContextCount: Tracks the total number of workspace rules (both active and inactive)
  • Updated description for cwsprChatRuleContextCount to clarify it only includes active rules

All new metrics have been added to amazonq_addMessage and are marked as optional fields.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@avi-alpert avi-alpert requested a review from a team as a code owner June 13, 2025 19:57
@@ -1160,6 +1160,26 @@
"type": "string",
"description": "Unique identifier for each message in an conversation"
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these fields more generic like codeCount, fileCount etc to make it reusable?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that the metrics are specific to pinned context feature, we want to understand how the customers use this new feature.

What are purpose of the generic metrics codeCount, fileCount?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names of the types im adding use the same naming convention as the existing context count types:

"name": "cwsprChatPromptContextCount",

except with the added prefix Pinned

this way we can keep track which context items were added in the prompt vs which were pinned

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.

3 participants