Skip to content
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

feat: telemetry v2 #2485

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

feat: telemetry v2 #2485

wants to merge 21 commits into from

Conversation

rtpascual
Copy link
Contributor

@rtpascual rtpascual commented Feb 6, 2025

Changes

Introduces new version of telemetry.

Example emitSuccess payload:

{
  identifiers: {
    payloadVersion: '1.0.0',
    sessionUuid: '6763abba-2c14-45f1-8847-f07ac5dd4293',
    eventId: '9cdf3a5b-db36-41b8-8604-6ad2a00b54b6',
    timestamp: '2025-02-08T00:38:50.367Z',
    localProjectId: '6bd6a407-cc63-56e5-a701-517e6bd2f876',
    accountId: 'd7f969f3-d9d4-54a5-824d-f7c6c0991b9d',
    awsRegion: 'us-west-1'
  },
  event: {
    state: 'SUCCEEDED',
    command: { path: [Array], parameters: [Array] }
  },
  environment: {
    os: { platform: 'darwin', release: '24.2.0' },
    shell: '/bin/zsh',
    npmUserAgent: 'npm/7.0.0 node/v15.0.0 darwin x64',
    ci: false,
    memory: { total: 34359738368, free: 65110016 }
  },
  project: {
    dependencies: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object]
    ]
  },
  latency: {
    total: 39,
    init: 25,
    synthesis: undefined,
    deployment: undefined,
    hotSwap: undefined
  },
  error: undefined
}

Example emitFailure payload:

{
  identifiers: {
    payloadVersion: '1.0.0',
    sessionUuid: '82522c38-eaae-4df3-83d3-7d56db91c04c',
    eventId: '24d84900-0eed-4c10-8f82-027f30fdf5ee',
    timestamp: '2025-02-08T00:38:15.420Z',
    localProjectId: '6bd6a407-cc63-56e5-a701-517e6bd2f876',
    accountId: 'd7f969f3-d9d4-54a5-824d-f7c6c0991b9d',
    awsRegion: 'us-west-1'
  },
  event: { state: 'FAILED', command: { path: [Array], parameters: [Array] } },
  environment: {
    os: { platform: 'darwin', release: '24.2.0' },
    shell: '/bin/zsh',
    npmUserAgent: 'npm/7.0.0 node/v15.0.0 darwin x64',
    ci: false,
    memory: { total: 34359738368, free: 85590016 }
  },
  project: {
    dependencies: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object]
    ]
  },
  latency: {
    total: 207,
    init: 21,
    synthesis: undefined,
    deployment: undefined,
    hotSwap: undefined
  },
  error: {
    name: 'NoStackFound',
    message: 'Stack with id amplify-testapp-rotp-sandbox-25c0aebd91 does not exist',
    stack: 'Error: Stack with id amplify-testapp-rotp-sandbox-25c0aebd91 does not exist\n' +
      '    at StackMetadataBackendOutputRetrievalStrategy.fetchBackendOutput (../amplify-backend/packages/deployed-backend-client/lib/stack_metadata_output_retrieval_strategy.js:38:23)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
      '    at async DefaultBackendOutputClient.getOutput (../amplify-backend/packages/deployed-backend-client/lib/backend_output_client.js:18:24)\n' +
      '    at async UnifiedClientConfigGenerator.generateClientConfig (../amplify-backend/packages/client-config/lib/unified_client_config_generator.js:25:22)\n' +
      '    at async generateClientConfigToFile (../amplify-backend/packages/client-config/lib/generate_client_config_to_file.js:7:26)\n' +
      '    at async ClientConfigGeneratorAdapter.generateClientConfigToFile (../amplify-backend/packages/cli/lib/client-config/client_config_generator_adapter.js:25:34)\n' +
      '    at async Object.handler (../amplify-backend/packages/cli/lib/commands/generate/outputs/generate_outputs_command.js:37:9)',
    cause: {
      name: 'StackDoesNotExistError',
      message: 'Stack does not exist.',
      stack: 'StackDoesNotExistError: Stack does not exist.\n' +
        '    at UnifiedClientConfigGenerator.generateClientConfig (../amplify-backend/packages/client-config/lib/unified_client_config_generator.js:36:31)\n' +
        '    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
        '    at async generateClientConfigToFile (../amplify-backend/packages/client-config/lib/generate_client_config_to_file.js:7:26)\n' +
        '    at async ClientConfigGeneratorAdapter.generateClientConfigToFile (../amplify-backend/packages/cli/lib/client-config/client_config_generator_adapter.js:25:34)\n' +
        '    at async Object.handler (../amplify-backend/packages/cli/lib/commands/generate/outputs/generate_outputs_command.js:37:9)'
    }
  }
}

Example emitAbortion payload:

{
  identifiers: {
    payloadVersion: '1.0.0',
    sessionUuid: '069be2e7-82b2-4b61-a364-b6c189fb0f4f',
    eventId: 'db3af36f-98df-42c5-9c94-c4f76f8b39b3',
    timestamp: '2025-02-08T00:37:24.624Z',
    localProjectId: '6bd6a407-cc63-56e5-a701-517e6bd2f876',
    accountId: 'd7f969f3-d9d4-54a5-824d-f7c6c0991b9d',
    awsRegion: 'us-west-1'
  },
  event: { state: 'ABORTED', command: { path: [Array], parameters: [Array] } },
  environment: {
    os: { platform: 'darwin', release: '24.2.0' },
    shell: '/bin/zsh',
    npmUserAgent: 'npm/7.0.0 node/v15.0.0 darwin x64',
    ci: false,
    memory: { total: 34359738368, free: 283836416 }
  },
  project: {
    dependencies: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object]
    ]
  },
  latency: {
    total: 1306,
    init: 27,
    synthesis: undefined,
    deployment: undefined,
    hotSwap: undefined
  },
  error: undefined
}

Corresponding docs PR, if applicable:

Validation

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

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

Copy link

changeset-bot bot commented Feb 6, 2025

🦋 Changeset detected

Latest commit: 8ef823d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-amplify/platform-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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