Skip to content

XRayClient

Index > XRay > XRayClient

Auto-generated documentation for XRay type annotations stubs module mypy-boto3-xray.

XRayClient

Type annotations and code completion for boto3.client("xray"). boto3 documentation

Usage example
from boto3.session import Session
from mypy_boto3_xray.client import XRayClient

def get_xray_client() -> XRayClient:
    return Session().client("xray")

Exceptions

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("xray").exceptions structure.

Usage example
client = boto3.client("xray")

try:
    do_something(client)
except (
    client.ClientError,
    client.InvalidPolicyRevisionIdException,
    client.InvalidRequestException,
    client.LockoutPreventionException,
    client.MalformedPolicyDocumentException,
    client.PolicyCountLimitExceededException,
    client.PolicySizeLimitExceededException,
    client.ResourceNotFoundException,
    client.RuleLimitExceededException,
    client.ThrottledException,
    client.TooManyTagsException,
) as e:
    print(e)
Type checking example
from mypy_boto3_xray.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods

batch_get_traces

Retrieves a list of traces specified by ID.

Type annotations and code completion for boto3.client("xray").batch_get_traces method. boto3 documentation

Method definition
def batch_get_traces(
    self,
    *,
    TraceIds: Sequence[str],
    NextToken: str = ...,
) -> BatchGetTracesResultTypeDef:  # (1)
    ...
  1. See BatchGetTracesResultTypeDef
Usage example with kwargs
kwargs: BatchGetTracesRequestRequestTypeDef = {  # (1)
    "TraceIds": ...,
}

parent.batch_get_traces(**kwargs)
  1. See BatchGetTracesRequestRequestTypeDef

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("xray").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("xray").close method. boto3 documentation

Method definition
def close(
    self,
) -> None:
    ...

create_group

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

Type annotations and code completion for boto3.client("xray").create_group method. boto3 documentation

Method definition
def create_group(
    self,
    *,
    GroupName: str,
    FilterExpression: str = ...,
    InsightsConfiguration: InsightsConfigurationTypeDef = ...,  # (1)
    Tags: Sequence[TagTypeDef] = ...,  # (2)
) -> CreateGroupResultTypeDef:  # (3)
    ...
  1. See InsightsConfigurationTypeDef
  2. See TagTypeDef
  3. See CreateGroupResultTypeDef
Usage example with kwargs
kwargs: CreateGroupRequestRequestTypeDef = {  # (1)
    "GroupName": ...,
}

parent.create_group(**kwargs)
  1. See CreateGroupRequestRequestTypeDef

create_sampling_rule

Creates a rule to control sampling behavior for instrumented applications.

Type annotations and code completion for boto3.client("xray").create_sampling_rule method. boto3 documentation

Method definition
def create_sampling_rule(
    self,
    *,
    SamplingRule: SamplingRuleTypeDef,  # (1)
    Tags: Sequence[TagTypeDef] = ...,  # (2)
) -> CreateSamplingRuleResultTypeDef:  # (3)
    ...
  1. See SamplingRuleTypeDef
  2. See TagTypeDef
  3. See CreateSamplingRuleResultTypeDef
Usage example with kwargs
kwargs: CreateSamplingRuleRequestRequestTypeDef = {  # (1)
    "SamplingRule": ...,
}

parent.create_sampling_rule(**kwargs)
  1. See CreateSamplingRuleRequestRequestTypeDef

delete_group

Deletes a group resource.

Type annotations and code completion for boto3.client("xray").delete_group method. boto3 documentation

Method definition
def delete_group(
    self,
    *,
    GroupName: str = ...,
    GroupARN: str = ...,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteGroupRequestRequestTypeDef = {  # (1)
    "GroupName": ...,
}

parent.delete_group(**kwargs)
  1. See DeleteGroupRequestRequestTypeDef

delete_resource_policy

Deletes a resource policy from the target Amazon Web Services account.

Type annotations and code completion for boto3.client("xray").delete_resource_policy method. boto3 documentation

Method definition
def delete_resource_policy(
    self,
    *,
    PolicyName: str,
    PolicyRevisionId: str = ...,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteResourcePolicyRequestRequestTypeDef = {  # (1)
    "PolicyName": ...,
}

parent.delete_resource_policy(**kwargs)
  1. See DeleteResourcePolicyRequestRequestTypeDef

delete_sampling_rule

Deletes a sampling rule.

Type annotations and code completion for boto3.client("xray").delete_sampling_rule method. boto3 documentation

Method definition
def delete_sampling_rule(
    self,
    *,
    RuleName: str = ...,
    RuleARN: str = ...,
) -> DeleteSamplingRuleResultTypeDef:  # (1)
    ...
  1. See DeleteSamplingRuleResultTypeDef
Usage example with kwargs
kwargs: DeleteSamplingRuleRequestRequestTypeDef = {  # (1)
    "RuleName": ...,
}

parent.delete_sampling_rule(**kwargs)
  1. See DeleteSamplingRuleRequestRequestTypeDef

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("xray").generate_presigned_url method. boto3 documentation

Method definition
def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_encryption_config

Retrieves the current encryption configuration for X-Ray data.

Type annotations and code completion for boto3.client("xray").get_encryption_config method. boto3 documentation

Method definition
def get_encryption_config(
    self,
) -> GetEncryptionConfigResultTypeDef:  # (1)
    ...
  1. See GetEncryptionConfigResultTypeDef

get_group

Retrieves group resource details.

Type annotations and code completion for boto3.client("xray").get_group method. boto3 documentation

Method definition
def get_group(
    self,
    *,
    GroupName: str = ...,
    GroupARN: str = ...,
) -> GetGroupResultTypeDef:  # (1)
    ...
  1. See GetGroupResultTypeDef
Usage example with kwargs
kwargs: GetGroupRequestRequestTypeDef = {  # (1)
    "GroupName": ...,
}

parent.get_group(**kwargs)
  1. See GetGroupRequestRequestTypeDef

get_groups

Retrieves all active group details.

Type annotations and code completion for boto3.client("xray").get_groups method. boto3 documentation

Method definition
def get_groups(
    self,
    *,
    NextToken: str = ...,
) -> GetGroupsResultTypeDef:  # (1)
    ...
  1. See GetGroupsResultTypeDef
Usage example with kwargs
kwargs: GetGroupsRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.get_groups(**kwargs)
  1. See GetGroupsRequestRequestTypeDef

get_insight

Retrieves the summary information of an insight.

Type annotations and code completion for boto3.client("xray").get_insight method. boto3 documentation

Method definition
def get_insight(
    self,
    *,
    InsightId: str,
) -> GetInsightResultTypeDef:  # (1)
    ...
  1. See GetInsightResultTypeDef
Usage example with kwargs
kwargs: GetInsightRequestRequestTypeDef = {  # (1)
    "InsightId": ...,
}

parent.get_insight(**kwargs)
  1. See GetInsightRequestRequestTypeDef

get_insight_events

X-Ray reevaluates insights periodically until they're resolved, and records each intermediate state as an event.

Type annotations and code completion for boto3.client("xray").get_insight_events method. boto3 documentation

Method definition
def get_insight_events(
    self,
    *,
    InsightId: str,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetInsightEventsResultTypeDef:  # (1)
    ...
  1. See GetInsightEventsResultTypeDef
Usage example with kwargs
kwargs: GetInsightEventsRequestRequestTypeDef = {  # (1)
    "InsightId": ...,
}

parent.get_insight_events(**kwargs)
  1. See GetInsightEventsRequestRequestTypeDef

get_insight_impact_graph

Retrieves a service graph structure filtered by the specified insight.

Type annotations and code completion for boto3.client("xray").get_insight_impact_graph method. boto3 documentation

Method definition
def get_insight_impact_graph(
    self,
    *,
    InsightId: str,
    StartTime: Union[datetime, str],
    EndTime: Union[datetime, str],
    NextToken: str = ...,
) -> GetInsightImpactGraphResultTypeDef:  # (1)
    ...
  1. See GetInsightImpactGraphResultTypeDef
Usage example with kwargs
kwargs: GetInsightImpactGraphRequestRequestTypeDef = {  # (1)
    "InsightId": ...,
    "StartTime": ...,
    "EndTime": ...,
}

parent.get_insight_impact_graph(**kwargs)
  1. See GetInsightImpactGraphRequestRequestTypeDef

get_insight_summaries

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

Type annotations and code completion for boto3.client("xray").get_insight_summaries method. boto3 documentation

Method definition
def get_insight_summaries(
    self,
    *,
    StartTime: Union[datetime, str],
    EndTime: Union[datetime, str],
    States: Sequence[InsightStateType] = ...,  # (1)
    GroupARN: str = ...,
    GroupName: str = ...,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetInsightSummariesResultTypeDef:  # (2)
    ...
  1. See InsightStateType
  2. See GetInsightSummariesResultTypeDef
Usage example with kwargs
kwargs: GetInsightSummariesRequestRequestTypeDef = {  # (1)
    "StartTime": ...,
    "EndTime": ...,
}

parent.get_insight_summaries(**kwargs)
  1. See GetInsightSummariesRequestRequestTypeDef

get_sampling_rules

Retrieves all sampling rules.

Type annotations and code completion for boto3.client("xray").get_sampling_rules method. boto3 documentation

Method definition
def get_sampling_rules(
    self,
    *,
    NextToken: str = ...,
) -> GetSamplingRulesResultTypeDef:  # (1)
    ...
  1. See GetSamplingRulesResultTypeDef
Usage example with kwargs
kwargs: GetSamplingRulesRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.get_sampling_rules(**kwargs)
  1. See GetSamplingRulesRequestRequestTypeDef

get_sampling_statistic_summaries

Retrieves information about recent sampling results for all sampling rules.

Type annotations and code completion for boto3.client("xray").get_sampling_statistic_summaries method. boto3 documentation

Method definition
def get_sampling_statistic_summaries(
    self,
    *,
    NextToken: str = ...,
) -> GetSamplingStatisticSummariesResultTypeDef:  # (1)
    ...
  1. See GetSamplingStatisticSummariesResultTypeDef
Usage example with kwargs
kwargs: GetSamplingStatisticSummariesRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.get_sampling_statistic_summaries(**kwargs)
  1. See GetSamplingStatisticSummariesRequestRequestTypeDef

get_sampling_targets

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

Type annotations and code completion for boto3.client("xray").get_sampling_targets method. boto3 documentation

Method definition
def get_sampling_targets(
    self,
    *,
    SamplingStatisticsDocuments: Sequence[SamplingStatisticsDocumentTypeDef],  # (1)
) -> GetSamplingTargetsResultTypeDef:  # (2)
    ...
  1. See SamplingStatisticsDocumentTypeDef
  2. See GetSamplingTargetsResultTypeDef
Usage example with kwargs
kwargs: GetSamplingTargetsRequestRequestTypeDef = {  # (1)
    "SamplingStatisticsDocuments": ...,
}

parent.get_sampling_targets(**kwargs)
  1. See GetSamplingTargetsRequestRequestTypeDef

get_service_graph

Retrieves a document that describes services that process incoming requests, and downstream services that they call as a result.

Type annotations and code completion for boto3.client("xray").get_service_graph method. boto3 documentation

Method definition
def get_service_graph(
    self,
    *,
    StartTime: Union[datetime, str],
    EndTime: Union[datetime, str],
    GroupName: str = ...,
    GroupARN: str = ...,
    NextToken: str = ...,
) -> GetServiceGraphResultTypeDef:  # (1)
    ...
  1. See GetServiceGraphResultTypeDef
Usage example with kwargs
kwargs: GetServiceGraphRequestRequestTypeDef = {  # (1)
    "StartTime": ...,
    "EndTime": ...,
}

parent.get_service_graph(**kwargs)
  1. See GetServiceGraphRequestRequestTypeDef

get_time_series_service_statistics

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

Type annotations and code completion for boto3.client("xray").get_time_series_service_statistics method. boto3 documentation

Method definition
def get_time_series_service_statistics(
    self,
    *,
    StartTime: Union[datetime, str],
    EndTime: Union[datetime, str],
    GroupName: str = ...,
    GroupARN: str = ...,
    EntitySelectorExpression: str = ...,
    Period: int = ...,
    ForecastStatistics: bool = ...,
    NextToken: str = ...,
) -> GetTimeSeriesServiceStatisticsResultTypeDef:  # (1)
    ...
  1. See GetTimeSeriesServiceStatisticsResultTypeDef
Usage example with kwargs
kwargs: GetTimeSeriesServiceStatisticsRequestRequestTypeDef = {  # (1)
    "StartTime": ...,
    "EndTime": ...,
}

parent.get_time_series_service_statistics(**kwargs)
  1. See GetTimeSeriesServiceStatisticsRequestRequestTypeDef

get_trace_graph

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

Type annotations and code completion for boto3.client("xray").get_trace_graph method. boto3 documentation

Method definition
def get_trace_graph(
    self,
    *,
    TraceIds: Sequence[str],
    NextToken: str = ...,
) -> GetTraceGraphResultTypeDef:  # (1)
    ...
  1. See GetTraceGraphResultTypeDef
Usage example with kwargs
kwargs: GetTraceGraphRequestRequestTypeDef = {  # (1)
    "TraceIds": ...,
}

parent.get_trace_graph(**kwargs)
  1. See GetTraceGraphRequestRequestTypeDef

get_trace_summaries

Retrieves IDs and annotations for traces available for a specified time frame using an optional filter.

Type annotations and code completion for boto3.client("xray").get_trace_summaries method. boto3 documentation

Method definition
def get_trace_summaries(
    self,
    *,
    StartTime: Union[datetime, str],
    EndTime: Union[datetime, str],
    TimeRangeType: TimeRangeTypeType = ...,  # (1)
    Sampling: bool = ...,
    SamplingStrategy: SamplingStrategyTypeDef = ...,  # (2)
    FilterExpression: str = ...,
    NextToken: str = ...,
) -> GetTraceSummariesResultTypeDef:  # (3)
    ...
  1. See TimeRangeTypeType
  2. See SamplingStrategyTypeDef
  3. See GetTraceSummariesResultTypeDef
Usage example with kwargs
kwargs: GetTraceSummariesRequestRequestTypeDef = {  # (1)
    "StartTime": ...,
    "EndTime": ...,
}

parent.get_trace_summaries(**kwargs)
  1. See GetTraceSummariesRequestRequestTypeDef

list_resource_policies

Returns the list of resource policies in the target Amazon Web Services account.

Type annotations and code completion for boto3.client("xray").list_resource_policies method. boto3 documentation

Method definition
def list_resource_policies(
    self,
    *,
    NextToken: str = ...,
) -> ListResourcePoliciesResultTypeDef:  # (1)
    ...
  1. See ListResourcePoliciesResultTypeDef
Usage example with kwargs
kwargs: ListResourcePoliciesRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_resource_policies(**kwargs)
  1. See ListResourcePoliciesRequestRequestTypeDef

list_tags_for_resource

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

Type annotations and code completion for boto3.client("xray").list_tags_for_resource method. boto3 documentation

Method definition
def list_tags_for_resource(
    self,
    *,
    ResourceARN: str,
    NextToken: str = ...,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
Usage example with kwargs
kwargs: ListTagsForResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestRequestTypeDef

put_encryption_config

Updates the encryption configuration for X-Ray data.

Type annotations and code completion for boto3.client("xray").put_encryption_config method. boto3 documentation

Method definition
def put_encryption_config(
    self,
    *,
    Type: EncryptionTypeType,  # (1)
    KeyId: str = ...,
) -> PutEncryptionConfigResultTypeDef:  # (2)
    ...
  1. See EncryptionTypeType
  2. See PutEncryptionConfigResultTypeDef
Usage example with kwargs
kwargs: PutEncryptionConfigRequestRequestTypeDef = {  # (1)
    "Type": ...,
}

parent.put_encryption_config(**kwargs)
  1. See PutEncryptionConfigRequestRequestTypeDef

put_resource_policy

Sets the resource policy to grant one or more Amazon Web Services services and accounts permissions to access X-Ray.

Type annotations and code completion for boto3.client("xray").put_resource_policy method. boto3 documentation

Method definition
def put_resource_policy(
    self,
    *,
    PolicyName: str,
    PolicyDocument: str,
    PolicyRevisionId: str = ...,
    BypassPolicyLockoutCheck: bool = ...,
) -> PutResourcePolicyResultTypeDef:  # (1)
    ...
  1. See PutResourcePolicyResultTypeDef
Usage example with kwargs
kwargs: PutResourcePolicyRequestRequestTypeDef = {  # (1)
    "PolicyName": ...,
    "PolicyDocument": ...,
}

parent.put_resource_policy(**kwargs)
  1. See PutResourcePolicyRequestRequestTypeDef

put_telemetry_records

Used by the Amazon Web Services X-Ray daemon to upload telemetry.

Type annotations and code completion for boto3.client("xray").put_telemetry_records method. boto3 documentation

Method definition
def put_telemetry_records(
    self,
    *,
    TelemetryRecords: Sequence[TelemetryRecordTypeDef],  # (1)
    EC2InstanceId: str = ...,
    Hostname: str = ...,
    ResourceARN: str = ...,
) -> Dict[str, Any]:
    ...
  1. See TelemetryRecordTypeDef
Usage example with kwargs
kwargs: PutTelemetryRecordsRequestRequestTypeDef = {  # (1)
    "TelemetryRecords": ...,
}

parent.put_telemetry_records(**kwargs)
  1. See PutTelemetryRecordsRequestRequestTypeDef

put_trace_segments

Uploads segment documents to Amazon Web Services X-Ray.

Type annotations and code completion for boto3.client("xray").put_trace_segments method. boto3 documentation

Method definition
def put_trace_segments(
    self,
    *,
    TraceSegmentDocuments: Sequence[str],
) -> PutTraceSegmentsResultTypeDef:  # (1)
    ...
  1. See PutTraceSegmentsResultTypeDef
Usage example with kwargs
kwargs: PutTraceSegmentsRequestRequestTypeDef = {  # (1)
    "TraceSegmentDocuments": ...,
}

parent.put_trace_segments(**kwargs)
  1. See PutTraceSegmentsRequestRequestTypeDef

tag_resource

Applies tags to an existing Amazon Web Services X-Ray group or sampling rule.

Type annotations and code completion for boto3.client("xray").tag_resource method. boto3 documentation

Method definition
def tag_resource(
    self,
    *,
    ResourceARN: str,
    Tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TagTypeDef
Usage example with kwargs
kwargs: TagResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
    "Tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestRequestTypeDef

untag_resource

Removes tags from an Amazon Web Services X-Ray group or sampling rule.

Type annotations and code completion for boto3.client("xray").untag_resource method. boto3 documentation

Method definition
def untag_resource(
    self,
    *,
    ResourceARN: str,
    TagKeys: Sequence[str],
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: UntagResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
    "TagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestRequestTypeDef

update_group

Updates a group resource.

Type annotations and code completion for boto3.client("xray").update_group method. boto3 documentation

Method definition
def update_group(
    self,
    *,
    GroupName: str = ...,
    GroupARN: str = ...,
    FilterExpression: str = ...,
    InsightsConfiguration: InsightsConfigurationTypeDef = ...,  # (1)
) -> UpdateGroupResultTypeDef:  # (2)
    ...
  1. See InsightsConfigurationTypeDef
  2. See UpdateGroupResultTypeDef
Usage example with kwargs
kwargs: UpdateGroupRequestRequestTypeDef = {  # (1)
    "GroupName": ...,
}

parent.update_group(**kwargs)
  1. See UpdateGroupRequestRequestTypeDef

update_sampling_rule

Modifies a sampling rule's configuration.

Type annotations and code completion for boto3.client("xray").update_sampling_rule method. boto3 documentation

Method definition
def update_sampling_rule(
    self,
    *,
    SamplingRuleUpdate: SamplingRuleUpdateTypeDef,  # (1)
) -> UpdateSamplingRuleResultTypeDef:  # (2)
    ...
  1. See SamplingRuleUpdateTypeDef
  2. See UpdateSamplingRuleResultTypeDef
Usage example with kwargs
kwargs: UpdateSamplingRuleRequestRequestTypeDef = {  # (1)
    "SamplingRuleUpdate": ...,
}

parent.update_sampling_rule(**kwargs)
  1. See UpdateSamplingRuleRequestRequestTypeDef

get_paginator

Type annotations and code completion for boto3.client("xray").get_paginator method with overloads.