-
Notifications
You must be signed in to change notification settings - Fork 133
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
Telemetry for AWS requests #107
base: master
Are you sure you want to change the base?
Conversation
I recommend to disable whitespaces to review this PR, most of the diff is just indentation due |
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.
Just a minor issue :)
end | ||
|
||
def request_rest( | ||
%Client{} = client, | ||
%ServiceMetadata{} = metadata, | ||
action, |
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.
This action
does not exist for REST services (at least not available now). The closest thing to it sees to be conjunction of HTTP method and the path. WDYT of using that for the action
field?
We could do something like:
"#{http_method |> Atom.to_string() |> String.upcase()} #{path}"
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've added those on new generated code.
The reason of why action
is desirable, by OpenTelemetry docs (and some reference implementation) the spans should be named as ServiceName.OperationName
.
Does that makes sense?
Hey @philss, thanks for taking time to review! Sorry, I didn't made the message that clear. With little changes to code generator, we can have those I've kept the changes to auto-generated code in a separate commit to help you review how that looks like. Thanks once more for your time! 🙇 |
@andrewhr oh man, sorry. I didn't read the description entirely. That makes sense! 👍 |
This patch add Telemetry support for all AWS requests. For context, what this patch aims is to eventually map those Telemetry spans into [semantic OpenTelemetry traces][1]. This inform what kind of metadata we need to provide on those spans: * Client: which itself includes useful information like target region. * ServiceMetadata: this is the most important one, with info about the target Service itself; * Action: the operation name, more on that bellow; * Input: the input sent by the user, more on that bellow; The `action` value is not provided on REST requests, and requires to re-generate code. A companion PR can be sent to aws-codegen project, it this feature is accepted. Given `AWS.Request` is a private implementation for the generated code, I assume this change is not breaking from user perspective. The `input` AFAICT would be useful to extract service-specific information like, for example, the table names of DynamoDB. [1]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-sdk.md
2d1e4a2
to
2aaeda5
Compare
Sorry @philss , this PR was accumulating dust in my hard drive. I rebased against latest master - which includes the ServiceMedata changes - and published the companion PR here aws-beam/aws-codegen#90. Thanks a bunch! 🙇 |
@andrewhr no problem! I will check both PRs later today. Thank you! 💜 |
Is this still in the works? |
I pinged the owner of the PR some months ago but didn't get a reply: aws-beam/aws-codegen#90 (comment) I'll try and sort this out in the weekend 👍 |
This patch add Telemetry support for all AWS requests.
For context, what this patch aims is to eventually map those Telemetry spans into semantic OpenTelemetry traces. This inform what kind of metadata we need to provide on those spans:
The
action
value is not provided on REST requests, and requires to re-generate code. A companion PR can be sent to aws-codegen, it this feature is accepted. GivenAWS.Request
is a private implementation for the generated code, I assume this change is not breaking from user perspective.The
input
AFAICT would be useful to extract service-specific information like, for example, the table names of DynamoDB.