Skip to content

add http.{request,response}.body.content#3521

Open
SylvainJuge wants to merge 26 commits into
open-telemetry:mainfrom
SylvainJuge:http-request-response-body
Open

add http.{request,response}.body.content#3521
SylvainJuge wants to merge 26 commits into
open-telemetry:mainfrom
SylvainJuge:http-request-response-body

Conversation

@SylvainJuge

@SylvainJuge SylvainJuge commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Part of #857

  • adds http.{request,response}.body.content attribute as type any.
  • recommend to capture value as string whenever possible using heuristics

Covers both the request and response, however the implementation is likely to focus on the server request first:

@SylvainJuge SylvainJuge self-assigned this Mar 9, 2026
@github-actions github-actions Bot added enhancement New feature or request area:http labels Mar 9, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

This PR contains changes to area(s) that do not have an active SIG/project and will be auto-closed:

  • http

Such changes may be rejected or put on hold until a new SIG/project is established.

Please refer to the Semantic Convention Areas
document to see the current active SIGs and also to learn how to kick start a new one.

@SylvainJuge

Copy link
Copy Markdown
Contributor Author

@trask can you re-open this ? Should we create a dedicated SIG/project to handle that ?

@SylvainJuge

Copy link
Copy Markdown
Contributor Author

Update: updating to cover request + response (as suggested here) and also making it client+server.

@SylvainJuge SylvainJuge changed the title add http.request.body.content add http.{request,response}.body.content Mar 13, 2026
@SylvainJuge
SylvainJuge marked this pull request as ready for review March 13, 2026 12:40
@SylvainJuge
SylvainJuge requested review from a team as code owners March 13, 2026 12:40
@AlexanderWert AlexanderWert moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Mar 23, 2026
Comment thread model/http/registry.yaml Outdated
Comment thread model/http/registry.yaml Outdated
Comment thread model/http/registry.yaml Outdated
Comment thread model/http/registry.yaml
Co-authored-by: Liudmila Molkova <neskazu@gmail.com>
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

@github-actions github-actions Bot added the Stale label May 6, 2026
@github-actions github-actions Bot removed the Stale label May 7, 2026
@github-actions

Copy link
Copy Markdown

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

@github-actions github-actions Bot added the Stale label May 21, 2026
@github-actions github-actions Bot removed the Stale label May 26, 2026
Comment thread model/http/registry.yaml Outdated
Comment thread model/http/registry.yaml Outdated
Comment thread docs/registry/attributes/http.md Outdated

To prevent excessive overhead and storage by default, instrumentations MUST issue a warning when the feature is used without an explicit `AttributeValueLengthLimit` configuration option.

Instrumentations MUST disable capture by default and provide an opt-in configuration option to enable it as it can capture sensitive information and cause performance overhead.

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.

Suggested change
Instrumentations MUST disable capture by default and provide an opt-in configuration option to enable it as it can capture sensitive information and cause performance overhead.
Instrumentations MUST NOT capture this attribute by default and MAY provide an option to enable it.
> [!WARNING]
> This attribute may contain sensitive information.

a bit more clarity and also this is a standard incantation we use in semconv to mark sensitive things.

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.

it seems it was lost since it was applied to md and regenerated from yaml, adding comment to yaml, please make sure to update response body too

Comment thread docs/registry/attributes/http.md Outdated
Comment thread docs/registry/attributes/http.md Outdated
@hegerchr

Copy link
Copy Markdown

Hi maintainers (@AlexanderWert , @arminru , @kamphaus , @joaopgrassi , @jsuereth , @lmolkova , @trask ), is there anything that's blocking progress on this? Would be really great to get the sem conv merged to unblock implementations.

@lmolkova lmolkova left a comment

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.

A few minor suggestions, looks good otherwise!

Comment thread model/http/registry.yaml
note: |
Captured value MAY be limited in size and thus value is expected to be truncated in many cases.

Instrumentations MUST disable capture by default and provide an opt-in configuration option to enable it as it can capture sensitive information and cause performance overhead.

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.

Suggested change
Instrumentations MUST disable capture by default and provide an opt-in configuration option to enable it as it can capture sensitive information and cause performance overhead.
Instrumentations MUST NOT capture this attribute by default and MAY provide an option to enable it.
> [!WARNING]
> This attribute may contain sensitive information.

Comment thread model/http/registry.yaml

Instrumentations MUST disable capture by default and provide an opt-in configuration option to enable it as it can capture sensitive information and cause performance overhead.

Instrumentations SHOULD capture the body as string whenever possible as it makes it easier to use in human-readable form, also it allows to implement sanitization if needed.

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.

Suggested change
Instrumentations SHOULD capture the body as string whenever possible as it makes it easier to use in human-readable form, also it allows to implement sanitization if needed.
When instrumentations record body, they SHOULD capture the body as string whenever possible as it makes it easier to use in human-readable form, also it allows to implement sanitization if needed.

Comment thread model/http/registry.yaml
Instrumentations that implement request body recording MUST NOT intentionally introduce side effects such as changing stream position or closing body stream independently from the
application.

When body is recorded on HTTP client or server spans, the instrumentation SHOULD record part of the body that was sent or received at the time HTTP span has ended.

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.

nit: we might want to stamp them on logs in the future

Suggested change
When body is recorded on HTTP client or server spans, the instrumentation SHOULD record part of the body that was sent or received at the time HTTP span has ended.
When body is recorded, the instrumentation SHOULD record part of the body that was sent or received at the time HTTP call has ended.


To prevent excessive overhead and storage by default, instrumentations MUST issue a warning when the feature is used without an explicit `AttributeValueLengthLimit` configuration option.

Instrumentations MUST disable capture by default and provide an opt-in configuration option to enable it as it can capture sensitive information and cause performance overhead.

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.

it seems it was lost since it was applied to md and regenerated from yaml, adding comment to yaml, please make sure to update response body too

Comment thread model/http/registry.yaml
note: |
Captured value MAY be limited in size and thus value is expected to be truncated in many cases.

Instrumentations MUST disable capture by default and provide an opt-in configuration option to enable it as it can capture sensitive information and cause performance overhead.

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.

see comment on request body

Comment thread model/http/registry.yaml
Instrumentations that implement response body recording MUST NOT intentionally introduce side effects such as changing stream position or closing body stream independently from the
application.

When body is recorded on HTTP client or server spans, the instrumentation SHOULD record part of the body that was sent or received at the time HTTP span has ended.

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.

please sync with suggestion on request body (let's not focus on spans)

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 21, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-25 11:59:44 UTC.

  • Waiting on: Author
  • Next step: Address or respond to 5 review feedback items:
    • Inline threads: 1, 2, 3, 4, 5
    • For each item, reply to move the discussion forward, e.g. link to the commit that addresses it, explain why no change is needed, or ask a follow-up question.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. If you believe this pull request is incorrectly routed as waiting on the author, comment /dashboard route:reviewers to route it from waiting on the author to waiting on reviewers. If the last refreshed time above predates your latest reply or push, the dashboard hasn't processed it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Awaiting codeowners approval

Development

Successfully merging this pull request may close these issues.

6 participants