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

Telemetry for AWS requests #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/aws.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,22 @@ defmodule AWS do
By default, AWS Elixir uses hackney for the HTTP client, Jason for JSON,
and a custom module for XML that is written on top of xmlerl.
For more details, check `AWS.Client` documentation.

## Telemetry

The following events are published:

* `[:aws, :request, :start]` - emitted at the beginning of the request to AWS.
* Measurement: `%{system_time: System.system_time()}`
* Metadata: `%{client: AWS.Client.t(), service: AWS.ServiceMetadata.t(), action: String.t(), input: map()}`

* `[:aws, :request, :stop]` - emitted at the end of the request to AWS.
* Measurement: `%{duration: native_time}`
* Metadata: `%{client: AWS.Client.t(), service: AWS.ServiceMetadata.t(), action: String.t(), input: map()}`

* `[:aws, :request, :exception]` - emitted when an exception has been raised.
* Measurement: `%{system_time: System.system_time()}`
* Metadata: `%{client: AWS.Client.t(), service: AWS.ServiceMetadata.t(), action: String.t(), input: map(),
kind: Exception.kind(), reason: term(), stacktrace: Exception.stacktrace()}`
"""
end
42 changes: 39 additions & 3 deletions lib/aws/generated/a_r_c_zonal_shift.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ defmodule AWS.ARCZonalShift do
Request.request_rest(
client,
meta,
"CancelZonalShift",
:delete,
url_path,
query_params,
Expand Down Expand Up @@ -95,7 +96,18 @@ defmodule AWS.ARCZonalShift do

meta = metadata()

Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
Request.request_rest(
client,
meta,
"GetManagedResource",
:get,
url_path,
query_params,
headers,
nil,
options,
200
)
end

@doc """
Expand Down Expand Up @@ -132,7 +144,18 @@ defmodule AWS.ARCZonalShift do

meta = metadata()

Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
Request.request_rest(
client,
meta,
"ListManagedResources",
:get,
url_path,
query_params,
headers,
nil,
options,
200
)
end

@doc """
Expand Down Expand Up @@ -173,7 +196,18 @@ defmodule AWS.ARCZonalShift do

meta = metadata()

Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
Request.request_rest(
client,
meta,
"ListZonalShifts",
:get,
url_path,
query_params,
headers,
nil,
options,
200
)
end

@doc """
Expand Down Expand Up @@ -207,6 +241,7 @@ defmodule AWS.ARCZonalShift do
Request.request_rest(
client,
meta,
"StartZonalShift",
:post,
url_path,
query_params,
Expand Down Expand Up @@ -234,6 +269,7 @@ defmodule AWS.ARCZonalShift do
Request.request_rest(
client,
meta,
"UpdateZonalShift",
:patch,
url_path,
query_params,
Expand Down
Loading