ShowMerit

Presigned S3 URLs in Splunk APM: What OpenTelemetry Python 0.66b3 Redacts

On EKS, a zero-code Flask service under gunicorn on OpenTelemetry Python 0.66b3 sent REDACTED for X-Amz-Signature, X-Amz-Credential and X-Amz-Security-Token in all four URL attributes of every download that reached S3; 0.66b2 sent all three in clear in url.full.

Abhimanyu BajajPublished 3 Dec 20266 min readTested in eu-central-1Lab codeLab evidence

Run this yourself

On your AWS account

The full lab with your own AWS account and Splunk token. Follow the steps in this article, then run its clean up step so nothing keeps running.

git clone https://github.com/Abhimanyu9988/showmerit.git
cd showmerit/labs/presigned-s3-urls-in-splunk-apm-what-opentelemetry-python-0

OpenTelemetry Python contrib 0.66b3 keeps the secret parts of an S3 presigned URL out of the URL attributes Splunk APM stores. I ran the same downloads through a zero-code Flask service on 0.66b2 and on 0.66b3 and read every trace back from Splunk APM: on 0.66b3, X-Amz-Signature, X-Amz-Credential and X-Amz-Security-Token read REDACTED in all four URL attributes of every download that reached S3, while the bucket, object key, X-Amz-Date and X-Amz-Expires stayed readable.

TL;DR

What Splunk APM stores on 0.66b2: the signature in url.full and url.query

The lab runs on EKS 1.34 with the Splunk OTel Collector chart 0.163.1. One Flask 3.1.3 service runs under gunicorn 23.0.0, started by opentelemetry-instrument with the instrumentations opentelemetry-bootstrap lists for it. boto3 1.44.17 signs an S3 GET, and a download proxy fetches it with requests 2.34.2, so each download is one trace: the gunicorn server span and the requests client span under it. OTEL_SEMCONV_STABILITY_OPT_IN=http/dup writes both the old names (http.url, http.target) and the stable ones (url.full, url.query).

No real secret was used: boto3 signed with a placeholder key pair and a made-up session token, so S3 answered 403 every time. The evidence masks the key ID as <access-key>.

The first 0.66b2 run, read from Splunk APM by trace ID:

b2-1 in Splunk APM: 5 of 5 download traces, 2.0 spans each; client spans 5, server spans 5; url.full shows signature 5, credential 5, token 5; a value in http.url 5, url.query 5, http.target 5; spans with a value anywhere 10
  url.full    = https://showmerit-presign-lab-receipts.s3.eu-central-1.amazonaws.com/receipts/101.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<access-key>%2F20261202%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20261202T133828Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEXAMPLELABTOKEN&X-Amz-Signature=83c0250bb4fcc66431f79df6f527ed49ce730df86cd8bfb0fb8ff5858dd9
  url.query   = X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<access-key>%2F20261202%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20261202T133828Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEXAMPLELABTOKEN&X-Amz-Signature=83c0250bb4fcc66431f79df6f527ed49ce730df86cd8bfb0fb8ff5858dd9e4e0

The lab's printout cuts the url.full line at 420 characters. The second 0.66b2 run gave the same counts.

Splunk APM span properties for the requests client span on 0.66b2: http.url holds X-Amz-Credential, X-Amz-Security-Token and X-Amz-Signature in clear, otel.scope.version 0.66b2. The key ID is AWS's documented example key and the token is made up.

What 0.66b3 changes: REDACTED on both spans

The only change was the virtualenv: the 26 packages that differ between the two are all OpenTelemetry (0.66b2 and 1.45.2 against 0.66b3 and 1.45.3). Each run started a fresh pod.

b3-1 in Splunk APM: 5 of 5 download traces, 2.0 spans each; client spans 5, server spans 5; url.full shows signature 0, credential 0, token 0; a value in http.url 0, url.query 0, http.target 0; spans with a value anywhere 0
  url.full    = https://showmerit-presign-lab-receipts.s3.eu-central-1.amazonaws.com/receipts/302.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=REDACTED&X-Amz-Date=20261202T134233Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Security-Token=REDACTED&X-Amz-Signature=REDACTED
  url.query   = X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=REDACTED&X-Amz-Date=20261202T134233Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Security-Token=REDACTED&X-Amz-Signature=REDACTED

Splunk APM span properties for the same client span on 0.66b3: http.url reads REDACTED for X-Amz-Credential, X-Amz-Security-Token and X-Amz-Signature, while the bucket, object key, X-Amz-Date and X-Amz-Expires stay readable; otel.scope.version 0.66b3

"Spans with a value anywhere" is a scan of every string Splunk returned for each span: tags, events, logs and status. It read 0 in both 0.66b3 runs, and both 0.66b2 runs read 10. In every 0.66b3 run, all 5 client spans kept the bucket host, object key, date and expiry in url.full, and all 5 server spans kept the object key in url.path and http.target and the date and expiry in url.query.

Why, per the release notes: opentelemetry-util-http 0.66b3 adds the three X-Amz-* names to the parameters it redacts from url.full and http.url (PR 5280), and the WSGI instrumentation now redacts http.target and url.query (PR 4944). PR 4944 explains that under gunicorn, which sets RAW_URI, the old redaction branch never ran; that cause is the PR's, not my test.

Upgrade: pin the OpenTelemetry packages to 1.45.3 and 0.66b3

The lines from the lab's 0.66b3 list that matter here (the full list keeps every instrumentation on 0.66b3):

opentelemetry-api==1.45.3
opentelemetry-sdk==1.45.3
opentelemetry-exporter-otlp-proto-http==1.45.3
opentelemetry-distro==0.66b3
opentelemetry-util-http==0.66b3
opentelemetry-instrumentation-wsgi==0.66b3
opentelemetry-instrumentation-requests==0.66b3

Then check pip in the running container. The lab printed this for each 0.66b3 pod:

b3-1 packages: opentelemetry-instrumentation-flask==0.66b3 opentelemetry-instrumentation-requests==0.66b3 opentelemetry-instrumentation-wsgi==0.66b3 opentelemetry-sdk==1.45.3 opentelemetry-util-http==0.66b3

Two things to plan for after the upgrade

Stored spans keep what they were sent with: read again after the 0.66b3 runs, each 0.66b2 run still had 10 spans with a value.

A request that fails to connect is the other case. Each run also made one download to an endpoint that refuses the connection, so requests raised an error. The whole-span scan of that trace, first run of each version:

b2-1 failed download: trace in Splunk 1, spans with a value anywhere 2, in GET /download-down/<path:key>: tags.http.target; GET /download-down/<path:key>: tags.url.query; GET: logs.0.fields.exception.message; GET: logs.0.fields.exception.stacktrace; GET: tags.exception.message; GET: tags.exception.stacktrace; GET: tags.http.url; GET: tags.otel.status_description; GET: tags.url.full
b3-1 failed download: trace in Splunk 1, spans with a value anywhere 1, in GET: logs.0.fields.exception.message; GET: logs.0.fields.exception.stacktrace; GET: tags.exception.message; GET: tags.exception.stacktrace; GET: tags.otel.status_description

The second runs, b2-2 and b3-2, listed the same fields. Where a signed value sat:

Span: field 0.66b2 0.66b3
server: http.target, url.query yes no
client: url.full, http.url yes no
client: exception.message, exception.stacktrace yes yes
client: otel.status_description yes yes

I didn't test a way to mask these fields. What you can do today is check: read a failed request's trace by ID from Splunk APM's trace API (/v2/apm/trace/{id}; the lab's splunk.sh reads its latest segment and each other segment), and look in exception.message, exception.stacktrace and otel.status_description for X-Amz-Signature=, X-Amz-Credential= or X-Amz-Security-Token= followed by anything other than REDACTED.

Try it yourself

git clone https://github.com/Abhimanyu9988/showmerit.git
cd showmerit/labs/presigned-s3-urls-in-splunk-apm-what-opentelemetry-python-0
export SPLUNK_REALM=us1 SPLUNK_ACCESS_TOKEN=... SPLUNK_API_TOKEN=...
export LAB_NAME=presign-lab AWS_REGION=eu-central-1
./check.sh       # free first: the same app and downloads in Docker
terraform init && terraform apply
./reproduce.sh   # 0.66b2: two runs, read back from Splunk APM
./fix.sh         # 0.66b3: two runs, then the 0.66b2 traces again
./cleanup.sh && terraform destroy

The raw output of my run is in the lab's evidence folder.

What I didn't test

Every file in this lab

Everything above runs from these files. Open any of them to copy it, or clone the repo as shown:

Sources

Disclosure: I work at Splunk, part of Cisco. This is my personal blog; the post isn't sponsored or reviewed by my employer.


I reproduced this in a disposable AWS lab. The lab code and raw output are in the repo. Drafted with AI assistance and reviewed by me.

Read next

OpenTelemetry code owner for two Collector components. Writes hands-on AWS container guides, each tested in a lab. See the proof