Class: Aws::XRay::Client

Inherits:
Seahorse::Client::Base
  • Object
show all
Includes:
ClientStubs
Defined in:
lib/aws-sdk-xray/client.rb

Class Attribute Summary collapse

API Operations collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • ‘Aws::Credentials` - Used for configuring static, non-refreshing credentials.

    • ‘Aws::InstanceProfileCredentials` - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • ‘Aws::SharedCredentials` - Used for loading credentials from a shared file, such as `~/.aws/config`.

    • ‘Aws::AssumeRoleCredentials` - Used when you need to assume a role.

    When ‘:credentials` are not configured directly, the following locations will be searched for credentials:

    • Aws.config`

    • The ‘:access_key_id`, `:secret_access_key`, and `:session_token` options.

    • ENV, ENV

    • ‘~/.aws/credentials`

    • ‘~/.aws/config`

    • EC2 IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of ‘Aws::InstanceProfileCredentails` to enable retries and extended timeouts.

  • :region (required, String)

    The AWS region to connect to. The configured ‘:region` is used to determine the service `:endpoint`. When not passed, a default `:region` is search for in the following locations:

  • :access_key_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to ‘true`, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to `false`.

  • :client_side_monitoring (Boolean) — default: false

    When ‘true`, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When ‘true`, an attempt is made to coerce request parameters into the required types.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :endpoint (String)

    The client endpoint is normally constructed from the ‘:region` option. You should only configure an `:endpoint` when connecting to test endpoints. This should be avalid HTTP(S) URI.

  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to ‘true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the ‘:logger` at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, ‘default’ is used.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.

    @see www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.

  • :secret_access_key (String)
  • :session_token (String)
  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    ** Please note ** When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :validate_params (Boolean) — default: true

    When ‘true`, request parameters are validated before sending the request.



202
203
204
# File 'lib/aws-sdk-xray/client.rb', line 202

def initialize(*args)
  super
end

Class Attribute Details

.identifierObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



1288
1289
1290
# File 'lib/aws-sdk-xray/client.rb', line 1288

def identifier
  @identifier
end

Class Method Details

.errors_moduleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



1291
1292
1293
# File 'lib/aws-sdk-xray/client.rb', line 1291

def errors_module
  Errors
end

Instance Method Details

#batch_get_traces(params = {}) ⇒ Types::BatchGetTracesResult

Retrieves a list of traces specified by ID. Each trace is a collection of segment documents that originates from a single request. Use ‘GetTraceSummaries` to get a list of trace IDs.

Examples:

Request syntax with placeholder values


resp = client.batch_get_traces({
  trace_ids: ["TraceId"], # required
  next_token: "String",
})

Response structure


resp.traces #=> Array
resp.traces[0].id #=> String
resp.traces[0].duration #=> Float
resp.traces[0].segments #=> Array
resp.traces[0].segments[0].id #=> String
resp.traces[0].segments[0].document #=> String
resp.unprocessed_trace_ids #=> Array
resp.unprocessed_trace_ids[0] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :trace_ids (required, Array<String>)

    Specify the trace IDs of requests for which to retrieve segments.

  • :next_token (String)

    Pagination token. Not used.

Returns:

See Also:



247
248
249
250
# File 'lib/aws-sdk-xray/client.rb', line 247

def batch_get_traces(params = {}, options = {})
  req = build_request(:batch_get_traces, params)
  req.send_request(options)
end

#build_request(operation_name, params = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • params ({}) (defaults to: {})


1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
# File 'lib/aws-sdk-xray/client.rb', line 1266

def build_request(operation_name, params = {})
  handlers = @handlers.for(operation_name)
  context = Seahorse::Client::RequestContext.new(
    operation_name: operation_name,
    operation: config.api.operation(operation_name),
    client: self,
    params: params,
    config: config)
  context[:gem_name] = 'aws-sdk-xray'
  context[:gem_version] = '1.10.0'
  Seahorse::Client::Request.new(handlers, context)
end

#create_group(params = {}) ⇒ Types::CreateGroupResult

Creates a group resource with a name and a filter expression.

Examples:

Request syntax with placeholder values


resp = client.create_group({
  group_name: "GroupName", # required
  filter_expression: "FilterExpression",
})

Response structure


resp.group.group_name #=> String
resp.group.group_arn #=> String
resp.group.filter_expression #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The case-sensitive name of the new group. Default is a reserved name and names must be unique.

  • :filter_expression (String)

    The filter expression defining criteria by which to group traces.

Returns:

See Also:



282
283
284
285
# File 'lib/aws-sdk-xray/client.rb', line 282

def create_group(params = {}, options = {})
  req = build_request(:create_group, params)
  req.send_request(options)
end

#create_sampling_rule(params = {}) ⇒ Types::CreateSamplingRuleResult

Creates a rule to control sampling behavior for instrumented applications. Services retrieve rules with GetSamplingRules, and evaluate each rule in ascending order of priority for each request. If a rule matches, the service records a trace, borrowing it from the reservoir size. After 10 seconds, the service reports back to X-Ray with GetSamplingTargets to get updated versions of each in-use rule. The updated rule contains a trace quota that the service can use instead of borrowing from the reservoir.

Examples:

Request syntax with placeholder values


resp = client.create_sampling_rule({
  sampling_rule: { # required
    rule_name: "RuleName",
    rule_arn: "String",
    resource_arn: "ResourceARN", # required
    priority: 1, # required
    fixed_rate: 1.0, # required
    reservoir_size: 1, # required
    service_name: "ServiceName", # required
    service_type: "ServiceType", # required
    host: "Host", # required
    http_method: "HTTPMethod", # required
    url_path: "URLPath", # required
    version: 1, # required
    attributes: {
      "AttributeKey" => "AttributeValue",
    },
  },
})

Response structure


resp.sampling_rule_record.sampling_rule.rule_name #=> String
resp.sampling_rule_record.sampling_rule.rule_arn #=> String
resp.sampling_rule_record.sampling_rule.resource_arn #=> String
resp.sampling_rule_record.sampling_rule.priority #=> Integer
resp.sampling_rule_record.sampling_rule.fixed_rate #=> Float
resp.sampling_rule_record.sampling_rule.reservoir_size #=> Integer
resp.sampling_rule_record.sampling_rule.service_name #=> String
resp.sampling_rule_record.sampling_rule.service_type #=> String
resp.sampling_rule_record.sampling_rule.host #=> String
resp.sampling_rule_record.sampling_rule.http_method #=> String
resp.sampling_rule_record.sampling_rule.url_path #=> String
resp.sampling_rule_record.sampling_rule.version #=> Integer
resp.sampling_rule_record.sampling_rule.attributes #=> Hash
resp.sampling_rule_record.sampling_rule.attributes["AttributeKey"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.sampling_rule_record.created_at #=> Time
resp.sampling_rule_record.modified_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



348
349
350
351
# File 'lib/aws-sdk-xray/client.rb', line 348

def create_sampling_rule(params = {}, options = {})
  req = build_request(:create_sampling_rule, params)
  req.send_request(options)
end

#delete_group(params = {}) ⇒ Struct

Deletes a group resource.

Examples:

Request syntax with placeholder values


resp = client.delete_group({
  group_name: "GroupName",
  group_arn: "GroupARN",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (String)

    The case-sensitive name of the group.

  • :group_arn (String)

    The ARN of the group that was generated on creation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



374
375
376
377
# File 'lib/aws-sdk-xray/client.rb', line 374

def delete_group(params = {}, options = {})
  req = build_request(:delete_group, params)
  req.send_request(options)
end

#delete_sampling_rule(params = {}) ⇒ Types::DeleteSamplingRuleResult

Deletes a sampling rule.

Examples:

Request syntax with placeholder values


resp = client.delete_sampling_rule({
  rule_name: "String",
  rule_arn: "String",
})

Response structure


resp.sampling_rule_record.sampling_rule.rule_name #=> String
resp.sampling_rule_record.sampling_rule.rule_arn #=> String
resp.sampling_rule_record.sampling_rule.resource_arn #=> String
resp.sampling_rule_record.sampling_rule.priority #=> Integer
resp.sampling_rule_record.sampling_rule.fixed_rate #=> Float
resp.sampling_rule_record.sampling_rule.reservoir_size #=> Integer
resp.sampling_rule_record.sampling_rule.service_name #=> String
resp.sampling_rule_record.sampling_rule.service_type #=> String
resp.sampling_rule_record.sampling_rule.host #=> String
resp.sampling_rule_record.sampling_rule.http_method #=> String
resp.sampling_rule_record.sampling_rule.url_path #=> String
resp.sampling_rule_record.sampling_rule.version #=> Integer
resp.sampling_rule_record.sampling_rule.attributes #=> Hash
resp.sampling_rule_record.sampling_rule.attributes["AttributeKey"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.sampling_rule_record.created_at #=> Time
resp.sampling_rule_record.modified_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_name (String)

    The name of the sampling rule. Specify a rule by either name or ARN, but not both.

  • :rule_arn (String)

    The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.

Returns:

See Also:



423
424
425
426
# File 'lib/aws-sdk-xray/client.rb', line 423

def delete_sampling_rule(params = {}, options = {})
  req = build_request(:delete_sampling_rule, params)
  req.send_request(options)
end

#get_encryption_config(params = {}) ⇒ Types::GetEncryptionConfigResult

Retrieves the current encryption configuration for X-Ray data.

Examples:

Response structure


resp.encryption_config.key_id #=> String
resp.encryption_config.status #=> String, one of "UPDATING", "ACTIVE"
resp.encryption_config.type #=> String, one of "NONE", "KMS"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



444
445
446
447
# File 'lib/aws-sdk-xray/client.rb', line 444

def get_encryption_config(params = {}, options = {})
  req = build_request(:get_encryption_config, params)
  req.send_request(options)
end

#get_group(params = {}) ⇒ Types::GetGroupResult

Retrieves group resource details.

Examples:

Request syntax with placeholder values


resp = client.get_group({
  group_name: "GroupName",
  group_arn: "GroupARN",
})

Response structure


resp.group.group_name #=> String
resp.group.group_arn #=> String
resp.group.filter_expression #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (String)

    The case-sensitive name of the group.

  • :group_arn (String)

    The ARN of the group that was generated on creation.

Returns:

See Also:



478
479
480
481
# File 'lib/aws-sdk-xray/client.rb', line 478

def get_group(params = {}, options = {})
  req = build_request(:get_group, params)
  req.send_request(options)
end

#get_groups(params = {}) ⇒ Types::GetGroupsResult

Retrieves all active group details.

Examples:

Request syntax with placeholder values


resp = client.get_groups({
  next_token: "GetGroupsNextToken",
})

Response structure


resp.groups #=> Array
resp.groups[0].group_name #=> String
resp.groups[0].group_arn #=> String
resp.groups[0].filter_expression #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    Pagination token. Not used.

Returns:

See Also:



511
512
513
514
# File 'lib/aws-sdk-xray/client.rb', line 511

def get_groups(params = {}, options = {})
  req = build_request(:get_groups, params)
  req.send_request(options)
end

#get_sampling_rules(params = {}) ⇒ Types::GetSamplingRulesResult

Retrieves all sampling rules.

Examples:

Request syntax with placeholder values


resp = client.get_sampling_rules({
  next_token: "String",
})

Response structure


resp.sampling_rule_records #=> Array
resp.sampling_rule_records[0].sampling_rule.rule_name #=> String
resp.sampling_rule_records[0].sampling_rule.rule_arn #=> String
resp.sampling_rule_records[0].sampling_rule.resource_arn #=> String
resp.sampling_rule_records[0].sampling_rule.priority #=> Integer
resp.sampling_rule_records[0].sampling_rule.fixed_rate #=> Float
resp.sampling_rule_records[0].sampling_rule.reservoir_size #=> Integer
resp.sampling_rule_records[0].sampling_rule.service_name #=> String
resp.sampling_rule_records[0].sampling_rule.service_type #=> String
resp.sampling_rule_records[0].sampling_rule.host #=> String
resp.sampling_rule_records[0].sampling_rule.http_method #=> String
resp.sampling_rule_records[0].sampling_rule.url_path #=> String
resp.sampling_rule_records[0].sampling_rule.version #=> Integer
resp.sampling_rule_records[0].sampling_rule.attributes #=> Hash
resp.sampling_rule_records[0].sampling_rule.attributes["AttributeKey"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.sampling_rule_records[0].created_at #=> Time
resp.sampling_rule_records[0].modified_at #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    Pagination token. Not used.

Returns:

See Also:



557
558
559
560
# File 'lib/aws-sdk-xray/client.rb', line 557

def get_sampling_rules(params = {}, options = {})
  req = build_request(:get_sampling_rules, params)
  req.send_request(options)
end

#get_sampling_statistic_summaries(params = {}) ⇒ Types::GetSamplingStatisticSummariesResult

Retrieves information about recent sampling results for all sampling rules.

Examples:

Request syntax with placeholder values


resp = client.get_sampling_statistic_summaries({
  next_token: "String",
})

Response structure


resp.sampling_statistic_summaries #=> Array
resp.sampling_statistic_summaries[0].rule_name #=> String
resp.sampling_statistic_summaries[0].timestamp #=> Time
resp.sampling_statistic_summaries[0].request_count #=> Integer
resp.sampling_statistic_summaries[0].borrow_count #=> Integer
resp.sampling_statistic_summaries[0].sampled_count #=> Integer
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    Pagination token. Not used.

Returns:

See Also:



593
594
595
596
# File 'lib/aws-sdk-xray/client.rb', line 593

def get_sampling_statistic_summaries(params = {}, options = {})
  req = build_request(:get_sampling_statistic_summaries, params)
  req.send_request(options)
end

#get_sampling_targets(params = {}) ⇒ Types::GetSamplingTargetsResult

Requests a sampling quota for rules that the service is using to sample requests.

Examples:

Request syntax with placeholder values


resp = client.get_sampling_targets({
  sampling_statistics_documents: [ # required
    {
      rule_name: "RuleName", # required
      client_id: "ClientID", # required
      timestamp: Time.now, # required
      request_count: 1, # required
      sampled_count: 1, # required
      borrow_count: 1,
    },
  ],
})

Response structure


resp.sampling_target_documents #=> Array
resp.sampling_target_documents[0].rule_name #=> String
resp.sampling_target_documents[0].fixed_rate #=> Float
resp.sampling_target_documents[0].reservoir_quota #=> Integer
resp.sampling_target_documents[0].reservoir_quota_ttl #=> Time
resp.sampling_target_documents[0].interval #=> Integer
resp.last_rule_modification #=> Time
resp.unprocessed_statistics #=> Array
resp.unprocessed_statistics[0].rule_name #=> String
resp.unprocessed_statistics[0].error_code #=> String
resp.unprocessed_statistics[0].message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



643
644
645
646
# File 'lib/aws-sdk-xray/client.rb', line 643

def get_sampling_targets(params = {}, options = {})
  req = build_request(:get_sampling_targets, params)
  req.send_request(options)
end

#get_service_graph(params = {}) ⇒ Types::GetServiceGraphResult

Retrieves a document that describes services that process incoming requests, and downstream services that they call as a result. Root services process incoming requests and make calls to downstream services. Root services are applications that use the AWS X-Ray SDK. Downstream services can be other applications, AWS resources, HTTP web APIs, or SQL databases.

Examples:

Request syntax with placeholder values


resp = client.get_service_graph({
  start_time: Time.now, # required
  end_time: Time.now, # required
  group_name: "GroupName",
  group_arn: "GroupARN",
  next_token: "String",
})

Response structure


resp.start_time #=> Time
resp.end_time #=> Time
resp.services #=> Array
resp.services[0].reference_id #=> Integer
resp.services[0].name #=> String
resp.services[0].names #=> Array
resp.services[0].names[0] #=> String
resp.services[0].root #=> Boolean
resp.services[0]. #=> String
resp.services[0].type #=> String
resp.services[0].state #=> String
resp.services[0].start_time #=> Time
resp.services[0].end_time #=> Time
resp.services[0].edges #=> Array
resp.services[0].edges[0].reference_id #=> Integer
resp.services[0].edges[0].start_time #=> Time
resp.services[0].edges[0].end_time #=> Time
resp.services[0].edges[0].summary_statistics.ok_count #=> Integer
resp.services[0].edges[0].summary_statistics.error_statistics.throttle_count #=> Integer
resp.services[0].edges[0].summary_statistics.error_statistics.other_count #=> Integer
resp.services[0].edges[0].summary_statistics.error_statistics.total_count #=> Integer
resp.services[0].edges[0].summary_statistics.fault_statistics.other_count #=> Integer
resp.services[0].edges[0].summary_statistics.fault_statistics.total_count #=> Integer
resp.services[0].edges[0].summary_statistics.total_count #=> Integer
resp.services[0].edges[0].summary_statistics.total_response_time #=> Float
resp.services[0].edges[0].response_time_histogram #=> Array
resp.services[0].edges[0].response_time_histogram[0].value #=> Float
resp.services[0].edges[0].response_time_histogram[0].count #=> Integer
resp.services[0].edges[0].aliases #=> Array
resp.services[0].edges[0].aliases[0].name #=> String
resp.services[0].edges[0].aliases[0].names #=> Array
resp.services[0].edges[0].aliases[0].names[0] #=> String
resp.services[0].edges[0].aliases[0].type #=> String
resp.services[0].summary_statistics.ok_count #=> Integer
resp.services[0].summary_statistics.error_statistics.throttle_count #=> Integer
resp.services[0].summary_statistics.error_statistics.other_count #=> Integer
resp.services[0].summary_statistics.error_statistics.total_count #=> Integer
resp.services[0].summary_statistics.fault_statistics.other_count #=> Integer
resp.services[0].summary_statistics.fault_statistics.total_count #=> Integer
resp.services[0].summary_statistics.total_count #=> Integer
resp.services[0].summary_statistics.total_response_time #=> Float
resp.services[0].duration_histogram #=> Array
resp.services[0].duration_histogram[0].value #=> Float
resp.services[0].duration_histogram[0].count #=> Integer
resp.services[0].response_time_histogram #=> Array
resp.services[0].response_time_histogram[0].value #=> Float
resp.services[0].response_time_histogram[0].count #=> Integer
resp.contains_old_group_versions #=> Boolean
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :start_time (required, Time, DateTime, Date, Integer, String)

    The start of the time frame for which to generate a graph.

  • :end_time (required, Time, DateTime, Date, Integer, String)

    The end of the timeframe for which to generate a graph.

  • :group_name (String)

    The name of a group to generate a graph based on.

  • :group_arn (String)

    The ARN of a group to generate a graph based on.

  • :next_token (String)

    Pagination token. Not used.

Returns:

See Also:



744
745
746
747
# File 'lib/aws-sdk-xray/client.rb', line 744

def get_service_graph(params = {}, options = {})
  req = build_request(:get_service_graph, params)
  req.send_request(options)
end

#get_trace_graph(params = {}) ⇒ Types::GetTraceGraphResult

Retrieves a service graph for one or more specific trace IDs.

Examples:

Request syntax with placeholder values


resp = client.get_trace_graph({
  trace_ids: ["TraceId"], # required
  next_token: "String",
})

Response structure


resp.services #=> Array
resp.services[0].reference_id #=> Integer
resp.services[0].name #=> String
resp.services[0].names #=> Array
resp.services[0].names[0] #=> String
resp.services[0].root #=> Boolean
resp.services[0]. #=> String
resp.services[0].type #=> String
resp.services[0].state #=> String
resp.services[0].start_time #=> Time
resp.services[0].end_time #=> Time
resp.services[0].edges #=> Array
resp.services[0].edges[0].reference_id #=> Integer
resp.services[0].edges[0].start_time #=> Time
resp.services[0].edges[0].end_time #=> Time
resp.services[0].edges[0].summary_statistics.ok_count #=> Integer
resp.services[0].edges[0].summary_statistics.error_statistics.throttle_count #=> Integer
resp.services[0].edges[0].summary_statistics.error_statistics.other_count #=> Integer
resp.services[0].edges[0].summary_statistics.error_statistics.total_count #=> Integer
resp.services[0].edges[0].summary_statistics.fault_statistics.other_count #=> Integer
resp.services[0].edges[0].summary_statistics.fault_statistics.total_count #=> Integer
resp.services[0].edges[0].summary_statistics.total_count #=> Integer
resp.services[0].edges[0].summary_statistics.total_response_time #=> Float
resp.services[0].edges[0].response_time_histogram #=> Array
resp.services[0].edges[0].response_time_histogram[0].value #=> Float
resp.services[0].edges[0].response_time_histogram[0].count #=> Integer
resp.services[0].edges[0].aliases #=> Array
resp.services[0].edges[0].aliases[0].name #=> String
resp.services[0].edges[0].aliases[0].names #=> Array
resp.services[0].edges[0].aliases[0].names[0] #=> String
resp.services[0].edges[0].aliases[0].type #=> String
resp.services[0].summary_statistics.ok_count #=> Integer
resp.services[0].summary_statistics.error_statistics.throttle_count #=> Integer
resp.services[0].summary_statistics.error_statistics.other_count #=> Integer
resp.services[0].summary_statistics.error_statistics.total_count #=> Integer
resp.services[0].summary_statistics.fault_statistics.other_count #=> Integer
resp.services[0].summary_statistics.fault_statistics.total_count #=> Integer
resp.services[0].summary_statistics.total_count #=> Integer
resp.services[0].summary_statistics.total_response_time #=> Float
resp.services[0].duration_histogram #=> Array
resp.services[0].duration_histogram[0].value #=> Float
resp.services[0].duration_histogram[0].count #=> Integer
resp.services[0].response_time_histogram #=> Array
resp.services[0].response_time_histogram[0].value #=> Float
resp.services[0].response_time_histogram[0].count #=> Integer
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :trace_ids (required, Array<String>)

    Trace IDs of requests for which to generate a service graph.

  • :next_token (String)

    Pagination token. Not used.

Returns:

See Also:



822
823
824
825
# File 'lib/aws-sdk-xray/client.rb', line 822

def get_trace_graph(params = {}, options = {})
  req = build_request(:get_trace_graph, params)
  req.send_request(options)
end

#get_trace_summaries(params = {}) ⇒ Types::GetTraceSummariesResult

Retrieves IDs and metadata for traces available for a specified time frame using an optional filter. To get the full traces, pass the trace IDs to ‘BatchGetTraces`.

A filter expression can target traced requests that hit specific service nodes or edges, have errors, or come from a known user. For example, the following filter expression targets traces that pass through ‘api.example.com`:

‘service(“api.example.com”)`

This filter expression finds traces that have an annotation named ‘account` with the value `12345`:

‘annotation.account = “12345”`

For a full list of indexed fields and keywords that you can use in filter expressions, see [Using Filter Expressions] in the *AWS X-Ray Developer Guide*.

[1]: docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html

Examples:

Request syntax with placeholder values


resp = client.get_trace_summaries({
  start_time: Time.now, # required
  end_time: Time.now, # required
  sampling: false,
  filter_expression: "FilterExpression",
  next_token: "String",
})

Response structure


resp.trace_summaries #=> Array
resp.trace_summaries[0].id #=> String
resp.trace_summaries[0].duration #=> Float
resp.trace_summaries[0].response_time #=> Float
resp.trace_summaries[0].has_fault #=> Boolean
resp.trace_summaries[0].has_error #=> Boolean
resp.trace_summaries[0].has_throttle #=> Boolean
resp.trace_summaries[0].is_partial #=> Boolean
resp.trace_summaries[0].http.http_url #=> String
resp.trace_summaries[0].http.http_status #=> Integer
resp.trace_summaries[0].http.http_method #=> String
resp.trace_summaries[0].http.user_agent #=> String
resp.trace_summaries[0].http.client_ip #=> String
resp.trace_summaries[0].annotations #=> Hash
resp.trace_summaries[0].annotations["AnnotationKey"] #=> Array
resp.trace_summaries[0].annotations["AnnotationKey"][0].annotation_value.number_value #=> Float
resp.trace_summaries[0].annotations["AnnotationKey"][0].annotation_value.boolean_value #=> Boolean
resp.trace_summaries[0].annotations["AnnotationKey"][0].annotation_value.string_value #=> String
resp.trace_summaries[0].annotations["AnnotationKey"][0].service_ids #=> Array
resp.trace_summaries[0].annotations["AnnotationKey"][0].service_ids[0].name #=> String
resp.trace_summaries[0].annotations["AnnotationKey"][0].service_ids[0].names #=> Array
resp.trace_summaries[0].annotations["AnnotationKey"][0].service_ids[0].names[0] #=> String
resp.trace_summaries[0].annotations["AnnotationKey"][0].service_ids[0]. #=> String
resp.trace_summaries[0].annotations["AnnotationKey"][0].service_ids[0].type #=> String
resp.trace_summaries[0].users #=> Array
resp.trace_summaries[0].users[0].user_name #=> String
resp.trace_summaries[0].users[0].service_ids #=> Array
resp.trace_summaries[0].users[0].service_ids[0].name #=> String
resp.trace_summaries[0].users[0].service_ids[0].names #=> Array
resp.trace_summaries[0].users[0].service_ids[0].names[0] #=> String
resp.trace_summaries[0].users[0].service_ids[0]. #=> String
resp.trace_summaries[0].users[0].service_ids[0].type #=> String
resp.trace_summaries[0].service_ids #=> Array
resp.trace_summaries[0].service_ids[0].name #=> String
resp.trace_summaries[0].service_ids[0].names #=> Array
resp.trace_summaries[0].service_ids[0].names[0] #=> String
resp.trace_summaries[0].service_ids[0]. #=> String
resp.trace_summaries[0].service_ids[0].type #=> String
resp.trace_summaries[0].resource_arns #=> Array
resp.trace_summaries[0].resource_arns[0].arn #=> String
resp.trace_summaries[0].instance_ids #=> Array
resp.trace_summaries[0].instance_ids[0].id #=> String
resp.trace_summaries[0].availability_zones #=> Array
resp.trace_summaries[0].availability_zones[0].name #=> String
resp.trace_summaries[0].entry_point.name #=> String
resp.trace_summaries[0].entry_point.names #=> Array
resp.trace_summaries[0].entry_point.names[0] #=> String
resp.trace_summaries[0].entry_point. #=> String
resp.trace_summaries[0].entry_point.type #=> String
resp.trace_summaries[0].fault_root_causes #=> Array
resp.trace_summaries[0].fault_root_causes[0].services #=> Array
resp.trace_summaries[0].fault_root_causes[0].services[0].name #=> String
resp.trace_summaries[0].fault_root_causes[0].services[0].names #=> Array
resp.trace_summaries[0].fault_root_causes[0].services[0].names[0] #=> String
resp.trace_summaries[0].fault_root_causes[0].services[0].type #=> String
resp.trace_summaries[0].fault_root_causes[0].services[0]. #=> String
resp.trace_summaries[0].fault_root_causes[0].services[0].entity_path #=> Array
resp.trace_summaries[0].fault_root_causes[0].services[0].entity_path[0].name #=> String
resp.trace_summaries[0].fault_root_causes[0].services[0].entity_path[0].exceptions #=> Array
resp.trace_summaries[0].fault_root_causes[0].services[0].entity_path[0].exceptions[0].name #=> String
resp.trace_summaries[0].fault_root_causes[0].services[0].entity_path[0].exceptions[0].message #=> String
resp.trace_summaries[0].fault_root_causes[0].services[0].entity_path[0].remote #=> Boolean
resp.trace_summaries[0].fault_root_causes[0].services[0].inferred #=> Boolean
resp.trace_summaries[0].error_root_causes #=> Array
resp.trace_summaries[0].error_root_causes[0].services #=> Array
resp.trace_summaries[0].error_root_causes[0].services[0].name #=> String
resp.trace_summaries[0].error_root_causes[0].services[0].names #=> Array
resp.trace_summaries[0].error_root_causes[0].services[0].names[0] #=> String
resp.trace_summaries[0].error_root_causes[0].services[0].type #=> String
resp.trace_summaries[0].error_root_causes[0].services[0]. #=> String
resp.trace_summaries[0].error_root_causes[0].services[0].entity_path #=> Array
resp.trace_summaries[0].error_root_causes[0].services[0].entity_path[0].name #=> String
resp.trace_summaries[0].error_root_causes[0].services[0].entity_path[0].exceptions #=> Array
resp.trace_summaries[0].error_root_causes[0].services[0].entity_path[0].exceptions[0].name #=> String
resp.trace_summaries[0].error_root_causes[0].services[0].entity_path[0].exceptions[0].message #=> String
resp.trace_summaries[0].error_root_causes[0].services[0].entity_path[0].remote #=> Boolean
resp.trace_summaries[0].error_root_causes[0].services[0].inferred #=> Boolean
resp.trace_summaries[0].response_time_root_causes #=> Array
resp.trace_summaries[0].response_time_root_causes[0].services #=> Array
resp.trace_summaries[0].response_time_root_causes[0].services[0].name #=> String
resp.trace_summaries[0].response_time_root_causes[0].services[0].names #=> Array
resp.trace_summaries[0].response_time_root_causes[0].services[0].names[0] #=> String
resp.trace_summaries[0].response_time_root_causes[0].services[0].type #=> String
resp.trace_summaries[0].response_time_root_causes[0].services[0]. #=> String
resp.trace_summaries[0].response_time_root_causes[0].services[0].entity_path #=> Array
resp.trace_summaries[0].response_time_root_causes[0].services[0].entity_path[0].name #=> String
resp.trace_summaries[0].response_time_root_causes[0].services[0].entity_path[0].coverage #=> Float
resp.trace_summaries[0].response_time_root_causes[0].services[0].entity_path[0].remote #=> Boolean
resp.trace_summaries[0].response_time_root_causes[0].services[0].inferred #=> Boolean
resp.trace_summaries[0].revision #=> Integer
resp.approximate_time #=> Time
resp.traces_processed_count #=> Integer
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :start_time (required, Time, DateTime, Date, Integer, String)

    The start of the time frame for which to retrieve traces.

  • :end_time (required, Time, DateTime, Date, Integer, String)

    The end of the time frame for which to retrieve traces.

  • :sampling (Boolean)

    Set to ‘true` to get summaries for only a subset of available traces.

  • :filter_expression (String)

    Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.

  • :next_token (String)

    Specify the pagination token returned by a previous request to retrieve the next page of results.

Returns:

See Also:



985
986
987
988
# File 'lib/aws-sdk-xray/client.rb', line 985

def get_trace_summaries(params = {}, options = {})
  req = build_request(:get_trace_summaries, params)
  req.send_request(options)
end

#put_encryption_config(params = {}) ⇒ Types::PutEncryptionConfigResult

Updates the encryption configuration for X-Ray data.

Examples:

Request syntax with placeholder values


resp = client.put_encryption_config({
  key_id: "EncryptionKeyId",
  type: "NONE", # required, accepts NONE, KMS
})

Response structure


resp.encryption_config.key_id #=> String
resp.encryption_config.status #=> String, one of "UPDATING", "ACTIVE"
resp.encryption_config.type #=> String, one of "NONE", "KMS"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :key_id (String)

    An AWS KMS customer master key (CMK) in one of the following formats:

    • Alias - The name of the key. For example, ‘alias/MyKey`.

    • **Key ID** - The KMS key ID of the key. For example, ‘ae4aa6d49-a4d8-9df9-a475-4ff6d7898456`.

    • ARN - The full Amazon Resource Name of the key ID or alias. For example, ‘arn:aws:kms:us-east-2:123456789012:key/ae4aa6d49-a4d8-9df9-a475-4ff6d7898456`. Use this format to specify a key in a different account.

    Omit this key if you set ‘Type` to `NONE`.

  • :type (required, String)

    The type of encryption. Set to ‘KMS` to use your own key for encryption. Set to `NONE` for default encryption.

Returns:

See Also:



1032
1033
1034
1035
# File 'lib/aws-sdk-xray/client.rb', line 1032

def put_encryption_config(params = {}, options = {})
  req = build_request(:put_encryption_config, params)
  req.send_request(options)
end

#put_telemetry_records(params = {}) ⇒ Struct

Used by the AWS X-Ray daemon to upload telemetry.

Examples:

Request syntax with placeholder values


resp = client.put_telemetry_records({
  telemetry_records: [ # required
    {
      timestamp: Time.now, # required
      segments_received_count: 1,
      segments_sent_count: 1,
      segments_spillover_count: 1,
      segments_rejected_count: 1,
      backend_connection_errors: {
        timeout_count: 1,
        connection_refused_count: 1,
        http_code_4_xx_count: 1,
        http_code_5_xx_count: 1,
        unknown_host_count: 1,
        other_count: 1,
      },
    },
  ],
  ec2_instance_id: "EC2InstanceId",
  hostname: "Hostname",
  resource_arn: "ResourceARN",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :telemetry_records (required, Array<Types::TelemetryRecord>)
  • :ec2_instance_id (String)
  • :hostname (String)
  • :resource_arn (String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1078
1079
1080
1081
# File 'lib/aws-sdk-xray/client.rb', line 1078

def put_telemetry_records(params = {}, options = {})
  req = build_request(:put_telemetry_records, params)
  req.send_request(options)
end

#put_trace_segments(params = {}) ⇒ Types::PutTraceSegmentsResult

Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents and sends them to the X-Ray daemon, which uploads them in batches. A segment document can be a completed segment, an in-progress segment, or an array of subsegments.

Segments must include the following fields. For the full segment document schema, see [AWS X-Ray Segment Documents] in the *AWS X-Ray Developer Guide*.

**Required Segment Document Fields**

  • ‘name` - The name of the service that handled the request.

  • ‘id` - A 64-bit identifier for the segment, unique among segments in the same trace, in 16 hexadecimal digits.

  • ‘trace_id` - A unique identifier that connects all segments and subsegments originating from a single client request.

  • ‘start_time` - Time the segment or subsegment was created, in floating point seconds in epoch time, accurate to milliseconds. For example, `1480615200.010` or `1.480615200010E9`.

  • ‘end_time` - Time the segment or subsegment was closed. For example, `1480615200.090` or `1.480615200090E9`. Specify either an `end_time` or `in_progress`.

  • ‘in_progress` - Set to `true` instead of specifying an `end_time` to record that a segment has been started, but is not complete. Send an in progress segment when your application receives a request that will take a long time to serve, to trace the fact that the request was received. When the response is sent, send the complete segment to overwrite the in-progress segment.

A ‘trace_id` consists of three numbers separated by hyphens. For example, 1-58406520-a006649127e371903a2de979. This includes:

**Trace ID Format**

  • The version number, i.e. ‘1`.

  • The time of the original request, in Unix epoch time, in 8 hexadecimal digits. For example, 10:00AM December 2nd, 2016 PST in epoch time is ‘1480615200` seconds, or `58406520` in hexadecimal.

  • A 96-bit identifier for the trace, globally unique, in 24 hexadecimal digits.

[1]: docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html

Examples:

Request syntax with placeholder values


resp = client.put_trace_segments({
  trace_segment_documents: ["TraceSegmentDocument"], # required
})

Response structure


resp.unprocessed_trace_segments #=> Array
resp.unprocessed_trace_segments[0].id #=> String
resp.unprocessed_trace_segments[0].error_code #=> String
resp.unprocessed_trace_segments[0].message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :trace_segment_documents (required, Array<String>)

    A string containing a JSON document defining one or more segments or subsegments.

Returns:

See Also:



1160
1161
1162
1163
# File 'lib/aws-sdk-xray/client.rb', line 1160

def put_trace_segments(params = {}, options = {})
  req = build_request(:put_trace_segments, params)
  req.send_request(options)
end

#update_group(params = {}) ⇒ Types::UpdateGroupResult

Updates a group resource.

Examples:

Request syntax with placeholder values


resp = client.update_group({
  group_name: "GroupName",
  group_arn: "GroupARN",
  filter_expression: "FilterExpression",
})

Response structure


resp.group.group_name #=> String
resp.group.group_arn #=> String
resp.group.filter_expression #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (String)

    The case-sensitive name of the group.

  • :group_arn (String)

    The ARN that was generated upon creation.

  • :filter_expression (String)

    The updated filter expression defining criteria by which to group traces.

Returns:

See Also:



1199
1200
1201
1202
# File 'lib/aws-sdk-xray/client.rb', line 1199

def update_group(params = {}, options = {})
  req = build_request(:update_group, params)
  req.send_request(options)
end

#update_sampling_rule(params = {}) ⇒ Types::UpdateSamplingRuleResult

Modifies a sampling rule’s configuration.

Examples:

Request syntax with placeholder values


resp = client.update_sampling_rule({
  sampling_rule_update: { # required
    rule_name: "RuleName",
    rule_arn: "String",
    resource_arn: "ResourceARN",
    priority: 1,
    fixed_rate: 1.0,
    reservoir_size: 1,
    host: "Host",
    service_name: "ServiceName",
    service_type: "ServiceType",
    http_method: "HTTPMethod",
    url_path: "URLPath",
    attributes: {
      "AttributeKey" => "AttributeValue",
    },
  },
})

Response structure


resp.sampling_rule_record.sampling_rule.rule_name #=> String
resp.sampling_rule_record.sampling_rule.rule_arn #=> String
resp.sampling_rule_record.sampling_rule.resource_arn #=> String
resp.sampling_rule_record.sampling_rule.priority #=> Integer
resp.sampling_rule_record.sampling_rule.fixed_rate #=> Float
resp.sampling_rule_record.sampling_rule.reservoir_size #=> Integer
resp.sampling_rule_record.sampling_rule.service_name #=> String
resp.sampling_rule_record.sampling_rule.service_type #=> String
resp.sampling_rule_record.sampling_rule.host #=> String
resp.sampling_rule_record.sampling_rule.http_method #=> String
resp.sampling_rule_record.sampling_rule.url_path #=> String
resp.sampling_rule_record.sampling_rule.version #=> Integer
resp.sampling_rule_record.sampling_rule.attributes #=> Hash
resp.sampling_rule_record.sampling_rule.attributes["AttributeKey"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.sampling_rule_record.created_at #=> Time
resp.sampling_rule_record.modified_at #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



1257
1258
1259
1260
# File 'lib/aws-sdk-xray/client.rb', line 1257

def update_sampling_rule(params = {}, options = {})
  req = build_request(:update_sampling_rule, params)
  req.send_request(options)
end

#waiter_namesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.


1281
1282
1283
# File 'lib/aws-sdk-xray/client.rb', line 1281

def waiter_names
  []
end