Skip to content

Commit

Permalink
feat(cwl): Add metric definitions for LiveTail (#916)
Browse files Browse the repository at this point in the history
## Problem
Cloudwatch wants to monitor usage metrics of the LiveTail integration

## Solution
When starting a session emit telemetry for: 
* Session already started (this case happens when session is already
running, and customer sends a new command that matches the already
running session)
* Has LogEventFilter
* LogStream filter type
* Source of the command (command palette, explorer)

When closing a session: 
* Session duration
* source of cancellation (ex: CodeLens, ClosingEditors)

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Keegan Irby <keegani@amazon.com>
  • Loading branch information
keeganirby and Keegan Irby authored Nov 19, 2024
1 parent 7e9a916 commit a6aa0c8
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions telemetry/definitions/commonDefinitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,11 @@
"type": "boolean",
"description": "Whether the user has access to CodeWhisperer Chat"
},
{
"name": "hasLogEventFilterPattern",
"type": "boolean",
"description": "If LogEvent filter pattern is applied"
},
{
"name": "hasTextFilter",
"type": "boolean",
Expand Down Expand Up @@ -1438,6 +1443,11 @@
"type": "string",
"description": "User locale. Examples: en-US, en-GB, etc."
},
{
"name": "logStreamFilterType",
"type": "string",
"description": "Type of LogStream filter applied to session"
},
{
"name": "metricId",
"type": "string",
Expand Down Expand Up @@ -1647,6 +1657,11 @@
"type": "string",
"description": "The name of the AWS service acted on. These values come from the AWS SDK. To find them in the JAVA SDK search for SERVICE_NAME in each service client, or look for serviceId in metadata in the service2.json"
},
{
"name": "sessionAlreadyStarted",
"type": "boolean",
"description": "Session already open that matches new request"
},
{
"name": "sessionDuration",
"type": "int",
Expand Down Expand Up @@ -4995,6 +5010,48 @@
}
]
},
{
"name": "cwlLiveTail_Start",
"description": "When user starts a new LiveTail command",
"metadata": [
{
"type": "hasLogEventFilterPattern",
"required": false
},
{
"type": "logStreamFilterType",
"required": false
},
{
"type": "result"
},
{
"type": "sessionAlreadyStarted",
"required": true
},
{
"type": "source",
"required": true
}
]
},
{
"name": "cwlLiveTail_Stop",
"description": "When user stops a liveTailSession",
"metadata": [
{
"type": "duration",
"required": true
},
{
"type": "result"
},
{
"type": "source",
"required": true
}
]
},
{
"name": "deeplink_open",
"description": "User requested that a resource be opened in the browser using the deeplink service",
Expand Down

0 comments on commit a6aa0c8

Please sign in to comment.