Skip to content

Conversation

@ianbotsf
Copy link
Contributor

@ianbotsf ianbotsf commented Nov 16, 2022

Issue #

Closes smithy-kotlin#677

Description of changes

These are the aws-sdk-kotlin changes to adopt the new tracing framework introduced in smithy-kotlin#737.

Note: This is the final, mergeable version of #731, including changes from the rejected approaches in #680 (context receivers) and #708 (ExecutionContext).

Companion PR: smithy-kotlin#737

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

@github-actions
Copy link

A new generated diff is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

region = provider.region ?: GLOBAL_STS_PARTITION_ENDPOINT
credentialsProvider = provider.credentialsProvider
httpClientEngine = provider.httpClientEngine
tracer = traceSpan.asNestedTracer("STS-")
Copy link
Contributor

Choose a reason for hiding this comment

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

question/nit: Perhaps the trailing - separator should be handled internally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

}

val call = httpClient.call(tokenReq)
val call = httpClient.call(SdkHttpRequest(tokenReq))
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Where is this change stemming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was accidentally left over from a now-removed refactor. I'll revert it.


override suspend fun getCredentials(): Credentials {
val chainException = lazy { CredentialsProviderException("No credentials could be loaded from the chain: $this") }
override suspend fun getCredentials(): Credentials = coroutineContext.withChildTraceSpan("Credentials chain") {
Copy link
Contributor

Choose a reason for hiding this comment

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

comment: This isn't listed in your span taxonomy FYI (I think it's fine here just mentioning it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep you're right, I forgot I left this here. I'll update the taxonomy definition.

I'll also be posting the taxonomy in a new section of tracing.md in the smithy-kotlin PR. I'll make sure to include this there as well.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

A new generated diff is ready to view.

@ianbotsf ianbotsf merged commit d5afc27 into main Nov 18, 2022
@aajtodd aajtodd deleted the feat-tracing3 branch November 29, 2022 14:48
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.

Tracing framework

4 participants