Skip to content

feat(logs,metrics,spans): Add settings object spec for envelope item container#16797

Merged
Lms24 merged 5 commits intomasterfrom
lms/feat-develop-container-settings
Apr 9, 2026
Merged

feat(logs,metrics,spans): Add settings object spec for envelope item container#16797
Lms24 merged 5 commits intomasterfrom
lms/feat-develop-container-settings

Conversation

@Lms24
Copy link
Copy Markdown
Member

@Lms24 Lms24 commented Mar 5, 2026

This PR adds a specification for ingestion settings of what data Relay should infer from incoming requests. This object shall be the same across our new telemetry items (logs, metrics and spans (v2)) and it lives on the container object:

{
  "version": 2,
  "items": [...],
  "ingest_settings": {
    "infer_ip:": "auto",
    "infer_useragent:": "auto",
  }
}

This shall serve as a replacement for the settings property on the sdk object on events as defined here.
I went with the same 'auto' and 'never' values but omitted 'legacy' since it doesn't seem like we need it. If reviewers prefer, we can also use a boolean instead, assuming we never need more than two states.

For backwards compatibility, this also introduces a version field which must be set to at least 2 for ingest_settings to take effect.

Prior to this PR, @cleptric @Dav1dde and I discussed this format. Happy to adjust as reviewers see fit!

ref https://linear.app/getsentry/issue/FE-714/how-to-send-sdksettings-infer-ip

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Apr 7, 2026 0:48am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
sentry-docs Ignored Ignored Preview Apr 7, 2026 0:48am

Request Review

@Lms24 Lms24 requested review from Dav1dde and cleptric March 5, 2026 14:30
}
```

<SpecSection id="span-envelope-item-settings" status="proposal" since="0.0.0">
Copy link
Copy Markdown
Member Author

@Lms24 Lms24 Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spans docs are not yet converted to the changelog-based SpecSection format. Hence for now I added the component but set version 0.0.0.

@Lms24 Lms24 marked this pull request as ready for review March 5, 2026 14:34
@Lms24 Lms24 self-assigned this Mar 5, 2026
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Mar 5, 2026

Comment thread develop-docs/sdk/telemetry/logs.mdx Outdated
Comment thread develop-docs/sdk/telemetry/metrics.mdx Outdated
Comment thread develop-docs/sdk/telemetry/spans/span-protocol.mdx Outdated
Copy link
Copy Markdown
Member

@Dav1dde Dav1dde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but maybe we wanna bike-shed some more on the namings.

We also need to figure out how this works for logs and the existing extractions, I want to make sure we don't build more special cases.

It also has potential billing impact for logs, as these are billed by size (before extraction).

Comment on lines +379 to +380
| `infer_ip` | String | **OPTIONAL** | The setting to infer the IP address from the incoming request. One of `auto` or `never` (default). |
| `infer_useragent` | String | **OPTIONAL** | The setting to infer the user agent from the incoming request. One of `auto` or `never` (default). |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @Dav1dde : We should introduce a top level version field in the item JSON that informs relay what to do with logs:

  • version: 1 is the default. For logs, Relay automatically assumes infer_ip: auto (legacy behavior).
  • New SDK versions set version: 2. Relay assumes infer_ip: never as the default.

Without the version field, we'd have to make infer_ip: auto the default, which would force new SDKs to explicitly send infer_ip: never to disable it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjbayer to confirm, you'd envision this?

{
  "version": 2,
  "items": [...],
  "settings": {
    "infer_ip:": "auto",
    "infer_useragent:": "auto",
  }
}

Happy to add it!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please!

@Lms24
Copy link
Copy Markdown
Member Author

Lms24 commented Mar 6, 2026

@Dav1dde

but maybe we wanna bike-shed some more on the namings.

sure, anything that comes to mind? I think ingest_settings was on the table yesterday, which is more explicit and communicates intent more clearly. Happy to change it to that.

Also,

I went with the same 'auto' and 'never' values but omitted 'legacy' since it doesn't seem like we need it. If reviewers prefer, we can also use a boolean instead, assuming we never need more than two states.

we can "do better" with this second attempt, though tbh this is LOGAF-L for me (bundle size differences are negligible).

@cleptric cleptric self-requested a review March 8, 2026 22:49
Copy link
Copy Markdown
Contributor

@coolguyzone coolguyzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for updating

@Lms24 Lms24 force-pushed the lms/feat-develop-container-settings branch from 349b941 to f213925 Compare April 7, 2026 12:30
@Lms24
Copy link
Copy Markdown
Member Author

Lms24 commented Apr 7, 2026

@cleptric @jjbayer apologies for the delay! I made the following changes as discussed:

  • added version property and specified that SDKs must set it to 2 or higher for Relay to apply the settings
  • renamed settings -> ingest_settings to more clearly communicate the intent

Happy to make more adjustments if necessary!

@Lms24 Lms24 merged commit 1a5ea4e into master Apr 9, 2026
18 checks passed
@Lms24 Lms24 deleted the lms/feat-develop-container-settings branch April 9, 2026 13:04
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants