-
Notifications
You must be signed in to change notification settings - Fork 51
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
add tracing APIs and instrumentation #534
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment for the spans:
- Any reason why we picked the middlewares that we picked for when to start a child span? Retry makes a lot of sense, the other ones I suspect are the ones that we know can take longer but curious to hear your thoughts
- Thanks a lot for actually commenting out the error codes and tracing we emit. We'll likely need to put this on a doc somewhere later, so this would make it a lot easier
tracing/smithy-otel-tracing/adapt.go
Outdated
func toOTELKeyValues(props smithy.Properties) []otelattribute.KeyValue { | ||
var kvs []otelattribute.KeyValue | ||
for k, v := range props.Values() { | ||
if kv, ok := toOTELKeyValue(k, v); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you mention that all of these values will be silently ignored, which can make this very hard to debug if things go wrong. Should we at least log this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually yes, couldn't it just be a span event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline, it's probably better to just map to a string representation as default. Pushed.
|
||
private String getTracingServiceId() { | ||
return service.hasTrait(ServiceTrait.class) | ||
? service.expectTrait(ServiceTrait.class).getSdkId().replaceAll("\\s", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, do we really have services with spaces on the sdk id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many do -- here's a grep snippet. It's really almost the rule rather than the exception
iot-wireless.json [13/1970]
16254: "sdkId": "IoT Wireless",
connect.json
1640: "sdkId": "Connect",
guardduty.json
6989: "sdkId": "GuardDuty",
lex-runtime-v2.json
57: "sdkId": "Lex Runtime V2",
route-53-domains.json
4974: "sdkId": "Route 53 Domains",
mediastore.json
1135: "sdkId": "MediaStore",
resource-explorer-2.json
1597: "sdkId": "Resource Explorer 2",
elasticache.json
453: "sdkId": "ElastiCache",
athena.json
275: "sdkId": "Athena",
migration-hub-refactor-spaces.json
3534: "sdkId": "Migration Hub Refactor Spaces",
kafkaconnect.json
1856: "sdkId": "KafkaConnect",
backup-gateway.json
128: "sdkId": "Backup Gateway",
Most of them are just the principal "phases" of the operation lifecycle, e.g. resolving endpoint, serializing. There's no real hard list of this anywhere, the closest thing we have to that might be the lifecycle breakdown in the (unpublished) client reference architecture. The more niche ones were giving
|
Tracing component of #470
fmt.Sprintf
)smithy-go/tracing
APIsgithub.com/aws/smithy-go/tracing/smithy-otel-tracing
adapts an OTEL SDK TracerProvider for use with Smithy clientsrpc.method
- name of the operationrpc.service
- sdkID of the service (or shape name if not present)rpc.system
- hardcoded toaws-api
error.go.type
- literal go type of an operation's error e.g.&smithy.GenericAPIError
error.go.error
- results ofError()
on an operation's errorerror.api.fault
- if error is a smithy API error, the fault type (client/server/unknown)error.api.code
- if error ", the error codeerror.api.message
- if error ", the error messageerror
-true
if operation returned an errorhttp.proto
- HTTP protocol version (as read from the response)http.request.content_length
- content length of serialized request bodyhttp.request.method
- HTTP method of serialized requesthttp.response.status_code
- HTTP status code of raw responsehttp.response.content_length
- content length of raw response bodyoperation.resolved_endpoint
- the exact URL returned from endpoint resolution (including the scheme and any base path)operation.auth.resolved_scheme_id
- the auth scheme ID selected during resolution e.g. aws.auth#sigv4