CAMEL-23387: camel-telemetry - Add span decorators for AWS Polly, Rekognition, Textract, Transcribe, Translate, Comprehend and S3 Vectors#23083
Merged
Conversation
…ognition, Textract, Transcribe, Translate, Comprehend and S3 Vectors Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
All tested modules (12 modules)
|
davsclaus
reviewed
May 8, 2026
davsclaus
approved these changes
May 8, 2026
squakez
approved these changes
May 8, 2026
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
davsclaus
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final AWS batch of span decorators for
camel-telemetry. Closes out AWS coverage for CAMEL-23387 by adding decorators for the AI/ML group: text-to-speech (Polly), image AI (Rekognition), OCR (Textract), speech-to-text (Transcribe), translation (Translate), NLP (Comprehend) and vector search (S3 Vectors).After this PR, all 36 AWS components in
components/camel-aws/that have a Camel scheme will have a correspondingSpanDecorator. The only remaining follow-up on CAMEL-23387 is the Google Cloud decorators mentioned in the original ticket, which is in scope for a separate JIRA.Changes
New
SpanDecoratorimplementations underorg.apache.camel.telemetry.decorators:AwsPollySpanDecorator(aws2-polly) — Text-to-speech. Tags:operation,voiceId,outputFormat,engine,languageCode. Lexicon content (PLS XML), the synthesized audio's S3 destination (bucket/key), the SNS topic ARN for notifications, and therequestCharactersresponse counter are not surfaced.AwsRekognitionSpanDecorator(aws2-rekognition) — Image/video AI. Tags:operation,collectionId,jobId,jobName,faceId. Image data (binary), kms key id, large config objects (operations/output/human-loop config) and bulk facial-attribute / feature collections are not surfaced.AwsTextractSpanDecorator(aws2-textract) — Document OCR. Tags:operation,s3Bucket,s3Object,jobId. The S3 object version, pagination tokens and feature-type collection are not surfaced.AwsTranscribeSpanDecorator(aws2-transcribe) — Speech-to-text. Tags:transcriptionJobName,languageCode,mediaFormat,mediaUri. TheTranscribe2Constantsinterface does not define anOPERATIONheader — operations are configured via the URI — so nooperationtag is emitted (the span name from the URI already conveys the action). Vocabulary phrase lists, tag maps and the resource ARN are not surfaced.AwsTranslateSpanDecorator(aws2-translate) — Translation. Tags:operation,sourceLanguage,targetLanguage. Custom-terminology name collections are not surfaced.AwsComprehendSpanDecorator(aws2-comprehend) — NLP. Tags:operation,languageCode. Detection results (detected language, sentiment, scores) live on the OUT message and are not visible inbeforeTracingEvent, so they are not surfaced.AwsS3VectorsSpanDecorator(aws2-s3-vectors) — Vector search. Tags:operation,vectorBucketName,vectorIndexName,vectorId. Vector embedding data and query vectors (floats), metadata maps, similarity thresholds, distance metrics and response payloads (similarity scores, result counts, index status, bucket ARN) are not surfaced.All seven decorators extend
AbstractSpanDecorator(these are producer-only or producer+polling-consumer components without messaging-style ordering semantics) and are registered alphabetically inMETA-INF/services/org.apache.camel.telemetry.SpanDecorator. Unit tests cover header-to-tag extraction for each decorator.Header constants are mirrored from each component's
*Constantsinterface (with a Javadoc reference back to the source), matching the convention used by previous batches andAzureServiceBusSpanDecorator. This avoids creating hard dependencies fromcamel-telemetryto the AWS component modules.Tag selection rationale
Same two rules applied across batches 3 through 6:
voiceId,s3Bucket/s3Object,transcriptionJobName,vectorIndexName,collectionIdetc. Response data (detected sentiment in Comprehend, similarity scores in S3 Vectors, request character counts in Polly) is response-shaped and not visible inbeforeTracingEvent.In addition to the two rules above, this batch follows the IAM-principal-minimization principle established in earlier review fixes (KMS
keyId, CloudTrailusername, IAMuserName, EKSroleArn): nouserIdfrom Rekognition collections, nokmsKeyIdfrom Rekognition, noresourceArnfrom Transcribe.Review-driven adjustments (commit 7e9fdfb)
After review feedback from @davsclaus, one field was dropped from the initial draft:
AwsComprehendSpanDecoratorno longer emitsendpointArn. The Comprehend custom-classifier endpoint ARN embeds the AWS account ID (e.g.arn:aws:comprehend:us-east-1:123456789012:document-classifier-endpoint/MyEndpoint), and surfacing account identifiers to observability backends is the same kind of identity disclosure that drove the IAMuserName, KMSkeyId, CloudTrailusernameand EKSroleArndrops in earlier batches.Test plan
mvn testincomponents/camel-telemetrypasses (133 tests, including 44 AWS decorator tests covering 36 components total — all AWS coverage on CAMEL-23387)mvn -DskipTests install) succeedsCoverage on CAMEL-23387 (AWS — complete after this PR)
Follow-ups still pending
aws-xray: the original "Compute & Tracing" follow-up listed in earlier PRs mentionedcamel-aws-xray, but that module was deprecated and removed in commit ba9f8c5 — it was a tracer integration with its ownSegmentDecoratorsystem, not a producer-style component, and there is nothing to add aSpanDecoratorfor.After this PR merges the AWS portion of CAMEL-23387 is fully complete and the JIRA can be closed pending the Google Cloud follow-up decision.
Claude Code on behalf of Andrea Cosentino