Skip to content

Commit

Permalink
Merge branch 'aws:master' into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevluu-aws authored Sep 27, 2024
2 parents 9d917c4 + 56228d7 commit 42d3b96
Show file tree
Hide file tree
Showing 211 changed files with 4,396 additions and 2,339 deletions.
12 changes: 10 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: './packages/core/' # Location of package manifests.
directory: './src.gen'
target-branch: 'master'
schedule:
interval: 'monthly'
ignore:
- dependency-name: '*' # roundabout way to ignore this entire directory, see https://github.com/dependabot/dependabot-core/issues/4364#issuecomment-2002406602
- package-ecosystem: 'npm'
directory: './' # Location of package manifests.
target-branch: 'master' # Avoid updates to "staging".
versioning-strategy: 'increase'
commit-message:
prefix: 'deps'
schedule:
Expand All @@ -25,7 +33,7 @@ updates:
- '@smithy*'
- 'smithy*'
- package-ecosystem: 'github-actions'
directory: './packages/core/'
directory: './'
target-branch: 'master' # Avoid updates to "staging".
commit-message:
prefix: 'deps'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,24 @@ concurrency:

jobs:
notify:
if: github.repository == 'aws/aws-toolkit-vscode'
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: read
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 20
- uses: actions/setup-node@v4
if: github.event_name == 'pull_request_target'
with:
node-version: '20'
- name: Check for tests
uses: actions/github-script@v7
if: github.event_name == 'pull_request_target'
with:
script: |
const notify = require('.github/workflows/notify.js')
await notify({github, context})
if: github.event_name == 'pull_request_target'
5 changes: 2 additions & 3 deletions .github/workflows/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
const { hasPath, dedupComment } = require('./utils')

const testFilesMessage =
'This pull request modifies files in src/ but no tests were added/updated. Confirm whether tests should be added or ensure the PR description explains why tests are not required.'
'This pull request modifies code in src/ but no tests were added/updated. Confirm whether tests should be added or ensure the PR description explains why tests are not required.'

const changelogMessage =
'This pull request modifies a feature or fixes a bug, but it does not include a changelog entry. All pull requests that introduce new features or bug fixes must have a corresponding changelog item describing the changes.'
const changelogMessage = `This pull request implements a feature or fix, so it must include a changelog entry. See [CONTRIBUTING.md#changelog](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#changelog) for instructions.`

/**
* Remind partner teams that tests are required. We don't need to remind them if:
Expand Down
7 changes: 7 additions & 0 deletions docs/arch_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ For connecting a new VSCode _terminal_, remote connect works like this:
1. Toolkit [builds a session-manager-plugin command](https://github.com/aws/aws-toolkit-vscode/blob/c77fc076fd0ed837d077bc0318716b711a2854c8/packages/core/src/ecs/util.ts#L92-L104) and [passes it to a new VSCode Terminal](https://github.com/aws/aws-toolkit-vscode/blob/c77fc076fd0ed837d077bc0318716b711a2854c8/packages/core/src/ecs/commands.ts#L141-L147).
1. VSCode displays the terminal, so the user can enter shell commands on the remote machine.

For EC2 specifically, there are a few additional steps:

1. If connecting to EC2 instance via remote window, the toolkit generates temporary SSH keys (30 second lifetime), with the public key sent to the remote instance.
- Key type is ed25519 if supported, or RSA otherwise.
1. If insufficient permissions are detected on the attached IAM role, toolkit will prompt to add an inline policy with the necessary actions.
1. If SSM sessions remain open after closing the window/terminal, the toolkit will terminate them on-shutdown, or when starting another session to the same instance.

### Implementation of remote connect

These modules show how to use and extend the "remote connect" functionality:
Expand Down
Binary file modified docs/marketplace/vscode/amazonq/dev.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions docs/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,71 @@ outerB()
return telemetry.my_Metric.run(() => b(), { functionId: { name: 'aButMoreUnique' } })
}
```

## Tracing Telemetry Events

All telemetry events include a traceId in addition to other attributes. Traceids allow for improved tracking and correlation of related events across a single operation or user flow.

### What is a traceId?

A traceId is a unique identifier that is generated for the top-level telemetry event in a flow and then propagated to all subsequent related events. This allows us to group and analyze all events associated with a particular operation.

### How it works

1. When a top-level telemetry event is created (e.g., `vscode_executeCommand`), a new traceId is generated.
2. This traceId is then attached to all subsequent related telemetry events that occur as part of the same operation or flow.
3. The traceId remains consistent for all events within the same flow

### Example

Consider a flow where `vscode_executeCommand` triggers `amazonq_enterFocusChat` and `amazonq_openChat`. The resulting telemetry events would look like this:

```
vscode_executeCommand:
traceId: 'aaaaa-aaaaa-aaaaa-aaaaa-aaaaa'

amazonq_enterFocusChat
traceId: 'aaaaa-aaaaa-aaaaa-aaaaa-aaaaa'

amazonq_openChat
traceId: 'aaaaa-aaaaa-aaaaa-aaaaa-aaaaa'
```
allowing us to look up `traceId=aaaaa-aaaaa-aaaaa-aaaaa-aaaaa` in our telemetry instance and find all the related events.
For more information visit the OpenTelemetry documentation on traces: https://opentelemetry.io/docs/concepts/signals/traces/
### Manual Trace ID Instrumentation
In certain scenarios you may need to manually instrument disjoint flows to track how a `traceId` propagates through them. e.g.
1. Measuring the time it takes for a message to travel from Amazon Q chat, through VS Code, and back to the customer.
2. Determining the duration for Amazon Q inline to display a message to the user.
In these cases, where there isn't a direct hierarchy of function calls, manual instrumentation of the `traceId` is necessary.
#### Implementation Options
#### 1. When not currently running in a span
If you're not within an active span and you know the `traceId` you want to use:
```javascript
telemetry.withTraceId(() => {
// Code to be executed within this trace
}, 'myTraceId')
```

This method wraps the provided function with the specified traceId

#### 2. When currently running in a span

If you're already executing within a span (e.g., vscode_executeCommand) and you know the traceId you want to use:

```javascript
telemetry.record({
traceId: 'myTraceId',
})
```

This approach records the traceId for the current span and all future spans within the same execution context.
Loading

0 comments on commit 42d3b96

Please sign in to comment.