open-telemetry / open-telemetry/opentelemetry-python-contrib

SDK should automatically truncate large values

Open
#186 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request help wanted
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

There are some cases where instrumentations are individually truncating large byte values such as is used in both the boto and botocore instrumentations.

https://github.com/open-telemetry/opentelemetry-python-contrib/blob/5d4a5b5f92ef3e740ddb6f3855f4dac07a3ec308/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py#L159-L166

We should have a solution for the OTel SDK to automatically truncate span attribute values which are above some maximum length. This maximum length should be configurable.

This way all instrumentations and exporters can get this truncating behavior for free.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked botocore instrumentation in instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/init.py around lines 159-166, then trace how span attributes are handled by the SDK. Done means a configurable maximum length automatically truncates oversized span attribute values so instrumentations and exporters receive the truncated values.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.