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

Implementation of generated telemetry client #25

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

breedloj
Copy link
Contributor

Description of changes:
Implementation of a AWS SDK backed generated Toolkit Telemetry client that will be used to send both telemetry events and user feedback.

The client is automatically generated as part of the plugin's Maven build and moved to the expected location in target/generated-sources. I have wired up a basic wrapper that provides an instance of the client configured with Cognito Identity auth based on the Toolkit's identity pool.

Next step is to make the generated telemetry definitions available so event and feedback payloads can be marshalled into this client.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

"AWS Toolkit For VisualStudio",
"AWS Toolkit For VS Code",
"Amazon Q For JetBrains",
"Amazon Q For VS Code"
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to add Amazon Q for Eclipse or for now, can we use AWS Toolkit for Eclipse?

Copy link
Contributor Author

@breedloj breedloj Sep 19, 2024

Choose a reason for hiding this comment

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

Yep - good catch. The entire schema likely needs updates. This was lifted out of the JB toolkit to get started with. For now I will add the new product type and we can evolve the rest of the schema over time as needed.

}

@Override
public final AwsSessionCredentials resolveCredentials() {
Copy link
Contributor

Choose a reason for hiding this comment

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

if any of the commands in the function fail, do we get an exception from the underlying code that we need to handle at the caller side? or we get empty string values for credentials, which then we treat as an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They throw unchecked exceptions back up to the caller. I will be expanding the telemetry wrapper over time to include better error handling. Basically events will be batched and retried for sending later if errors occur.

private static final ToolkitTelemetryClient CLIENT = createDefaultTelemetryClient();
private static final Region TELEMETRY_REGION = Region.US_EAST_1;
private static final String TELEMETRY_ENDPOINT = "https://client-telemetry.us-east-1.amazonaws.com";
private static final String TELEMETRY_IDENTITY_POOL = "us-east-1:820fd6d1-95c0-4ca4-bffb-3f01d32da842";
Copy link
Contributor

Choose a reason for hiding this comment

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

it's going to be same for all stages: gamma, dev, prod?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't include details for non public endpoints in the source. What we can do later if needed is make it configurable or environment variable so it can be overridden for internal testing.

@breedloj breedloj merged commit 0345d26 into main Sep 20, 2024
1 check passed
@breedloj breedloj deleted the breedloj/generatedTelemetryClient branch September 20, 2024 18:28
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