Class: AWS.XRay

Inherits:
AWS.Service show all
Identifier:
xray
API Version:
2016-04-12
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

AWS X-Ray provides APIs for managing debug traces and retrieving service maps and other data created by processing those traces.

Sending a Request Using XRay

var xray = new AWS.XRay();
xray.getSamplingTargets(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the XRay object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var xray = new AWS.XRay({apiVersion: '2016-04-12'});

You can also set the API version globally in AWS.config.apiVersions using the xray service identifier:

AWS.config.apiVersions = {
  xray: '2016-04-12',
  // other service API versions
};

var xray = new AWS.XRay();

Version:

  • 2016-04-12

Constructor Summary

Property Summary

Properties inherited from AWS.Service

apiVersions

Method Summary

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.XRay(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a XRay object

var xray = new AWS.XRay({apiVersion: '2016-04-12'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.XRay.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.XRay.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.XRay.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean)

    whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

batchGetTraces(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the batchGetTraces operation

var params = {
  TraceIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  NextToken: 'STRING_VALUE'
};
xray.batchGetTraces(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TraceIds — (Array<String>)

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

    • NextToken — (String)

      Pagination token. Not used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Traces — (Array<map>)

        Full traces for the specified requests.

        • Id — (String)

          The unique identifier for the request that generated the trace's segments and subsegments.

        • Duration — (Float)

          The length of time in seconds between the start time of the root segment and the end time of the last segment that completed.

        • Segments — (Array<map>)

          Segment documents for the segments and subsegments that comprise the trace.

          • Id — (String)

            The segment's ID.

          • Document — (String)

            The segment document.

      • UnprocessedTraceIds — (Array<String>)

        Trace IDs of requests that haven't been processed.

      • NextToken — (String)

        Pagination token. Not used.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createGroup(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the createGroup operation

var params = {
  GroupName: 'STRING_VALUE', /* required */
  FilterExpression: 'STRING_VALUE'
};
xray.createGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

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

    • FilterExpression — (String)

      The filter expression defining criteria by which to group traces.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Group — (map)

        The group that was created. Contains the name of the group that was created, the ARN of the group that was generated based on the group name, and the filter expression that was assigned to the group.

        • GroupName — (String)

          The unique case-sensitive name of the group.

        • GroupARN — (String)

          The ARN of the group generated based on the GroupName.

        • FilterExpression — (String)

          The filter expression defining the parameters to include traces.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createSamplingRule(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the createSamplingRule operation

var params = {
  SamplingRule: { /* required */
    FixedRate: 'NUMBER_VALUE', /* required */
    HTTPMethod: 'STRING_VALUE', /* required */
    Host: 'STRING_VALUE', /* required */
    Priority: 'NUMBER_VALUE', /* required */
    ReservoirSize: 'NUMBER_VALUE', /* required */
    ResourceARN: 'STRING_VALUE', /* required */
    ServiceName: 'STRING_VALUE', /* required */
    ServiceType: 'STRING_VALUE', /* required */
    URLPath: 'STRING_VALUE', /* required */
    Version: 'NUMBER_VALUE', /* required */
    Attributes: {
      '<AttributeKey>': 'STRING_VALUE',
      /* '<AttributeKey>': ... */
    },
    RuleARN: 'STRING_VALUE',
    RuleName: 'STRING_VALUE'
  }
};
xray.createSamplingRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • SamplingRule — (map)

      The rule definition.

      • RuleName — (String)

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

      • RuleARN — (String)

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

      • ResourceARNrequired — (String)

        Matches the ARN of the AWS resource on which the service runs.

      • Priorityrequired — (Integer)

        The priority of the sampling rule.

      • FixedRaterequired — (Float)

        The percentage of matching requests to instrument, after the reservoir is exhausted.

      • ReservoirSizerequired — (Integer)

        A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

      • ServiceNamerequired — (String)

        Matches the name that the service uses to identify itself in segments.

      • ServiceTyperequired — (String)

        Matches the origin that the service uses to identify its type in segments.

      • Hostrequired — (String)

        Matches the hostname from a request URL.

      • HTTPMethodrequired — (String)

        Matches the HTTP method of a request.

      • URLPathrequired — (String)

        Matches the path from a request URL.

      • Versionrequired — (Integer)

        The version of the sampling rule format (1).

      • Attributes — (map<String>)

        Matches attributes derived from the request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SamplingRuleRecord — (map)

        The saved rule definition and metadata.

        • SamplingRule — (map)

          The sampling rule.

          • RuleName — (String)

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

          • RuleARN — (String)

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

          • ResourceARNrequired — (String)

            Matches the ARN of the AWS resource on which the service runs.

          • Priorityrequired — (Integer)

            The priority of the sampling rule.

          • FixedRaterequired — (Float)

            The percentage of matching requests to instrument, after the reservoir is exhausted.

          • ReservoirSizerequired — (Integer)

            A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

          • ServiceNamerequired — (String)

            Matches the name that the service uses to identify itself in segments.

          • ServiceTyperequired — (String)

            Matches the origin that the service uses to identify its type in segments.

          • Hostrequired — (String)

            Matches the hostname from a request URL.

          • HTTPMethodrequired — (String)

            Matches the HTTP method of a request.

          • URLPathrequired — (String)

            Matches the path from a request URL.

          • Versionrequired — (Integer)

            The version of the sampling rule format (1).

          • Attributes — (map<String>)

            Matches attributes derived from the request.

        • CreatedAt — (Date)

          When the rule was created.

        • ModifiedAt — (Date)

          When the rule was last modified.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteGroup(params = {}, callback) ⇒ AWS.Request

Deletes a group resource.

Service Reference:

Examples:

Calling the deleteGroup operation

var params = {
  GroupARN: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
xray.deleteGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      The case-sensitive name of the group.

    • GroupARN — (String)

      The ARN of the group that was generated on creation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteSamplingRule(params = {}, callback) ⇒ AWS.Request

Deletes a sampling rule.

Service Reference:

Examples:

Calling the deleteSamplingRule operation

var params = {
  RuleARN: 'STRING_VALUE',
  RuleName: 'STRING_VALUE'
};
xray.deleteSamplingRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • RuleName — (String)

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

    • RuleARN — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SamplingRuleRecord — (map)

        The deleted rule definition and metadata.

        • SamplingRule — (map)

          The sampling rule.

          • RuleName — (String)

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

          • RuleARN — (String)

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

          • ResourceARNrequired — (String)

            Matches the ARN of the AWS resource on which the service runs.

          • Priorityrequired — (Integer)

            The priority of the sampling rule.

          • FixedRaterequired — (Float)

            The percentage of matching requests to instrument, after the reservoir is exhausted.

          • ReservoirSizerequired — (Integer)

            A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

          • ServiceNamerequired — (String)

            Matches the name that the service uses to identify itself in segments.

          • ServiceTyperequired — (String)

            Matches the origin that the service uses to identify its type in segments.

          • Hostrequired — (String)

            Matches the hostname from a request URL.

          • HTTPMethodrequired — (String)

            Matches the HTTP method of a request.

          • URLPathrequired — (String)

            Matches the path from a request URL.

          • Versionrequired — (Integer)

            The version of the sampling rule format (1).

          • Attributes — (map<String>)

            Matches attributes derived from the request.

        • CreatedAt — (Date)

          When the rule was created.

        • ModifiedAt — (Date)

          When the rule was last modified.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getEncryptionConfig(params = {}, callback) ⇒ AWS.Request

Retrieves the current encryption configuration for X-Ray data.

Service Reference:

Examples:

Calling the getEncryptionConfig operation

var params = {
};
xray.getEncryptionConfig(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • EncryptionConfig — (map)

        The encryption configuration document.

        • KeyId — (String)

          The ID of the customer master key (CMK) used for encryption, if applicable.

        • Status — (String)

          The encryption status. While the status is UPDATING, X-Ray may encrypt data with a combination of the new and old settings.

          Possible values include:
          • "UPDATING"
          • "ACTIVE"
        • Type — (String)

          The type of encryption. Set to KMS for encryption with CMKs. Set to NONE for default encryption.

          Possible values include:
          • "NONE"
          • "KMS"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGroup(params = {}, callback) ⇒ AWS.Request

Retrieves group resource details.

Service Reference:

Examples:

Calling the getGroup operation

var params = {
  GroupARN: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
xray.getGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      The case-sensitive name of the group.

    • GroupARN — (String)

      The ARN of the group that was generated on creation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Group — (map)

        The group that was requested. Contains the name of the group, the ARN of the group, and the filter expression that assigned to the group.

        • GroupName — (String)

          The unique case-sensitive name of the group.

        • GroupARN — (String)

          The ARN of the group generated based on the GroupName.

        • FilterExpression — (String)

          The filter expression defining the parameters to include traces.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGroups(params = {}, callback) ⇒ AWS.Request

Retrieves all active group details.

Service Reference:

Examples:

Calling the getGroups operation

var params = {
  NextToken: 'STRING_VALUE'
};
xray.getGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NextToken — (String)

      Pagination token. Not used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Groups — (Array<map>)

        The collection of all active groups.

        • GroupName — (String)

          The unique case-sensitive name of the group.

        • GroupARN — (String)

          The ARN of the group generated based on the GroupName.

        • FilterExpression — (String)

          The filter expression defining the parameters to include traces.

      • NextToken — (String)

        Pagination token. Not used.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSamplingRules(params = {}, callback) ⇒ AWS.Request

Retrieves all sampling rules.

Service Reference:

Examples:

Calling the getSamplingRules operation

var params = {
  NextToken: 'STRING_VALUE'
};
xray.getSamplingRules(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NextToken — (String)

      Pagination token. Not used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SamplingRuleRecords — (Array<map>)

        Rule definitions and metadata.

        • SamplingRule — (map)

          The sampling rule.

          • RuleName — (String)

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

          • RuleARN — (String)

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

          • ResourceARNrequired — (String)

            Matches the ARN of the AWS resource on which the service runs.

          • Priorityrequired — (Integer)

            The priority of the sampling rule.

          • FixedRaterequired — (Float)

            The percentage of matching requests to instrument, after the reservoir is exhausted.

          • ReservoirSizerequired — (Integer)

            A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

          • ServiceNamerequired — (String)

            Matches the name that the service uses to identify itself in segments.

          • ServiceTyperequired — (String)

            Matches the origin that the service uses to identify its type in segments.

          • Hostrequired — (String)

            Matches the hostname from a request URL.

          • HTTPMethodrequired — (String)

            Matches the HTTP method of a request.

          • URLPathrequired — (String)

            Matches the path from a request URL.

          • Versionrequired — (Integer)

            The version of the sampling rule format (1).

          • Attributes — (map<String>)

            Matches attributes derived from the request.

        • CreatedAt — (Date)

          When the rule was created.

        • ModifiedAt — (Date)

          When the rule was last modified.

      • NextToken — (String)

        Pagination token. Not used.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSamplingStatisticSummaries(params = {}, callback) ⇒ AWS.Request

Retrieves information about recent sampling results for all sampling rules.

Service Reference:

Examples:

Calling the getSamplingStatisticSummaries operation

var params = {
  NextToken: 'STRING_VALUE'
};
xray.getSamplingStatisticSummaries(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NextToken — (String)

      Pagination token. Not used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SamplingStatisticSummaries — (Array<map>)

        Information about the number of requests instrumented for each sampling rule.

        • RuleName — (String)

          The name of the sampling rule.

        • Timestamp — (Date)

          The start time of the reporting window.

        • RequestCount — (Integer)

          The number of requests that matched the rule.

        • BorrowCount — (Integer)

          The number of requests recorded with borrowed reservoir quota.

        • SampledCount — (Integer)

          The number of requests recorded.

      • NextToken — (String)

        Pagination token. Not used.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSamplingTargets(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the getSamplingTargets operation

var params = {
  SamplingStatisticsDocuments: [ /* required */
    {
      ClientID: 'STRING_VALUE', /* required */
      RequestCount: 'NUMBER_VALUE', /* required */
      RuleName: 'STRING_VALUE', /* required */
      SampledCount: 'NUMBER_VALUE', /* required */
      Timestamp: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
      BorrowCount: 'NUMBER_VALUE'
    },
    /* more items */
  ]
};
xray.getSamplingTargets(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • SamplingStatisticsDocuments — (Array<map>)

      Information about rules that the service is using to sample requests.

      • RuleNamerequired — (String)

        The name of the sampling rule.

      • ClientIDrequired — (String)

        A unique identifier for the service in hexadecimal.

      • Timestamprequired — (Date)

        The current time.

      • RequestCountrequired — (Integer)

        The number of requests that matched the rule.

      • SampledCountrequired — (Integer)

        The number of requests recorded.

      • BorrowCount — (Integer)

        The number of requests recorded with borrowed reservoir quota.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SamplingTargetDocuments — (Array<map>)

        Updated rules that the service should use to sample requests.

        • RuleName — (String)

          The name of the sampling rule.

        • FixedRate — (Float)

          The percentage of matching requests to instrument, after the reservoir is exhausted.

        • ReservoirQuota — (Integer)

          The number of requests per second that X-Ray allocated this service.

        • ReservoirQuotaTTL — (Date)

          When the reservoir quota expires.

        • Interval — (Integer)

          The number of seconds for the service to wait before getting sampling targets again.

      • LastRuleModification — (Date)

        The last time a user changed the sampling rule configuration. If the sampling rule configuration changed since the service last retrieved it, the service should call GetSamplingRules to get the latest version.

      • UnprocessedStatistics — (Array<map>)

        Information about SamplingStatisticsDocument that X-Ray could not process.

        • RuleName — (String)

          The name of the sampling rule.

        • ErrorCode — (String)

          The error code.

        • Message — (String)

          The error message.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getServiceGraph(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the getServiceGraph operation

var params = {
  EndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  StartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  GroupARN: 'STRING_VALUE',
  GroupName: 'STRING_VALUE',
  NextToken: 'STRING_VALUE'
};
xray.getServiceGraph(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • StartTime — (Date)

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

    • EndTime — (Date)

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

    • GroupName — (String)

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

    • GroupARN — (String)

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

    • NextToken — (String)

      Pagination token. Not used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • StartTime — (Date)

        The start of the time frame for which the graph was generated.

      • EndTime — (Date)

        The end of the time frame for which the graph was generated.

      • Services — (Array<map>)

        The services that have processed a traced request during the specified time frame.

        • ReferenceId — (Integer)

          Identifier for the service. Unique within the service map.

        • Name — (String)

          The canonical name of the service.

        • Names — (Array<String>)

          A list of names for the service, including the canonical name.

        • Root — (Boolean)

          Indicates that the service was the first service to process a request.

        • AccountId — (String)

          Identifier of the AWS account in which the service runs.

        • Type — (String)

          The type of service.

          • AWS Resource - The type of an AWS resource. For example, AWS::EC2::Instance for a application running on Amazon EC2 or AWS::DynamoDB::Table for an Amazon DynamoDB table that the application used.

          • AWS Service - The type of an AWS service. For example, AWS::DynamoDB for downstream calls to Amazon DynamoDB that didn't target a specific table.

          • client - Represents the clients that sent requests to a root service.

          • remote - A downstream service of indeterminate type.

        • State — (String)

          The service's state.

        • StartTime — (Date)

          The start time of the first segment that the service generated.

        • EndTime — (Date)

          The end time of the last segment that the service generated.

        • Edges — (Array<map>)

          Connections to downstream services.

          • ReferenceId — (Integer)

            Identifier of the edge. Unique within a service map.

          • StartTime — (Date)

            The start time of the first segment on the edge.

          • EndTime — (Date)

            The end time of the last segment on the edge.

          • SummaryStatistics — (map)

            Response statistics for segments on the edge.

            • OkCount — (Integer)

              The number of requests that completed with a 2xx Success status code.

            • ErrorStatistics — (map)

              Information about requests that failed with a 4xx Client Error status code.

              • ThrottleCount — (Integer)

                The number of requests that failed with a 419 throttling status code.

              • OtherCount — (Integer)

                The number of requests that failed with untracked 4xx Client Error status codes.

              • TotalCount — (Integer)

                The total number of requests that failed with a 4xx Client Error status code.

            • FaultStatistics — (map)

              Information about requests that failed with a 5xx Server Error status code.

              • OtherCount — (Integer)

                The number of requests that failed with untracked 5xx Server Error status codes.

              • TotalCount — (Integer)

                The total number of requests that failed with a 5xx Server Error status code.

            • TotalCount — (Integer)

              The total number of completed requests.

            • TotalResponseTime — (Float)

              The aggregate response time of completed requests.

          • ResponseTimeHistogram — (Array<map>)

            A histogram that maps the spread of client response times on an edge.

            • Value — (Float)

              The value of the entry.

            • Count — (Integer)

              The prevalence of the entry.

          • Aliases — (Array<map>)

            Aliases for the edge.

            • Name — (String)

              The canonical name of the alias.

            • Names — (Array<String>)

              A list of names for the alias, including the canonical name.

            • Type — (String)

              The type of the alias.

        • SummaryStatistics — (map)

          Aggregated statistics for the service.

          • OkCount — (Integer)

            The number of requests that completed with a 2xx Success status code.

          • ErrorStatistics — (map)

            Information about requests that failed with a 4xx Client Error status code.

            • ThrottleCount — (Integer)

              The number of requests that failed with a 419 throttling status code.

            • OtherCount — (Integer)

              The number of requests that failed with untracked 4xx Client Error status codes.

            • TotalCount — (Integer)

              The total number of requests that failed with a 4xx Client Error status code.

          • FaultStatistics — (map)

            Information about requests that failed with a 5xx Server Error status code.

            • OtherCount — (Integer)

              The number of requests that failed with untracked 5xx Server Error status codes.

            • TotalCount — (Integer)

              The total number of requests that failed with a 5xx Server Error status code.

          • TotalCount — (Integer)

            The total number of completed requests.

          • TotalResponseTime — (Float)

            The aggregate response time of completed requests.

        • DurationHistogram — (Array<map>)

          A histogram that maps the spread of service durations.

          • Value — (Float)

            The value of the entry.

          • Count — (Integer)

            The prevalence of the entry.

        • ResponseTimeHistogram — (Array<map>)

          A histogram that maps the spread of service response times.

          • Value — (Float)

            The value of the entry.

          • Count — (Integer)

            The prevalence of the entry.

      • ContainsOldGroupVersions — (Boolean)

        A flag indicating whether the group's filter expression has been consistent, or if the returned service graph may show traces from an older version of the group's filter expression.

      • NextToken — (String)

        Pagination token. Not used.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getTraceGraph(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the getTraceGraph operation

var params = {
  TraceIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  NextToken: 'STRING_VALUE'
};
xray.getTraceGraph(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TraceIds — (Array<String>)

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

    • NextToken — (String)

      Pagination token. Not used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Services — (Array<map>)

        The services that have processed one of the specified requests.

        • ReferenceId — (Integer)

          Identifier for the service. Unique within the service map.

        • Name — (String)

          The canonical name of the service.

        • Names — (Array<String>)

          A list of names for the service, including the canonical name.

        • Root — (Boolean)

          Indicates that the service was the first service to process a request.

        • AccountId — (String)

          Identifier of the AWS account in which the service runs.

        • Type — (String)

          The type of service.

          • AWS Resource - The type of an AWS resource. For example, AWS::EC2::Instance for a application running on Amazon EC2 or AWS::DynamoDB::Table for an Amazon DynamoDB table that the application used.

          • AWS Service - The type of an AWS service. For example, AWS::DynamoDB for downstream calls to Amazon DynamoDB that didn't target a specific table.

          • client - Represents the clients that sent requests to a root service.

          • remote - A downstream service of indeterminate type.

        • State — (String)

          The service's state.

        • StartTime — (Date)

          The start time of the first segment that the service generated.

        • EndTime — (Date)

          The end time of the last segment that the service generated.

        • Edges — (Array<map>)

          Connections to downstream services.

          • ReferenceId — (Integer)

            Identifier of the edge. Unique within a service map.

          • StartTime — (Date)

            The start time of the first segment on the edge.

          • EndTime — (Date)

            The end time of the last segment on the edge.

          • SummaryStatistics — (map)

            Response statistics for segments on the edge.

            • OkCount — (Integer)

              The number of requests that completed with a 2xx Success status code.

            • ErrorStatistics — (map)

              Information about requests that failed with a 4xx Client Error status code.

              • ThrottleCount — (Integer)

                The number of requests that failed with a 419 throttling status code.

              • OtherCount — (Integer)

                The number of requests that failed with untracked 4xx Client Error status codes.

              • TotalCount — (Integer)

                The total number of requests that failed with a 4xx Client Error status code.

            • FaultStatistics — (map)

              Information about requests that failed with a 5xx Server Error status code.

              • OtherCount — (Integer)

                The number of requests that failed with untracked 5xx Server Error status codes.

              • TotalCount — (Integer)

                The total number of requests that failed with a 5xx Server Error status code.

            • TotalCount — (Integer)

              The total number of completed requests.

            • TotalResponseTime — (Float)

              The aggregate response time of completed requests.

          • ResponseTimeHistogram — (Array<map>)

            A histogram that maps the spread of client response times on an edge.

            • Value — (Float)

              The value of the entry.

            • Count — (Integer)

              The prevalence of the entry.

          • Aliases — (Array<map>)

            Aliases for the edge.

            • Name — (String)

              The canonical name of the alias.

            • Names — (Array<String>)

              A list of names for the alias, including the canonical name.

            • Type — (String)

              The type of the alias.

        • SummaryStatistics — (map)

          Aggregated statistics for the service.

          • OkCount — (Integer)

            The number of requests that completed with a 2xx Success status code.

          • ErrorStatistics — (map)

            Information about requests that failed with a 4xx Client Error status code.

            • ThrottleCount — (Integer)

              The number of requests that failed with a 419 throttling status code.

            • OtherCount — (Integer)

              The number of requests that failed with untracked 4xx Client Error status codes.

            • TotalCount — (Integer)

              The total number of requests that failed with a 4xx Client Error status code.

          • FaultStatistics — (map)

            Information about requests that failed with a 5xx Server Error status code.

            • OtherCount — (Integer)

              The number of requests that failed with untracked 5xx Server Error status codes.

            • TotalCount — (Integer)

              The total number of requests that failed with a 5xx Server Error status code.

          • TotalCount — (Integer)

            The total number of completed requests.

          • TotalResponseTime — (Float)

            The aggregate response time of completed requests.

        • DurationHistogram — (Array<map>)

          A histogram that maps the spread of service durations.

          • Value — (Float)

            The value of the entry.

          • Count — (Integer)

            The prevalence of the entry.

        • ResponseTimeHistogram — (Array<map>)

          A histogram that maps the spread of service response times.

          • Value — (Float)

            The value of the entry.

          • Count — (Integer)

            The prevalence of the entry.

      • NextToken — (String)

        Pagination token. Not used.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getTraceSummaries(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the getTraceSummaries operation

var params = {
  EndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  StartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  FilterExpression: 'STRING_VALUE',
  NextToken: 'STRING_VALUE',
  Sampling: true || false
};
xray.getTraceSummaries(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • StartTime — (Date)

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

    • EndTime — (Date)

      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.

    • FilterExpression — (String)

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

    • NextToken — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TraceSummaries — (Array<map>)

        Trace IDs and metadata for traces that were found in the specified time frame.

        • Id — (String)

          The unique identifier for the request that generated the trace's segments and subsegments.

        • Duration — (Float)

          The length of time in seconds between the start time of the root segment and the end time of the last segment that completed.

        • ResponseTime — (Float)

          The length of time in seconds between the start and end times of the root segment. If the service performs work asynchronously, the response time measures the time before the response is sent to the user, while the duration measures the amount of time before the last traced activity completes.

        • HasFault — (Boolean)

          One or more of the segment documents has a 500 series error.

        • HasError — (Boolean)

          One or more of the segment documents has a 400 series error.

        • HasThrottle — (Boolean)

          One or more of the segment documents has a 429 throttling error.

        • IsPartial — (Boolean)

          One or more of the segment documents is in progress.

        • Http — (map)

          Information about the HTTP request served by the trace.

          • HttpURL — (String)

            The request URL.

          • HttpStatus — (Integer)

            The response status.

          • HttpMethod — (String)

            The request method.

          • UserAgent — (String)

            The request's user agent string.

          • ClientIp — (String)

            The IP address of the requestor.

        • Annotations — (map<Array<map>>)

          Annotations from the trace's segment documents.

          • AnnotationValue — (map)

            Values of the annotation.

            • NumberValue — (Float)

              Value for a Number annotation.

            • BooleanValue — (Boolean)

              Value for a Boolean annotation.

            • StringValue — (String)

              Value for a String annotation.

          • ServiceIds — (Array<map>)

            Services to which the annotation applies.

            • Name — (String)

            • Names — (Array<String>)

            • AccountId — (String)

            • Type — (String)

        • Users — (Array<map>)

          Users from the trace's segment documents.

          • UserName — (String)

            The user's name.

          • ServiceIds — (Array<map>)

            Services that the user's request hit.

            • Name — (String)

            • Names — (Array<String>)

            • AccountId — (String)

            • Type — (String)

        • ServiceIds — (Array<map>)

          Service IDs from the trace's segment documents.

          • Name — (String)

          • Names — (Array<String>)

          • AccountId — (String)

          • Type — (String)

        • ResourceARNs — (Array<map>)

          A list of resource ARNs for any resource corresponding to the trace segments.

          • ARN — (String)

            The ARN of a corresponding resource.

        • InstanceIds — (Array<map>)

          A list of EC2 instance IDs for any instance corresponding to the trace segments.

          • Id — (String)

            The ID of a corresponding EC2 instance.

        • AvailabilityZones — (Array<map>)

          A list of availability zones for any zone corresponding to the trace segments.

          • Name — (String)

            The name of a corresponding availability zone.

        • EntryPoint — (map)

          The root of a trace.

          • Name — (String)

          • Names — (Array<String>)

          • AccountId — (String)

          • Type — (String)

        • FaultRootCauses — (Array<map>)

          A collection of FaultRootCause structures corresponding to the the trace segments.

          • Services — (Array<map>)

            A list of corresponding services. A service identifies a segment and it contains a name, account ID, type, and inferred flag.

            • Name — (String)

              The service name.

            • Names — (Array<String>)

              A collection of associated service names.

            • Type — (String)

              The type associated to the service.

            • AccountId — (String)

              The account ID associated to the service.

            • EntityPath — (Array<map>)

              The path of root cause entities found on the service.

              • Name — (String)

                The name of the entity.

              • Exceptions — (Array<map>)

                The types and messages of the exceptions.

                • Name — (String)

                  The name of the exception.

                • Message — (String)

                  The message of the exception.

              • Remote — (Boolean)

                A flag that denotes a remote subsegment.

            • Inferred — (Boolean)

              A Boolean value indicating if the service is inferred from the trace.

        • ErrorRootCauses — (Array<map>)

          A collection of ErrorRootCause structures corresponding to the trace segments.

          • Services — (Array<map>)

            A list of services corresponding to an error. A service identifies a segment and it contains a name, account ID, type, and inferred flag.

            • Name — (String)

              The service name.

            • Names — (Array<String>)

              A collection of associated service names.

            • Type — (String)

              The type associated to the service.

            • AccountId — (String)

              The account ID associated to the service.

            • EntityPath — (Array<map>)

              The path of root cause entities found on the service.

              • Name — (String)

                The name of the entity.

              • Exceptions — (Array<map>)

                The types and messages of the exceptions.

                • Name — (String)

                  The name of the exception.

                • Message — (String)

                  The message of the exception.

              • Remote — (Boolean)

                A flag that denotes a remote subsegment.

            • Inferred — (Boolean)

              A Boolean value indicating if the service is inferred from the trace.

        • ResponseTimeRootCauses — (Array<map>)

          A collection of ResponseTimeRootCause structures corresponding to the trace segments.

          • Services — (Array<map>)

            A list of corresponding services. A service identifies a segment and contains a name, account ID, type, and inferred flag.

            • Name — (String)

              The service name.

            • Names — (Array<String>)

              A collection of associated service names.

            • Type — (String)

              The type associated to the service.

            • AccountId — (String)

              The account ID associated to the service.

            • EntityPath — (Array<map>)

              The path of root cause entities found on the service.

              • Name — (String)

                The name of the entity.

              • Coverage — (Float)

                The types and messages of the exceptions.

              • Remote — (Boolean)

                A flag that denotes a remote subsegment.

            • Inferred — (Boolean)

              A Boolean value indicating if the service is inferred from the trace.

        • Revision — (Integer)

          The revision number of a trace.

      • ApproximateTime — (Date)

        The start time of this page of results.

      • TracesProcessedCount — (Integer)

        The total number of traces processed, including traces that did not match the specified filter expression.

      • NextToken — (String)

        If the requested time frame contained more than one page of results, you can use this token to retrieve the next page. The first page contains the most most recent results, closest to the end of the time frame.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putEncryptionConfig(params = {}, callback) ⇒ AWS.Request

Updates the encryption configuration for X-Ray data.

Service Reference:

Examples:

Calling the putEncryptionConfig operation

var params = {
  Type: NONE | KMS, /* required */
  KeyId: 'STRING_VALUE'
};
xray.putEncryptionConfig(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • KeyId — (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 — (String)

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

      Possible values include:
      • "NONE"
      • "KMS"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • EncryptionConfig — (map)

        The new encryption configuration.

        • KeyId — (String)

          The ID of the customer master key (CMK) used for encryption, if applicable.

        • Status — (String)

          The encryption status. While the status is UPDATING, X-Ray may encrypt data with a combination of the new and old settings.

          Possible values include:
          • "UPDATING"
          • "ACTIVE"
        • Type — (String)

          The type of encryption. Set to KMS for encryption with CMKs. Set to NONE for default encryption.

          Possible values include:
          • "NONE"
          • "KMS"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putTelemetryRecords(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the putTelemetryRecords operation

var params = {
  TelemetryRecords: [ /* required */
    {
      Timestamp: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
      BackendConnectionErrors: {
        ConnectionRefusedCount: 'NUMBER_VALUE',
        HTTPCode4XXCount: 'NUMBER_VALUE',
        HTTPCode5XXCount: 'NUMBER_VALUE',
        OtherCount: 'NUMBER_VALUE',
        TimeoutCount: 'NUMBER_VALUE',
        UnknownHostCount: 'NUMBER_VALUE'
      },
      SegmentsReceivedCount: 'NUMBER_VALUE',
      SegmentsRejectedCount: 'NUMBER_VALUE',
      SegmentsSentCount: 'NUMBER_VALUE',
      SegmentsSpilloverCount: 'NUMBER_VALUE'
    },
    /* more items */
  ],
  EC2InstanceId: 'STRING_VALUE',
  Hostname: 'STRING_VALUE',
  ResourceARN: 'STRING_VALUE'
};
xray.putTelemetryRecords(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TelemetryRecords — (Array<map>)

      • Timestamprequired — (Date)

      • SegmentsReceivedCount — (Integer)

      • SegmentsSentCount — (Integer)

      • SegmentsSpilloverCount — (Integer)

      • SegmentsRejectedCount — (Integer)

      • BackendConnectionErrors — (map)

        • TimeoutCount — (Integer)

        • ConnectionRefusedCount — (Integer)

        • HTTPCode4XXCount — (Integer)

        • HTTPCode5XXCount — (Integer)

        • UnknownHostCount — (Integer)

        • OtherCount — (Integer)

    • EC2InstanceId — (String)

    • Hostname — (String)

    • ResourceARN — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putTraceSegments(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the putTraceSegments operation

var params = {
  TraceSegmentDocuments: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
xray.putTraceSegments(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TraceSegmentDocuments — (Array<String>)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • UnprocessedTraceSegments — (Array<map>)

        Segments that failed processing.

        • Id — (String)

          The segment's ID.

        • ErrorCode — (String)

          The error that caused processing to fail.

        • Message — (String)

          The error message.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateGroup(params = {}, callback) ⇒ AWS.Request

Updates a group resource.

Service Reference:

Examples:

Calling the updateGroup operation

var params = {
  FilterExpression: 'STRING_VALUE',
  GroupARN: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
xray.updateGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      The case-sensitive name of the group.

    • GroupARN — (String)

      The ARN that was generated upon creation.

    • FilterExpression — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Group — (map)

        The group that was updated. Contains the name of the group that was updated, the ARN of the group that was updated, and the updated filter expression assigned to the group.

        • GroupName — (String)

          The unique case-sensitive name of the group.

        • GroupARN — (String)

          The ARN of the group generated based on the GroupName.

        • FilterExpression — (String)

          The filter expression defining the parameters to include traces.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateSamplingRule(params = {}, callback) ⇒ AWS.Request

Modifies a sampling rule's configuration.

Service Reference:

Examples:

Calling the updateSamplingRule operation

var params = {
  SamplingRuleUpdate: { /* required */
    Attributes: {
      '<AttributeKey>': 'STRING_VALUE',
      /* '<AttributeKey>': ... */
    },
    FixedRate: 'NUMBER_VALUE',
    HTTPMethod: 'STRING_VALUE',
    Host: 'STRING_VALUE',
    Priority: 'NUMBER_VALUE',
    ReservoirSize: 'NUMBER_VALUE',
    ResourceARN: 'STRING_VALUE',
    RuleARN: 'STRING_VALUE',
    RuleName: 'STRING_VALUE',
    ServiceName: 'STRING_VALUE',
    ServiceType: 'STRING_VALUE',
    URLPath: 'STRING_VALUE'
  }
};
xray.updateSamplingRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • SamplingRuleUpdate — (map)

      The rule and fields to change.

      • RuleName — (String)

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

      • RuleARN — (String)

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

      • ResourceARN — (String)

        Matches the ARN of the AWS resource on which the service runs.

      • Priority — (Integer)

        The priority of the sampling rule.

      • FixedRate — (Float)

        The percentage of matching requests to instrument, after the reservoir is exhausted.

      • ReservoirSize — (Integer)

        A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

      • Host — (String)

        Matches the hostname from a request URL.

      • ServiceName — (String)

        Matches the name that the service uses to identify itself in segments.

      • ServiceType — (String)

        Matches the origin that the service uses to identify its type in segments.

      • HTTPMethod — (String)

        Matches the HTTP method of a request.

      • URLPath — (String)

        Matches the path from a request URL.

      • Attributes — (map<String>)

        Matches attributes derived from the request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SamplingRuleRecord — (map)

        The updated rule definition and metadata.

        • SamplingRule — (map)

          The sampling rule.

          • RuleName — (String)

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

          • RuleARN — (String)

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

          • ResourceARNrequired — (String)

            Matches the ARN of the AWS resource on which the service runs.

          • Priorityrequired — (Integer)

            The priority of the sampling rule.

          • FixedRaterequired — (Float)

            The percentage of matching requests to instrument, after the reservoir is exhausted.

          • ReservoirSizerequired — (Integer)

            A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

          • ServiceNamerequired — (String)

            Matches the name that the service uses to identify itself in segments.

          • ServiceTyperequired — (String)

            Matches the origin that the service uses to identify its type in segments.

          • Hostrequired — (String)

            Matches the hostname from a request URL.

          • HTTPMethodrequired — (String)

            Matches the HTTP method of a request.

          • URLPathrequired — (String)

            Matches the path from a request URL.

          • Versionrequired — (Integer)

            The version of the sampling rule format (1).

          • Attributes — (map<String>)

            Matches attributes derived from the request.

        • CreatedAt — (Date)

          When the rule was created.

        • ModifiedAt — (Date)

          When the rule was last modified.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.