Class PutTraceRequest
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<PutTraceRequest.Builder,PutTraceRequest>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal AccessControlConfigThe principals who can see the insights that AWS Context generates from the traces.The ARNs of the agent contexts that the traces are about: 1–10agent-context/ARNs that name at most 5 distinct agent contexts, in this Region and partition, all in your account.static PutTraceRequest.Builderbuilder()final StringMakes the call idempotent.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final TraceFormatformat()The format of the documents intraceDocuments.final StringThe format of the documents intraceDocuments.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) Used to retrieve the value of a field from any class that extendsSdkRequest.final booleanFor responses, this returns true if the service returned a value for the AgentContextArns property.final inthashCode()final booleanFor responses, this returns true if the service returned a value for the TraceDocuments property.final booleanFor responses, this returns true if the service returned a value for the TraceMetadata property.static Class<? extends PutTraceRequest.Builder> final StringThe agent session this trace belongs to and the grouping key: multiple PutTrace calls with the samesessionIdare one session.Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.The raw trace documents, in the trace schema thatformatselects.Client-supplied key-value pairs, stored with the traces as-is.Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfigurationMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
sessionId
The agent session this trace belongs to and the grouping key: multiple PutTrace calls with the same
sessionIdare one session. Optional. If you omit it, the service generates one and returns it in the response. It is not thetraceId: an OTLP batch carries many trace_ids under one session.- Returns:
- The agent session this trace belongs to and the grouping key: multiple PutTrace calls with the same
sessionIdare one session. Optional. If you omit it, the service generates one and returns it in the response. It is not thetraceId: an OTLP batch carries many trace_ids under one session.
-
clientToken
Makes the call idempotent. A retry with the same token and the same request returns the same
sessionIdand does not write the traces again. Reusing the token fails withValidationExceptionif the request is different, or if another caller reuses it whenaccessControlConfignames no entries. A token is honored for 8 hours after its first use. WhenaccessControlConfignames no entries and the caller's end user cannot be resolved at the time of the retry, the retry fails withValidationExceptioneven if the first attempt stored traces. To complete them, resend with explicit entries under a new token.- Returns:
- Makes the call idempotent. A retry with the same token and the same request returns the same
sessionIdand does not write the traces again. Reusing the token fails withValidationExceptionif the request is different, or if another caller reuses it whenaccessControlConfignames no entries. A token is honored for 8 hours after its first use. WhenaccessControlConfignames no entries and the caller's end user cannot be resolved at the time of the retry, the retry fails withValidationExceptioneven if the first attempt stored traces. To complete them, resend with explicit entries under a new token.
-
format
The format of the documents in
traceDocuments. Valid values:-
OTEL- OpenTelemetry traces in OTLP/JSON. -
ANTHROPIC- Claude Code session logs, one log line per document. -
BEDROCK_CONVERSE- Amazon Bedrock Converse messages, one message (roleandcontent) per document, in conversation order. -
KIRO- Kiro IDE or Kiro CLI session logs.
If the service returns an enum value that is not available in the current SDK version,
formatwill returnTraceFormat.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromformatAsString().- Returns:
- The format of the documents in
traceDocuments. Valid values:-
OTEL- OpenTelemetry traces in OTLP/JSON. -
ANTHROPIC- Claude Code session logs, one log line per document. -
BEDROCK_CONVERSE- Amazon Bedrock Converse messages, one message (roleandcontent) per document, in conversation order. -
KIRO- Kiro IDE or Kiro CLI session logs.
-
- See Also:
-
-
formatAsString
The format of the documents in
traceDocuments. Valid values:-
OTEL- OpenTelemetry traces in OTLP/JSON. -
ANTHROPIC- Claude Code session logs, one log line per document. -
BEDROCK_CONVERSE- Amazon Bedrock Converse messages, one message (roleandcontent) per document, in conversation order. -
KIRO- Kiro IDE or Kiro CLI session logs.
If the service returns an enum value that is not available in the current SDK version,
formatwill returnTraceFormat.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromformatAsString().- Returns:
- The format of the documents in
traceDocuments. Valid values:-
OTEL- OpenTelemetry traces in OTLP/JSON. -
ANTHROPIC- Claude Code session logs, one log line per document. -
BEDROCK_CONVERSE- Amazon Bedrock Converse messages, one message (roleandcontent) per document, in conversation order. -
KIRO- Kiro IDE or Kiro CLI session logs.
-
- See Also:
-
-
hasTraceDocuments
public final boolean hasTraceDocuments()For responses, this returns true if the service returned a value for the TraceDocuments property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
traceDocuments
The raw trace documents, in the trace schema that
formatselects. You can send 1–100 documents per call, and each document can be up to 5 MiB (5,242,880 bytes) before encoding. If you use an AWS SDK, pass each document's raw bytes. If you call PutTrace through the agent context's MCP server or another JSON client, send each document as a base64-encoded string.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTraceDocuments()method.- Returns:
- The raw trace documents, in the trace schema that
formatselects. You can send 1–100 documents per call, and each document can be up to 5 MiB (5,242,880 bytes) before encoding. If you use an AWS SDK, pass each document's raw bytes. If you call PutTrace through the agent context's MCP server or another JSON client, send each document as a base64-encoded string.
-
hasAgentContextArns
public final boolean hasAgentContextArns()For responses, this returns true if the service returned a value for the AgentContextArns property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
agentContextArns
The ARNs of the agent contexts that the traces are about: 1–10
agent-context/ARNs that name at most 5 distinct agent contexts, in this Region and partition, all in your account. If you name more, the request fails withValidationException. AWS Context authorizescontext:PutTraceonce for each agent context. If any authorization is denied, the whole call fails withAccessDeniedException, and nothing is stored. After authorization, if trace analysis is disabled for an agent context, the call fails withValidationException, and nothing is stored.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasAgentContextArns()method.- Returns:
- The ARNs of the agent contexts that the traces are about: 1–10
agent-context/ARNs that name at most 5 distinct agent contexts, in this Region and partition, all in your account. If you name more, the request fails withValidationException. AWS Context authorizescontext:PutTraceonce for each agent context. If any authorization is denied, the whole call fails withAccessDeniedException, and nothing is stored. After authorization, if trace analysis is disabled for an agent context, the call fails withValidationException, and nothing is stored.
-
hasTraceMetadata
public final boolean hasTraceMetadata()For responses, this returns true if the service returned a value for the TraceMetadata property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
traceMetadata
Client-supplied key-value pairs, stored with the traces as-is. The key
analysisModeis reserved. A request that sets it fails withAccessDeniedException.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTraceMetadata()method.- Returns:
- Client-supplied key-value pairs, stored with the traces as-is. The key
analysisModeis reserved. A request that sets it fails withAccessDeniedException.
-
accessControlConfig
The principals who can see the insights that AWS Context generates from the traces. If you provide entries, the caller is not included unless an entry names it.
If you provide no entries (
accessControlConfigabsent, oraccessControlListabsent or empty), only the end user that the caller's trusted identity propagation session names can see the insights. If the session names no end user, or there is no session, the call fails withValidationExceptionand stores nothing. In that case, name the principals, or sendALLOWfor*so that every reader of the agent contexts can see the insights.An entry other than
*withoutprincipalType, aprincipalIdthat is not valid Unicode, or entries that total more than 65,536 bytes of UTF-8 are rejected withValidationException. AWS Context stores principal IDs as given and does not verify them against a directory. A session's access control is the union of its traces' entries. A call that would take that union over 100 entries, or over 65,536 bytes of UTF-8, fails withValidationExceptionand stores nothing.- Returns:
- The principals who can see the insights that AWS Context generates from the traces. If you provide
entries, the caller is not included unless an entry names it.
If you provide no entries (
accessControlConfigabsent, oraccessControlListabsent or empty), only the end user that the caller's trusted identity propagation session names can see the insights. If the session names no end user, or there is no session, the call fails withValidationExceptionand stores nothing. In that case, name the principals, or sendALLOWfor*so that every reader of the agent contexts can see the insights.An entry other than
*withoutprincipalType, aprincipalIdthat is not valid Unicode, or entries that total more than 65,536 bytes of UTF-8 are rejected withValidationException. AWS Context stores principal IDs as given and does not verify them against a directory. A session's access control is the union of its traces' entries. A call that would take that union over 100 entries, or over 65,536 bytes of UTF-8, fails withValidationExceptionand stores nothing.
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<PutTraceRequest.Builder,PutTraceRequest> - Specified by:
toBuilderin classContextRequest- Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode()- Overrides:
hashCodein classAwsRequest
-
equals
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
Description copied from class:SdkRequestUsed to retrieve the value of a field from any class that extendsSdkRequest. The field name specified should match the member name from the corresponding service-2.json model specified in the codegen-resources folder for a given service. The class specifies what class to cast the returned value to. If the returned value is also a modeled class, theSdkRequest.getValueForField(String, Class)method will again be available.- Overrides:
getValueForFieldin classSdkRequest- Parameters:
fieldName- The name of the member to be retrieved.clazz- The class to cast the returned object to.- Returns:
- Optional containing the casted return value
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-