Compression
Dictionary Encoding
Dictionary encoding means: instead of storing the same string over and over,
store each unique string once in a dictionary and replace every occurrence
with a tiny integer ID. In trace storage, strings like service.name=api-gateway
appear in thousands of spans — without dictionary encoding, each copy wastes memory.
① Raw Span Data
Below are 20 example spans with three string fields each. Notice how many strings repeat.
| # | service.name | http.method | span.name |
|---|
② Encode
Click to replace every string with its dictionary ID. Watch the data shrink.
Dictionary (ID → String)
| ID | String | Bytes |
|---|
Encoded Data
| # | service | method | name |
|---|
③ Compression Stats
④ Add Custom Spans
Add your own spans and see how the dictionary grows — or doesn't — when strings repeat.
Try adding a span with an existing service name — the dictionary won't grow, but a new ID reference will appear.