---
title: "Structuring Data"
url: https://develop.sentry.dev/sdk/telemetry/traces/structuring-data/
---

# Structuring Data | Sentry Docs

SDKs store span data in a structured way, so that server-side scrubbing can scrub it. [Data Scrubbing](https://develop.sentry.dev/sdk/foundations/data-scrubbing.md) defines which data the SDK scrubs and which data server-side scrubbing removes.

This page started with [RFC-0038](https://github.com/getsentry/rfcs/blob/main/text/0038-scrubbing-sensitive-data.md). The RFC uses `sendDefaultPii`, which [`dataCollection`](https://develop.sentry.dev/sdk/foundations/client/data-collection.md) replaces.

### [Spans](https://develop.sentry.dev/sdk/telemetry/traces/structuring-data.md#spans)

* `http` spans containing urls:

  The description of spans with `op` set to `http` must follow the format `HTTP_METHOD scheme://host/path` (ex. `GET https://example.com/foo`). If an authority is present in the URL (`https://username:password@example.com`), the authority must be replaced with a placeholder regardless of the `dataCollection` options, leading to a new URL of `https://[Filtered]:[Filtered]@example.com`. If query strings are present in the URL or fragments (Browser SDKs only) are present in the URI, both are set into the data attribute of the span.

  ```js
  span.setAttributes({
    "http.query": url.getQuery(),
    "http.fragment": uri.getFragment(),
  });
  ```

  *Other available variations of the above snippet: python*

  Additionally all semantic conventions of OpenTelemetry for http spans should be set in the `span.data` if applicable: <https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/>

* `db` spans containing database queries: (sql, graphql, elasticsearch, mongodb, ...)

  The description of spans with `op` set to `db` must not contain literal values. Use the parameterized query, for example `SELECT * FROM users WHERE id = ?`. See [Query Parameterization](https://develop.sentry.dev/sdk/telemetry/traces/modules/queries.md#query-parameterization) for the rules and the fallback.

Additionally all semantic conventions of OpenTelemetry for database spans should be set in the `span.data` if applicable: <https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/database/>
