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 29 commits into
base: main
Choose a base branch
from
Draft

feat: telemetry v2 #2485

wants to merge 29 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": "93f649e1-15c3-43b3-88fd-2697406a3ad4",
    "eventId": "aaa05c30-0a07-4c65-bf45-242009108f22",
    "timestamp": "2025-02-18T00:16:29.000Z",
    "localProjectId": "6bd6a407-cc63-56e5-a701-517e6bd2f876",
    "accountId": "d7f969f3-d9d4-54a5-824d-f7c6c0991b9d",
    "awsRegion": "us-west-1"
  },
  "event": {
    "state": "SUCCEEDED",
    "command": {
      "path": [
        "configure",
        "telemetry",
        "disable"
      ],
      "parameters": [
        ""
      ]
    }
  },
  "environment": {
    "os": {
      "platform": "darwin",
      "release": "24.3.0"
    },
    "shell": "/bin/zsh",
    "npmUserAgent": "npm/7.0.0 node/v15.0.0 darwin x64",
    "ci": false,
    "memory": {
      "total": 34359738368,
      "free": 777535488
    }
  },
  "project": {
    "dependencies": [
      {
        "name": "@aws-amplify/auth-construct",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-auth",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-cli",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-data",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-deployer",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-function",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-output-schemas",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-output-storage",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-secret",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-storage",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/cli-core",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/client-config",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/deployed-backend-client",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/form-generator",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/model-generator",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/platform-core",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/plugin-types",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/sandbox",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/schema-generator",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "aws-cdk",
        "version": "2.175.1"
      },
      {
        "name": "aws-cdk-lib",
        "version": "2.178.2"
      }
    ]
  },
  "latency": {
    "total": 54,
    "init": 40
  }
}

Example emitFailure payload:

{
  "identifiers": {
    "payloadVersion": "1.0.0",
    "sessionUuid": "86799099-0b12-4003-a09e-1aae6ecdf9f8",
    "eventId": "f1ffa2e9-afc9-4572-ae4c-b1f2d54598c5",
    "timestamp": "2025-02-18T01:06:57.943Z",
    "localProjectId": "6bd6a407-cc63-56e5-a701-517e6bd2f876",
    "accountId": "d7f969f3-d9d4-54a5-824d-f7c6c0991b9d",
    "awsRegion": "us-west-1"
  },
  "event": {
    "state": "FAILED",
    "command": {
      "path": [
        "generate",
        "outputs"
      ],
      "parameters": [
        "outputs-version",
        "outputsVersion"
      ]
    }
  },
  "environment": {
    "os": {
      "platform": "darwin",
      "release": "24.3.0"
    },
    "shell": "/bin/zsh",
    "npmUserAgent": "npm/7.0.0 node/v15.0.0 darwin x64",
    "ci": false,
    "memory": {
      "total": 34359738368,
      "free": 1476837376
    }
  },
  "project": {
    "dependencies": [
      {
        "name": "@aws-amplify/auth-construct",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-auth",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-cli",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-data",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-deployer",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-function",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-output-schemas",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-output-storage",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-secret",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/backend-storage",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/cli-core",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/client-config",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/deployed-backend-client",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/form-generator",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/model-generator",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/platform-core",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/plugin-types",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/sandbox",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "@aws-amplify/schema-generator",
        "version": "0.0.0-test-20250218005144"
      },
      {
        "name": "aws-cdk",
        "version": "2.175.1"
      },
      {
        "name": "aws-cdk-lib",
        "version": "2.178.2"
      }
    ]
  },
  "latency": {
    "total": 241,
    "init": 41
  },
  "error": {
    "name": "NoStackFound",
    "message": "Stack with id <escaped stack> does not exist",
    "stack": "Error: Stack with id <escaped stack> does not exist\n    at StackMetadataBackendOutputRetrievalStrategy.fetchBackendOutput (node_modules/@aws-amplify/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 (node_modules/@aws-amplify/deployed-backend-client/lib/backend_output_client.js:18:24)\n    at async UnifiedClientConfigGenerator.generateClientConfig (node_modules/@aws-amplify/client-config/lib/unified_client_config_generator.js:25:22)\n    at async generateClientConfigToFile (node_modules/@aws-amplify/client-config/lib/generate_client_config_to_file.js:7:26)\n    at async ClientConfigGeneratorAdapter.generateClientConfigToFile (node_modules/@aws-amplify/backend-cli/lib/client-config/client_config_generator_adapter.js:25:34)\n    at async Object.handler (node_modules/@aws-amplify/backend-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 (node_modules/@aws-amplify/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 (node_modules/@aws-amplify/client-config/lib/generate_client_config_to_file.js:7:26)\n    at async ClientConfigGeneratorAdapter.generateClientConfigToFile (node_modules/@aws-amplify/backend-cli/lib/client-config/client_config_generator_adapter.js:25:34)\n    at async Object.handler (node_modules/@aws-amplify/backend-cli/lib/commands/generate/outputs/generate_outputs_command.js:37:9)"
    }
  }
}

Example emitAbortion payload:

{
  "identifiers": {
    "payloadVersion": "1.0.0",
    "sessionUuid": "1abea961-911b-4d21-acec-d6a44949aefa",
    "eventId": "40fbb8cf-5e97-4ade-9d7f-7754d087fbd2",
    "timestamp": "2025-02-18T00:15:21.575Z",
    "localProjectId": "6bd6a407-cc63-56e5-a701-517e6bd2f876",
    "accountId": "d7f969f3-d9d4-54a5-824d-f7c6c0991b9d",
    "awsRegion": "us-west-1"
  },
  "event": {
    "state": "ABORTED",
    "command": {
      "path": [
        "sandbox",
        "delete"
      ],
      "parameters": [
        ""
      ]
    }
  },
  "environment": {
    "os": {
      "platform": "darwin",
      "release": "24.3.0"
    },
    "shell": "/bin/zsh",
    "npmUserAgent": "npm/7.0.0 node/v15.0.0 darwin x64",
    "ci": false,
    "memory": {
      "total": 34359738368,
      "free": 930021376
    }
  },
  "project": {
    "dependencies": [
      {
        "name": "@aws-amplify/auth-construct",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-auth",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-cli",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-data",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-deployer",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-function",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-output-schemas",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-output-storage",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-secret",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/backend-storage",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/cli-core",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/client-config",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/deployed-backend-client",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/form-generator",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/model-generator",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/platform-core",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/plugin-types",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/sandbox",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "@aws-amplify/schema-generator",
        "version": "0.0.0-test-20250218000414"
      },
      {
        "name": "aws-cdk",
        "version": "2.175.1"
      },
      {
        "name": "aws-cdk-lib",
        "version": "2.178.2"
      }
    ]
  },
  "latency": {
    "total": 2540,
    "init": 36
  }
}

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: 38e3dd3

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

This PR includes changesets to release 27 packages
Name Type
@aws-amplify/backend-deployer Minor
@aws-amplify/platform-core Minor
@aws-amplify/backend-cli Minor
@aws-amplify/ai-constructs Minor
ampx Minor
@aws-amplify/auth-construct Minor
@aws-amplify/backend Minor
@aws-amplify/backend-ai Minor
@aws-amplify/backend-auth Minor
@aws-amplify/backend-data Minor
@aws-amplify/backend-function Minor
@aws-amplify/backend-output-schemas Minor
@aws-amplify/backend-output-storage Minor
@aws-amplify/backend-platform-test-stubs Minor
@aws-amplify/backend-secret Minor
@aws-amplify/backend-storage Minor
@aws-amplify/cli-core Minor
@aws-amplify/client-config Minor
create-amplify Minor
@aws-amplify/deployed-backend-client Minor
eslint-plugin-amplify-backend-rules Minor
@aws-amplify/form-generator Minor
@aws-amplify/integration-tests Minor
@aws-amplify/model-generator Minor
@aws-amplify/plugin-types Minor
@aws-amplify/sandbox Minor
@aws-amplify/schema-generator Minor

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