Skip to content

Stop Slack payloads from spreading into span attributes - #597

Merged
marcdel merged 2 commits into
mainfrom
trim-slack-span-attributes
Nov 20, 2026
Merged

marcdel merged 2 commits into
mainfrom
trim-slack-span-attributes

Conversation

@marcdel

@marcdel marcdel commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Before: Slack API responses, interaction payloads and request params went onto spans as whole maps. o11y flattens maps into one attribute per key, so each new response shape, Slack action or param name added columns to the pears Honeycomb dataset. The Slack handle form params are keyed by pear name, so they also created per-pear keys like the ones #563 removed. The dataset is at its 10,000-column limit.

After: these spans carry a fixed set of scalar fields, so Slack traffic stops adding columns.

  • response.*: ok, error, channel_id, ts
  • payload.*: type, callback_id, user_id, team_id, action_ids (comma-joined)
  • param_keys: the sorted param names as one string, for the error paths in the Slack controllers
  • param_count on slack.save_slack_names; the pear-keyed params no longer goes on that span or on slack_live.save_slack_handles

How: new helpers in Pears.O11y build a small map of known fields and set it with a prefix. Pears.Slack, Pears.SlackClient and the two Slack controllers call them in place of set_attribute(:response | :payload | :params, map). The send_message spans no longer include :result. New tests in test/pears/o11y_test.exs check the exact attribute keys. I could not run the suite locally, so CI is the first run.

This stops new columns only. The existing stale columns still count toward the limit until they are deleted (for example with Honeycomb's column cleanup script in last_written_before mode).


Generated by Claude Code

o11y flattens maps into one attribute per key. Slack API responses,
interaction payloads and request params were set whole, so every new
response shape, action or param name became new columns in the pears
Honeycomb dataset, which sits at its 10,000-column limit. The Slack
handle form params are keyed by pear name, so they also leaked per-pear
keys like the ones removed in #563.

- Add Pears.O11y helpers that record a fixed set of scalar fields:
  set_slack_response (ok, error, channel_id, ts), set_slack_interaction
  (type, callback_id, user_id, team_id, action_ids) and set_param_keys
  (sorted param names as one string)
- Use them in Pears.Slack, Pears.SlackClient and the Slack controllers
- Drop :params from the save_slack_names / save_slack_handles span
  includes and :result from the send_message includes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcdel
marcdel marked this pull request as ready for review November 20, 2026 19:20
@marcdel
marcdel merged commit 9dabb74 into main Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants