This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/aws-sdk-2.2.md.

AWS SDK

OpenTelemetry Java agent instrumentation

This instrumentation covers the AWS SDK 2.2+ client library, enabling messaging and client spans and metrics for calls to AWS services including DynamoDB, EC2, Kinesis, Lambda, RDS, S3, SNS/SQS and Bedrock.

  • Name: aws-sdk-2.2
  • Scope: io.opentelemetry.aws-sdk-2.2
  • Target versions: software.amazon.awssdk:aws-core:[2.2.0,), software.amazon.awssdk:bedrockruntime:[2.25.63,), software.amazon.awssdk:lambda:[2.17.0,), software.amazon.awssdk:sns:[2.2.0,), software.amazon.awssdk:sqs:[2.2.0,)
  • Library: https://aws.amazon.com/sdk-for-java/

Telemetry

When default

Metrics

MetricInstrumentTypeUnitDescription
gen_ai.client.operation.durationhistogramHISTOGRAMsGenAI operation duration.
gen_ai.client.token.usagehistogramHISTOGRAM{token}Measures number of input and output tokens used.
MetricAttributes
gen_ai.client.operation.durationgen_ai.operation.name (STRING), gen_ai.provider.name (STRING), gen_ai.request.model (STRING)
gen_ai.client.token.usagegen_ai.operation.name (STRING), gen_ai.provider.name (STRING), gen_ai.request.model (STRING), gen_ai.token.type (STRING)

Spans

Span kindAttributes
CLIENTaws.agent (STRING), aws.bedrock.guardrail.id (STRING), aws.dynamodb.consumed_capacity (STRING_ARRAY), aws.dynamodb.count (LONG), aws.dynamodb.global_secondary_indexes (STRING_ARRAY), aws.dynamodb.item_collection_metrics (STRING), aws.dynamodb.limit (LONG), aws.dynamodb.provisioned_read_capacity (DOUBLE), aws.dynamodb.provisioned_write_capacity (DOUBLE), aws.dynamodb.scanned_count (LONG), aws.dynamodb.select (STRING), aws.dynamodb.table_count (LONG), aws.dynamodb.table_names (STRING_ARRAY), aws.kinesis.stream_name (STRING), aws.lambda.function.arn (STRING), aws.lambda.function.name (STRING), aws.lambda.resource_mapping.id (STRING), aws.queue.name (STRING), aws.request_id (STRING), aws.s3.bucket (STRING), aws.secretsmanager.secret.arn (STRING), aws.sns.topic.arn (STRING), aws.sqs.queue.url (STRING), aws.step_functions.activity.arn (STRING), aws.step_functions.state_machine.arn (STRING), db.operation (STRING), db.system (STRING), gen_ai.operation.name (STRING), gen_ai.provider.name (STRING), gen_ai.request.max_tokens (LONG), gen_ai.request.model (STRING), gen_ai.request.stop_sequences (STRING_ARRAY), gen_ai.request.stream (BOOLEAN), gen_ai.request.temperature (DOUBLE), gen_ai.request.top_p (DOUBLE), gen_ai.response.finish_reasons (STRING_ARRAY), gen_ai.usage.input_tokens (LONG), gen_ai.usage.output_tokens (LONG), http.request.method (STRING), http.response.status_code (LONG), messaging.destination.name (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)
CONSUMERaws.agent (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.batch.message_count (LONG), messaging.destination.name (STRING), messaging.message.id (STRING), messaging.operation (STRING), messaging.system (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)
PRODUCERaws.agent (STRING), aws.request_id (STRING), aws.sqs.queue.url (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.destination.name (STRING), messaging.message.id (STRING), messaging.operation (STRING), messaging.system (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)

When otel.semconv-stability.opt-in=database

Metrics

MetricInstrumentTypeUnitDescription
db.client.operation.durationhistogramHISTOGRAMsDuration of database client operations.
MetricAttributes
db.client.operation.durationdb.collection.name (STRING), db.operation.name (STRING), db.system.name (STRING)

Spans

Span kindAttributes
CLIENTaws.agent (STRING), aws.dynamodb.consumed_capacity (STRING_ARRAY), aws.dynamodb.count (LONG), aws.dynamodb.global_secondary_indexes (STRING_ARRAY), aws.dynamodb.item_collection_metrics (STRING), aws.dynamodb.limit (LONG), aws.dynamodb.provisioned_read_capacity (DOUBLE), aws.dynamodb.provisioned_write_capacity (DOUBLE), aws.dynamodb.scanned_count (LONG), aws.dynamodb.select (STRING), aws.dynamodb.table_count (LONG), aws.dynamodb.table_names (STRING_ARRAY), aws.kinesis.stream_name (STRING), aws.lambda.function.arn (STRING), aws.lambda.function.name (STRING), aws.lambda.resource_mapping.id (STRING), aws.queue.name (STRING), aws.request_id (STRING), aws.s3.bucket (STRING), aws.secretsmanager.secret.arn (STRING), aws.sns.topic.arn (STRING), aws.sqs.queue.url (STRING), aws.step_functions.activity.arn (STRING), aws.step_functions.state_machine.arn (STRING), db.collection.name (STRING), db.operation.batch.size (LONG), db.operation.name (STRING), db.system.name (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.destination.name (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)
CONSUMERaws.agent (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.batch.message_count (LONG), messaging.destination.name (STRING), messaging.message.id (STRING), messaging.operation (STRING), messaging.system (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)
PRODUCERaws.agent (STRING), aws.request_id (STRING), aws.sqs.queue.url (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.destination.name (STRING), messaging.message.id (STRING), messaging.operation (STRING), messaging.system (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)

When otel.semconv-stability.preview=messaging

Metrics

MetricInstrumentTypeUnitDescription
messaging.client.consumed.messagescounterLONG_SUM{message}Number of messages that were delivered to the application.
messaging.client.operation.durationhistogramHISTOGRAMsDuration of messaging operation initiated by a producer or consumer client.
messaging.client.sent.messagescounterLONG_SUM{message}Number of messages producer attempted to send to the broker.
messaging.process.durationhistogramHISTOGRAMsDuration of processing operation.
MetricAttributes
messaging.client.consumed.messagesmessaging.destination.name (STRING), messaging.operation.name (STRING), messaging.system (STRING), server.address (STRING), server.port (LONG)
messaging.client.operation.durationmessaging.destination.name (STRING), messaging.operation.name (STRING), messaging.operation.type (STRING), messaging.system (STRING), server.address (STRING), server.port (LONG)
messaging.client.sent.messagesmessaging.destination.name (STRING), messaging.operation.name (STRING), messaging.system (STRING), server.address (STRING), server.port (LONG)
messaging.process.durationmessaging.destination.name (STRING), messaging.operation.name (STRING), messaging.system (STRING), server.address (STRING), server.port (LONG)

Spans

Span kindAttributes
CLIENTaws.agent (STRING), aws.queue.name (STRING), aws.request_id (STRING), aws.sqs.queue.url (STRING), error.type (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.batch.message_count (LONG), messaging.destination.name (STRING), messaging.operation.name (STRING), messaging.operation.type (STRING), messaging.system (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)
CONSUMERaws.agent (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.destination.name (STRING), messaging.message.id (STRING), messaging.operation.name (STRING), messaging.operation.type (STRING), messaging.system (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)
PRODUCERaws.agent (STRING), aws.request_id (STRING), aws.sqs.queue.url (STRING), http.request.method (STRING), http.response.status_code (LONG), messaging.batch.message_count (LONG), messaging.destination.name (STRING), messaging.message.id (STRING), messaging.operation.name (STRING), messaging.operation.type (STRING), messaging.system (STRING), rpc.method (STRING), rpc.service (STRING), rpc.system (STRING), server.address (STRING), server.port (LONG), url.full (STRING)

Configuration

OptionTypeDefaultDescription
otel.instrumentation.common.messaging.message-create-spans.enabledbooleantrueProvides the default for whether to create a producer span for each eligible message in a batch send when stable messaging semantic conventions are enabled. An instrumentation-specific setting takes precedence.
otel.instrumentation.messaging.experimental.capture-headerslistDeprecated: use otel.instrumentation.common.messaging.headers.included instead. Ignored without a warning under v3-preview; may be removed in a later minor release and will be removed no later than 3.0. A comma-separated list of header names to capture as span attributes. It does not support glob patterns: an entry containing * or ? is ignored with a warning, and every other entry is matched as a literal header name.
otel.instrumentation.messaging.experimental.headers.excludedlistDeprecated: use otel.instrumentation.common.messaging.headers.excluded instead. Ignored without a warning under v3-preview; may be removed in a later minor release and will be removed no later than 3.0.
otel.instrumentation.messaging.experimental.headers.includedlistDeprecated: use otel.instrumentation.common.messaging.headers.included instead. Ignored without a warning under v3-preview; may be removed in a later minor release and will be removed no later than 3.0.
otel.instrumentation.messaging.experimental.receive-telemetry.enabledbooleanfalseDeprecated: use otel.instrumentation.common.messaging.experimental.receive-telemetry.enabled instead. It may be removed in the next minor release.
otel.instrumentation.common.messaging.headers.excludedlistA comma-separated list of case-sensitive message header name glob patterns to exclude from span attributes. ? matches one character and * matches zero or more characters. Excluded patterns take precedence over included patterns. An absent or empty selector captures no headers; an exclude-only selector captures every header not excluded, which may expose sensitive information.
otel.instrumentation.common.messaging.headers.includedlistA comma-separated list of case-sensitive message header name glob patterns to capture as span attributes. ? matches one character and * matches zero or more characters. Excluded patterns take precedence over included patterns. An absent or empty selector captures no headers; an exclude-only selector captures every header not excluded.
otel.instrumentation.aws-sdk.experimental-record-individual-http-errorbooleanfalseDetermines whether errors returned by each individual HTTP request should be recorded as events for the SDK span.
otel.instrumentation.aws-sdk.experimental-span-attributesbooleanfalseEnables experimental span attributes aws.agent, aws.lambda.function.arn and aws.lambda.function.name for AWS SDK instrumentation.
otel.instrumentation.aws-sdk.experimental-use-propagator-for-messagingbooleanfalseDetermines whether the configured TextMapPropagator should be used to inject into supported messaging attributes (for SQS).
otel.instrumentation.aws-sdk.message-create-spans.enabledbooleanDetermines whether to create a producer span for each eligible message in an SQS batch send when stable messaging semantic conventions are enabled. Overrides otel.instrumentation.common.messaging.message-create-spans.enabled for this instrumentation; when unset, that setting applies.
otel.instrumentation.common.messaging.experimental.receive-telemetry.enabledbooleanfalseEnables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace.
otel.instrumentation.genai.capture-message-contentbooleanfalseDetermines whether Generative AI events include full content of user and assistant messages. Note that full content can have data privacy and size concerns and care should be taken when enabling this

Data

  • JSON (latest): /data/javaagent/instrumentations/aws-sdk-2.2/latest.json
  • JSON (pinned): /data/javaagent/instrumentations/aws-sdk-2.2/aws-sdk-2.2-7126b0ebe4dc.json
  • Explore: /java-agent/instrumentation/aws-sdk-2.2