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 collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

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|AWS.Endpoint)

    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' or an Endpoint object.

  • 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.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets 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 error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • 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|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • 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.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

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.

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.

        • LimitExceeded — (Boolean)

          LimitExceeded is set to true when the trace has exceeded one of the defined quotas. For more information about quotas, see AWS X-Ray endpoints and quotas.

        • 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.

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',
  InsightsConfiguration: {
    InsightsEnabled: true || false,
    NotificationsEnabled: true || false
  },
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
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.

    • InsightsConfiguration — (map)

      The structure containing configurations related to insights.

      • The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.

      • The NotifcationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.

      • InsightsEnabled — (Boolean)

        Set the InsightsEnabled value to true to enable insights or false to disable insights.

      • NotificationsEnabled — (Boolean)

        Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.

    • Tags — (Array<map>)

      A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see Tagging AWS resources in the AWS General Reference.

      The following restrictions apply to tags:

      • Maximum number of user-applied tags per resource: 50

      • Maximum tag key length: 128 Unicode characters

      • Maximum tag value length: 256 Unicode characters

      • Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @

      • Tag keys and values are case sensitive.

      • Don't use aws: as a prefix for keys; it's reserved for AWS use.

      • Keyrequired — (String)

        A tag key, such as Stage or Name. A tag key cannot be empty. The key can be a maximum of 128 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

      • Valuerequired — (String)

        An optional tag value, such as Production or test-only. The value can be a maximum of 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

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 Amazon Resource Name (ARN) of the group that was generated based on the group name, the filter expression, and the insight configuration that was assigned to the group.

        • GroupName — (String)

          The unique case-sensitive name of the group.

        • GroupARN — (String)

          The Amazon Resource Name (ARN) of the group generated based on the GroupName.

        • FilterExpression — (String)

          The filter expression defining the parameters to include traces.

        • InsightsConfiguration — (map)

          The structure containing configurations related to insights.

          • The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.

          • The NotifcationsEnabled boolean can be set to true to enable insights notifications through Amazon EventBridge for the group.

          • InsightsEnabled — (Boolean)

            Set the InsightsEnabled value to true to enable insights or false to disable insights.

          • NotificationsEnabled — (Boolean)

            Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.

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'
  },
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
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.

    • Tags — (Array<map>)

      A map that contains one or more tag keys and tag values to attach to an X-Ray sampling rule. For more information about ways to use tags, see Tagging AWS resources in the AWS General Reference.

      The following restrictions apply to tags:

      • Maximum number of user-applied tags per resource: 50

      • Maximum tag key length: 128 Unicode characters

      • Maximum tag value length: 256 Unicode characters

      • Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @

      • Tag keys and values are case sensitive.

      • Don't use aws: as a prefix for keys; it's reserved for AWS use.

      • Keyrequired — (String)

        A tag key, such as Stage or Name. A tag key cannot be empty. The key can be a maximum of 128 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

      • Valuerequired — (String)

        An optional tag value, such as Production or test-only. The value can be a maximum of 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

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, the filter expression, and the insight configuration assigned to the group.

        • GroupName — (String)

          The unique case-sensitive name of the group.

        • GroupARN — (String)

          The Amazon Resource Name (ARN) of the group generated based on the GroupName.

        • FilterExpression — (String)

          The filter expression defining the parameters to include traces.

        • InsightsConfiguration — (map)

          The structure containing configurations related to insights.

          • The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.

          • The NotifcationsEnabled boolean can be set to true to enable insights notifications through Amazon EventBridge for the group.

          • InsightsEnabled — (Boolean)

            Set the InsightsEnabled value to true to enable insights or false to disable insights.

          • NotificationsEnabled — (Boolean)

            Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.

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.

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.

        • InsightsConfiguration — (map)

          The structure containing configurations related to insights.

          • The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.

          • The NotificationsEnabled boolean can be set to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.

          • InsightsEnabled — (Boolean)

            Set the InsightsEnabled value to true to enable insights or false to disable insights.

          • NotificationsEnabled — (Boolean)

            Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.

      • NextToken — (String)

        Pagination token.

Returns:

  • (AWS.Request)

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

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

Retrieves the summary information of an insight. This includes impact to clients and root cause services, the top anomalous services, the category, the state of the insight, and the start and end time of the insight.

Service Reference:

Examples:

Calling the getInsight operation

var params = {
  InsightId: 'STRING_VALUE' /* required */
};
xray.getInsight(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: {})
    • InsightId — (String)

      The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.

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:

      • Insight — (map)

        The summary information of an insight.

        • InsightId — (String)

          The insights unique identifier.

        • GroupARN — (String)

          The Amazon Resource Name (ARN) of the group that the insight belongs to.

        • GroupName — (String)

          The name of the group that the insight belongs to.

        • RootCauseServiceId — (map)

          • Name — (String)

          • Names — (Array<String>)

          • AccountId — (String)

          • Type — (String)

        • Categories — (Array<String>)

          The categories that label and describe the type of insight.

        • State — (String)

          The current state of the insight.

          Possible values include:
          • "ACTIVE"
          • "CLOSED"
        • StartTime — (Date)

          The time, in Unix seconds, at which the insight began.

        • EndTime — (Date)

          The time, in Unix seconds, at which the insight ended.

        • Summary — (String)

          A brief description of the insight.

        • ClientRequestImpactStatistics — (map)

          The impact statistics of the client side service. This includes the number of requests to the client service and whether the requests were faults or okay.

          • FaultCount — (Integer)

            The number of requests that have resulted in a fault,

          • OkCount — (Integer)

            The number of successful requests.

          • TotalCount — (Integer)

            The total number of requests to the service.

        • RootCauseServiceRequestImpactStatistics — (map)

          The impact statistics of the root cause service. This includes the number of requests to the client service and whether the requests were faults or okay.

          • FaultCount — (Integer)

            The number of requests that have resulted in a fault,

          • OkCount — (Integer)

            The number of successful requests.

          • TotalCount — (Integer)

            The total number of requests to the service.

        • TopAnomalousServices — (Array<map>)

          The service within the insight that is most impacted by the incident.

          • ServiceId — (map)

            • Name — (String)

            • Names — (Array<String>)

            • AccountId — (String)

            • Type — (String)

Returns:

  • (AWS.Request)

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

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

X-Ray reevaluates insights periodically until they're resolved, and records each intermediate state as an event. You can review an insight's events in the Impact Timeline on the Inspect page in the X-Ray console.

Service Reference:

Examples:

Calling the getInsightEvents operation

var params = {
  InsightId: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
xray.getInsightEvents(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: {})
    • InsightId — (String)

      The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.

    • MaxResults — (Integer)

      Used to retrieve at most the specified value of events.

    • NextToken — (String)

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

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:

      • InsightEvents — (Array<map>)

        A detailed description of the event. This includes the time of the event, client and root cause impact statistics, and the top anomalous service at the time of the event.

        • Summary — (String)

          A brief description of the event.

        • EventTime — (Date)

          The time, in Unix seconds, at which the event was recorded.

        • ClientRequestImpactStatistics — (map)

          The impact statistics of the client side service. This includes the number of requests to the client service and whether the requests were faults or okay.

          • FaultCount — (Integer)

            The number of requests that have resulted in a fault,

          • OkCount — (Integer)

            The number of successful requests.

          • TotalCount — (Integer)

            The total number of requests to the service.

        • RootCauseServiceRequestImpactStatistics — (map)

          The impact statistics of the root cause service. This includes the number of requests to the client service and whether the requests were faults or okay.

          • FaultCount — (Integer)

            The number of requests that have resulted in a fault,

          • OkCount — (Integer)

            The number of successful requests.

          • TotalCount — (Integer)

            The total number of requests to the service.

        • TopAnomalousServices — (Array<map>)

          The service during the event that is most impacted by the incident.

          • ServiceId — (map)

            • Name — (String)

            • Names — (Array<String>)

            • AccountId — (String)

            • Type — (String)

      • NextToken — (String)

        Use this token to retrieve the next page of insight events.

Returns:

  • (AWS.Request)

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

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

Retrieves a service graph structure filtered by the specified insight. The service graph is limited to only structural information. For a complete service graph, use this API with the GetServiceGraph API.

Service Reference:

Examples:

Calling the getInsightImpactGraph operation

var params = {
  EndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  InsightId: 'STRING_VALUE', /* required */
  StartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  NextToken: 'STRING_VALUE'
};
xray.getInsightImpactGraph(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: {})
    • InsightId — (String)

      The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.

    • StartTime — (Date)

      The estimated start time of the insight, in Unix time seconds. The StartTime is inclusive of the value provided and can't be more than 30 days old.

    • EndTime — (Date)

      The estimated end time of the insight, in Unix time seconds. The EndTime is exclusive of the value provided. The time range between the start time and end time can't be more than six hours.

    • 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:

      • InsightId — (String)

        The insight's unique identifier.

      • StartTime — (Date)

        The provided start time.

      • EndTime — (Date)

        The provided end time.

      • ServiceGraphStartTime — (Date)

        The time, in Unix seconds, at which the service graph started.

      • ServiceGraphEndTime — (Date)

        The time, in Unix seconds, at which the service graph ended.

      • Services — (Array<map>)

        The AWS instrumented services related to the insight.

        • ReferenceId — (Integer)

          Identifier for the service. Unique within the service map.

        • Type — (String)

          Identifier for the service. Unique within the service map.

          • AWS Resource - The type of an AWS resource. For example, AWS::EC2::Instance for an 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.

          • 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.

          • remote - A downstream service of indeterminate type.

        • Name — (String)

          The canonical name of the service.

        • Names — (Array<String>)

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

        • AccountId — (String)

          Identifier of the AWS account in which the service runs.

        • Edges — (Array<map>)

          Connections to downstream services.

          • ReferenceId — (Integer)

            Identifier of the edge. Unique within a service map.

      • NextToken — (String)

        Pagination token.

Returns:

  • (AWS.Request)

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

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

Retrieves the summaries of all insights in the specified group matching the provided filter values.

Service Reference:

Examples:

Calling the getInsightSummaries 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',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  States: [
    ACTIVE | CLOSED,
    /* more items */
  ]
};
xray.getInsightSummaries(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: {})
    • States — (Array<String>)

      The list of insight states.

    • GroupARN — (String)

      The Amazon Resource Name (ARN) of the group. Required if the GroupName isn't provided.

    • GroupName — (String)

      The name of the group. Required if the GroupARN isn't provided.

    • StartTime — (Date)

      The beginning of the time frame in which the insights started. The start time can't be more than 30 days old.

    • EndTime — (Date)

      The end of the time frame in which the insights ended. The end time can't be more than 30 days old.

    • MaxResults — (Integer)

      The maximum number of results to display.

    • NextToken — (String)

      Pagination token.

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:

      • InsightSummaries — (Array<map>)

        The summary of each insight within the group matching the provided filters. The summary contains the InsightID, start and end time, the root cause service, the root cause and client impact statistics, the top anomalous services, and the status of the insight.

        • InsightId — (String)

          The insights unique identifier.

        • GroupARN — (String)

          The Amazon Resource Name (ARN) of the group that the insight belongs to.

        • GroupName — (String)

          The name of the group that the insight belongs to.

        • RootCauseServiceId — (map)

          • Name — (String)

          • Names — (Array<String>)

          • AccountId — (String)

          • Type — (String)

        • Categories — (Array<String>)

          Categories The categories that label and describe the type of insight.

        • State — (String)

          The current state of the insight.

          Possible values include:
          • "ACTIVE"
          • "CLOSED"
        • StartTime — (Date)

          The time, in Unix seconds, at which the insight began.

        • EndTime — (Date)

          The time, in Unix seconds, at which the insight ended.

        • Summary — (String)

          A brief description of the insight.

        • ClientRequestImpactStatistics — (map)

          The impact statistics of the client side service. This includes the number of requests to the client service and whether the requests were faults or okay.

          • FaultCount — (Integer)

            The number of requests that have resulted in a fault,

          • OkCount — (Integer)

            The number of successful requests.

          • TotalCount — (Integer)

            The total number of requests to the service.

        • RootCauseServiceRequestImpactStatistics — (map)

          The impact statistics of the root cause service. This includes the number of requests to the client service and whether the requests were faults or okay.

          • FaultCount — (Integer)

            The number of requests that have resulted in a fault,

          • OkCount — (Integer)

            The number of successful requests.

          • TotalCount — (Integer)

            The total number of requests to the service.

        • TopAnomalousServices — (Array<map>)

          The service within the insight that is most impacted by the incident.

          • ServiceId — (map)

            • Name — (String)

            • Names — (Array<String>)

            • AccountId — (String)

            • Type — (String)

        • LastUpdateTime — (Date)

          The time, in Unix seconds, that the insight was last updated.

      • NextToken — (String)

        Pagination token.

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.

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.

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.

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.

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 for 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 based on which you want to generate a graph.

    • GroupARN — (String)

      The Amazon Resource Name (ARN) of a group based on which you want to generate a graph.

    • NextToken — (String)

      Pagination token.

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 an 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.

Returns:

  • (AWS.Request)

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

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

Get an aggregation of service statistics defined by a specific time range.

Service Reference:

Examples:

Calling the getTimeSeriesServiceStatistics 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 */
  EntitySelectorExpression: 'STRING_VALUE',
  ForecastStatistics: true || false,
  GroupARN: 'STRING_VALUE',
  GroupName: 'STRING_VALUE',
  NextToken: 'STRING_VALUE',
  Period: 'NUMBER_VALUE'
};
xray.getTimeSeriesServiceStatistics(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 aggregate statistics.

    • EndTime — (Date)

      The end of the time frame for which to aggregate statistics.

    • GroupName — (String)

      The case-sensitive name of the group for which to pull statistics from.

    • GroupARN — (String)

      The Amazon Resource Name (ARN) of the group for which to pull statistics from.

    • EntitySelectorExpression — (String)

      A filter expression defining entities that will be aggregated for statistics. Supports ID, service, and edge functions. If no selector expression is specified, edge statistics are returned.

    • Period — (Integer)

      Aggregation period in seconds.

    • ForecastStatistics — (Boolean)

      The forecasted high and low fault count values. Forecast enabled requests require the EntitySelectorExpression ID be provided.

    • NextToken — (String)

      Pagination token.

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:

      • TimeSeriesServiceStatistics — (Array<map>)

        The collection of statistics.

        • Timestamp — (Date)

          Timestamp of the window for which statistics are aggregated.

        • EdgeSummaryStatistics — (map)

          Response statistics for an 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.

        • ServiceSummaryStatistics — (map)

          Response statistics for a 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.

        • ServiceForecastStatistics — (map)

          The forecasted high and low fault count values.

          • FaultCountHigh — (Integer)

            The upper limit of fault counts for a service.

          • FaultCountLow — (Integer)

            The lower limit of fault counts for a service.

        • ResponseTimeHistogram — (Array<map>)

          The response time histogram for the selected entities.

          • Value — (Float)

            The value of the entry.

          • Count — (Integer)

            The prevalence of the entry.

      • ContainsOldGroupVersions — (Boolean)

        A flag indicating whether or not a group's filter expression has been consistent, or if a returned aggregation might show statistics from an older version of the group's filter expression.

      • NextToken — (String)

        Pagination token.

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.

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 an 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.

Returns:

  • (AWS.Request)

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

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

Retrieves IDs and annotations 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,
  SamplingStrategy: {
    Name: PartialScan | FixedRate,
    Value: 'NUMBER_VALUE'
  },
  TimeRangeType: TraceId | Event
};
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.

    • TimeRangeType — (String)

      A parameter to indicate whether to query trace summaries by TraceId or Event time.

      Possible values include:
      • "TraceId"
      • "Event"
    • Sampling — (Boolean)

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

    • SamplingStrategy — (map)

      A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.

      • Name — (String)

        The name of a sampling rule.

        Possible values include:
        • "PartialScan"
        • "FixedRate"
      • Value — (Float)

        The value of a sampling rule.

    • 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 annotations 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)

          The root segment document has a 500 series error.

        • HasError — (Boolean)

          The root segment document 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 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.

          • ClientImpacting — (Boolean)

            A flag that denotes that the root cause impacts the trace client.

        • 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.

          • ClientImpacting — (Boolean)

            A flag that denotes that the root cause impacts the trace client.

        • 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 type 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.

          • ClientImpacting — (Boolean)

            A flag that denotes that the root cause impacts the trace client.

        • Revision — (Integer)

          The revision number of a trace.

        • MatchedEventTime — (Date)

          The matched time stamp of a defined event.

      • 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 recent results, closest to the end of the time frame.

Returns:

  • (AWS.Request)

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

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

Returns a list of tags that are applied to the specified AWS X-Ray group or sampling rule.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  NextToken: 'STRING_VALUE'
};
xray.listTagsForResource(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: {})
    • ResourceARN — (String)

      The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.

    • NextToken — (String)

      A pagination token. If multiple pages of results are returned, use the NextToken value returned with the current page of results as the value of this parameter to get 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:

      • Tags — (Array<map>)

        A list of tags, as key and value pairs, that is associated with the specified X-Ray group or sampling rule.

        • Keyrequired — (String)

          A tag key, such as Stage or Name. A tag key cannot be empty. The key can be a maximum of 128 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

        • Valuerequired — (String)

          An optional tag value, such as Production or test-only. The value can be a maximum of 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

      • NextToken — (String)

        A pagination token. If multiple pages of results are returned, use the NextToken value returned with the current page of results to get the next page of results.

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. AWS X-Ray does not support asymmetric CMKs.

      • 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 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, for instance, 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.

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

Applies tags to an existing AWS X-Ray group or sampling rule.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
xray.tagResource(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: {})
    • ResourceARN — (String)

      The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.

    • Tags — (Array<map>)

      A map that contains one or more tag keys and tag values to attach to an X-Ray group or sampling rule. For more information about ways to use tags, see Tagging AWS resources in the AWS General Reference.

      The following restrictions apply to tags:

      • Maximum number of user-applied tags per resource: 50

      • Maximum tag key length: 128 Unicode characters

      • Maximum tag value length: 256 Unicode characters

      • Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @

      • Tag keys and values are case sensitive.

      • Don't use aws: as a prefix for keys; it's reserved for AWS use. You cannot edit or delete system tags.

      • Keyrequired — (String)

        A tag key, such as Stage or Name. A tag key cannot be empty. The key can be a maximum of 128 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

      • Valuerequired — (String)

        An optional tag value, such as Production or test-only. The value can be a maximum of 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /

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.

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

Removes tags from an AWS X-Ray group or sampling rule. You cannot edit or delete system tags (those with an aws: prefix).

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
xray.untagResource(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: {})
    • ResourceARN — (String)

      The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.

    • TagKeys — (Array<String>)

      Keys for one or more tags that you want to remove from an X-Ray group or sampling rule.

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.

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',
  InsightsConfiguration: {
    InsightsEnabled: true || false,
    NotificationsEnabled: true || false
  }
};
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.

    • InsightsConfiguration — (map)

      The structure containing configurations related to insights.

      • The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.

      • The NotifcationsEnabled boolean can be set to true to enable insights notifications for the group. Notifications can only be enabled on a group with InsightsEnabled set to true.

      • InsightsEnabled — (Boolean)

        Set the InsightsEnabled value to true to enable insights or false to disable insights.

      • NotificationsEnabled — (Boolean)

        Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.

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, the updated filter expression, and the updated insight configuration assigned to the group.

        • GroupName — (String)

          The unique case-sensitive name of the group.

        • GroupARN — (String)

          The Amazon Resource Name (ARN) of the group generated based on the GroupName.

        • FilterExpression — (String)

          The filter expression defining the parameters to include traces.

        • InsightsConfiguration — (map)

          The structure containing configurations related to insights.

          • The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.

          • The NotifcationsEnabled boolean can be set to true to enable insights notifications through Amazon EventBridge for the group.

          • InsightsEnabled — (Boolean)

            Set the InsightsEnabled value to true to enable insights or false to disable insights.

          • NotificationsEnabled — (Boolean)

            Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.

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.