From 7136f133468fe724143c6ecd166e3164c4135a5f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Jul 2025 19:15:52 +0000 Subject: [PATCH 1/6] Add default attributes documentation for SDK logs across platforms Co-authored-by: aprasad --- SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md | 172 ++++++++++++++++++ docs/platforms/android/logs/index.mdx | 4 + .../dart/guides/flutter/logs/index.mdx | 4 + docs/platforms/go/common/logs/index.mdx | 35 ++++ docs/platforms/java/common/logs/index.mdx | 4 + .../javascript/common/logs/index.mdx | 4 + docs/platforms/php/common/logs/index.mdx | 4 + docs/platforms/python/logs/index.mdx | 4 + docs/platforms/react-native/logs/index.mdx | 4 + docs/platforms/ruby/logs/index.mdx | 4 + docs/platforms/rust/common/logs/index.mdx | 33 ++++ .../logs/default-attributes/android.mdx | 34 ++++ .../logs/default-attributes/dart.mdx | 34 ++++ .../logs/default-attributes/java.mdx | 30 +++ .../logs/default-attributes/javascript.mdx | 37 ++++ .../logs/default-attributes/php.mdx | 30 +++ .../logs/default-attributes/python.mdx | 30 +++ .../logs/default-attributes/react-native.mdx | 34 ++++ .../logs/default-attributes/ruby.mdx | 30 +++ .../logs/default-attributes/rust.mdx | 30 +++ 20 files changed, 561 insertions(+) create mode 100644 SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md create mode 100644 platform-includes/logs/default-attributes/android.mdx create mode 100644 platform-includes/logs/default-attributes/dart.mdx create mode 100644 platform-includes/logs/default-attributes/java.mdx create mode 100644 platform-includes/logs/default-attributes/javascript.mdx create mode 100644 platform-includes/logs/default-attributes/php.mdx create mode 100644 platform-includes/logs/default-attributes/python.mdx create mode 100644 platform-includes/logs/default-attributes/react-native.mdx create mode 100644 platform-includes/logs/default-attributes/ruby.mdx create mode 100644 platform-includes/logs/default-attributes/rust.mdx diff --git a/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md b/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md new file mode 100644 index 0000000000000..b76ec40ac3d8a --- /dev/null +++ b/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md @@ -0,0 +1,172 @@ +# SDK Logs Default Attributes Documentation Update + +## Summary + +This document summarizes the changes made to update all SDK documentation files that have logging support to indicate what attributes they set by default. The changes were made based on the information from the [Sentry Developer Documentation for Logs](https://develop.sentry.dev/sdk/telemetry/logs/#default-attributes). + +## Changes Made + +### 1. Created Default Attributes Platform Includes + +Created a new directory `platform-includes/logs/default-attributes/` with specific files for each SDK: + +- **JavaScript SDK** (`javascript.mdx`): + - Core attributes: `sentry.environment`, `sentry.release`, `sentry.trace.parent_span_id`, `sentry.sdk.name`, `sentry.sdk.version` + - Message template attributes: `sentry.message.template`, `sentry.message.parameter.X` + - User attributes: `user.id`, `user.name`, `user.email` + - **Browser-specific**: `browser.name`, `browser.version` + - **Server-specific**: `server.address` + +- **Python SDK** (`python.mdx`): + - Core attributes: Standard SDK attributes + - Message template attributes: For `{attribute_name}` placeholder syntax + - User attributes: Standard user attributes + - **Server-specific**: `server.address` + +- **PHP SDK** (`php.mdx`): + - Core attributes: Standard SDK attributes + - Message template attributes: For format specifiers like `%s` + - User attributes: Standard user attributes + - **Server-specific**: `server.address` + +- **Java SDK** (`java.mdx`): + - Core attributes: Standard SDK attributes + - Message template attributes: For format specifiers like `%s` + - User attributes: Standard user attributes + - **Server-specific**: `server.address` + +- **Ruby SDK** (`ruby.mdx`): + - Core attributes: Standard SDK attributes + - Message template attributes: For format specifiers like `%s` + - User attributes: Standard user attributes + - **Server-specific**: `server.address` + +- **Android SDK** (`android.mdx`): + - Core attributes: Standard SDK attributes with `sentry.java.android` as sdk name + - Message template attributes: For format specifiers + - User attributes: Standard user attributes + - **Mobile-specific**: `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` + +- **React Native SDK** (`react-native.mdx`): + - Core attributes: Standard SDK attributes with `sentry.javascript.react-native` as sdk name + - Message template attributes: For `logger.fmt` or format strings + - User attributes: Standard user attributes + - **Mobile-specific**: `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` + +- **Dart SDK** (`dart.mdx`): + - Core attributes: Standard SDK attributes with `sentry.dart` or `sentry.dart.flutter` as sdk name + - Message template attributes: For format specifiers + - User attributes: Standard user attributes + - **Mobile-specific** (Flutter): `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` + +- **Rust SDK** (`rust.mdx`): + - Core attributes: Standard SDK attributes with `sentry.rust` as sdk name + - Message template attributes: For format specifiers + - User attributes: Standard user attributes + - **Server-specific**: `server.address` + +### 2. Updated SDK Documentation Files + +Updated the following SDK documentation files to include the new "Default Attributes" section: + +#### Files Using Platform Includes: +- `docs/platforms/python/logs/index.mdx` +- `docs/platforms/javascript/common/logs/index.mdx` +- `docs/platforms/php/common/logs/index.mdx` +- `docs/platforms/java/common/logs/index.mdx` +- `docs/platforms/ruby/logs/index.mdx` +- `docs/platforms/android/logs/index.mdx` +- `docs/platforms/react-native/logs/index.mdx` +- `docs/platforms/dart/guides/flutter/logs/index.mdx` + +#### Files with Explicit Content: +- `docs/platforms/go/common/logs/index.mdx` - Added detailed default attributes section +- `docs/platforms/rust/common/logs/index.mdx` - Added detailed default attributes section + +## Default Attributes by SDK Type + +### Core Attributes (All SDKs) +- `sentry.environment`: Environment set in SDK if defined +- `sentry.release`: Release set in SDK if defined +- `sentry.trace.parent_span_id`: Span ID of active span (only if there was an active span) +- `sentry.sdk.name`: Name of the SDK that sent the log +- `sentry.sdk.version`: Version of the SDK that sent the log + +### Message Template Attributes (All SDKs) +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: Parameters to the template string + +### User Attributes (All SDKs) +- `user.id`: User ID +- `user.name`: Username +- `user.email`: Email address + +### Backend SDKs (Node.js, Python, PHP, Ruby, Go, Java, etc.) +- `server.address`: Address of the server that sent the log + +### Browser SDKs (JavaScript in browser) +- `browser.name`: Display name of the browser application +- `browser.version`: Version string of the browser + +### Mobile SDKs (Android, iOS, React Native, Flutter) +- `os.name`: Name of the operating system +- `os.version`: Version of the operating system +- `device.brand`: Brand of the device +- `device.model`: Model of the device +- `device.family`: Family of the device + +## Implementation Details + +1. **Attribute Specificity**: Each SDK only mentions attributes relevant to its platform type. For example: + - Browser attributes are only mentioned for JavaScript browser SDKs + - Mobile device attributes are only mentioned for Android, React Native, and Flutter SDKs + - Server attributes are only mentioned for backend SDKs + +2. **Message Template Context**: Each SDK's default attributes documentation explains its specific message templating syntax: + - JavaScript: `logger.fmt` or format strings + - Python: `{attribute_name}` placeholder syntax + - PHP/Java/Ruby: Format specifiers like `%s` + - Go: Format specifiers like `%v` + - Rust: Format syntax + +3. **SDK Name Specificity**: Each SDK documents its specific `sentry.sdk.name` value: + - JavaScript: `sentry.javascript.browser`, `sentry.javascript.node`, etc. + - Python: `sentry.python` + - PHP: `sentry.php` + - Java: `sentry.java` + - Android: `sentry.java.android` + - React Native: `sentry.javascript.react-native` + - Dart: `sentry.dart` or `sentry.dart.flutter` + - Go: `sentry.go` + - Ruby: `sentry.ruby` + - Rust: `sentry.rust` + +## SDKs Supported + +All SDKs listed on the [Logs Getting Started page](https://docs.sentry.io/product/explore/logs/getting-started/) now have default attributes documentation: + +### JavaScript (all variants) +- Browser JavaScript, Angular, Astro, AWS Lambda, Azure Functions, Bun, Cloudflare, Connect, Electron, Ember, Express, Fastify, Gatsby, Google Cloud Functions, Hapi, Hono, Koa, Nest.js, Node.js, Next.js, Nuxt, React, React Router, Remix, Solid, SolidStart, Svelte, SvelteKit, TanStack Start, Vue, Wasm + +### Java +- Java, Spring, Spring Boot + +### Mobile +- Android, Flutter, React Native + +### PHP +- PHP, Laravel + +### Python +- Python + +### Ruby +- Ruby + +### Go +- Go + +### Rust +- Rust + +This ensures that developers using any of these SDKs can now understand exactly what default attributes will be automatically attached to their log entries, helping them make better use of Sentry's structured logging capabilities. \ No newline at end of file diff --git a/docs/platforms/android/logs/index.mdx b/docs/platforms/android/logs/index.mdx index 9bf5f04f255f6..9e429a9813557 100644 --- a/docs/platforms/android/logs/index.mdx +++ b/docs/platforms/android/logs/index.mdx @@ -25,6 +25,10 @@ With Sentry Structured Logs, you can send text based log information from your a +## Default Attributes + + + ## Options diff --git a/docs/platforms/dart/guides/flutter/logs/index.mdx b/docs/platforms/dart/guides/flutter/logs/index.mdx index cb9856b18584e..dcc0b99d2812f 100644 --- a/docs/platforms/dart/guides/flutter/logs/index.mdx +++ b/docs/platforms/dart/guides/flutter/logs/index.mdx @@ -21,6 +21,10 @@ With Sentry Structured Logs, you can send text based log information from your a +## Default Attributes + + + ## Options diff --git a/docs/platforms/go/common/logs/index.mdx b/docs/platforms/go/common/logs/index.mdx index 8909c56716ed2..046e81ba68eeb 100644 --- a/docs/platforms/go/common/logs/index.mdx +++ b/docs/platforms/go/common/logs/index.mdx @@ -128,6 +128,39 @@ slogger.Info("Implementing slog.Logger") We're actively working on adding more integration support for Logs. Currently, we are looking at adding support for [`zerolog`](https://pkg.go.dev/github.com/rs/zerolog). You can follow this [GitHub issue](https://github.com/getsentry/sentry-go/issues/1015) to track progress. +## Default Attributes + +The Go SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.go`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%v`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) + ## Options ### BeforeSendLog @@ -157,3 +190,5 @@ if err := sentry.Init(sentry.ClientOptions{ ### Debug If the `Debug` init option is set to true, calls to the `sentry.Logger` will also print to the console with the appropriate log level. + +``` diff --git a/docs/platforms/java/common/logs/index.mdx b/docs/platforms/java/common/logs/index.mdx index 9bf5f04f255f6..9e429a9813557 100644 --- a/docs/platforms/java/common/logs/index.mdx +++ b/docs/platforms/java/common/logs/index.mdx @@ -25,6 +25,10 @@ With Sentry Structured Logs, you can send text based log information from your a +## Default Attributes + + + ## Options diff --git a/docs/platforms/javascript/common/logs/index.mdx b/docs/platforms/javascript/common/logs/index.mdx index 99f7146c06e97..ed0d4e068414e 100644 --- a/docs/platforms/javascript/common/logs/index.mdx +++ b/docs/platforms/javascript/common/logs/index.mdx @@ -31,6 +31,10 @@ With Sentry Structured Logs, you can send text based log information from your a +## Default Attributes + + + ## Options diff --git a/docs/platforms/php/common/logs/index.mdx b/docs/platforms/php/common/logs/index.mdx index 3f562ae69f021..c5fad78dfa381 100644 --- a/docs/platforms/php/common/logs/index.mdx +++ b/docs/platforms/php/common/logs/index.mdx @@ -27,6 +27,10 @@ Let us know what you would like to see on GitHub: [Symfony Logs](https://github. +## Default Attributes + + + ## Options diff --git a/docs/platforms/python/logs/index.mdx b/docs/platforms/python/logs/index.mdx index 9bf5f04f255f6..9e429a9813557 100644 --- a/docs/platforms/python/logs/index.mdx +++ b/docs/platforms/python/logs/index.mdx @@ -25,6 +25,10 @@ With Sentry Structured Logs, you can send text based log information from your a +## Default Attributes + + + ## Options diff --git a/docs/platforms/react-native/logs/index.mdx b/docs/platforms/react-native/logs/index.mdx index c29b2e4e3308b..19b6b347e0bc1 100644 --- a/docs/platforms/react-native/logs/index.mdx +++ b/docs/platforms/react-native/logs/index.mdx @@ -27,6 +27,10 @@ With Sentry Structured Logs, you can send text based log information from your a +## Default Attributes + + + ## Options diff --git a/docs/platforms/ruby/logs/index.mdx b/docs/platforms/ruby/logs/index.mdx index 381bd236fa213..9dcf3fa6eaa6b 100644 --- a/docs/platforms/ruby/logs/index.mdx +++ b/docs/platforms/ruby/logs/index.mdx @@ -20,3 +20,7 @@ With Sentry Structured Logs, you can send text based log information from your a ## Usage + +## Default Attributes + + diff --git a/docs/platforms/rust/common/logs/index.mdx b/docs/platforms/rust/common/logs/index.mdx index fad61b17ecd3a..c2a253702c970 100644 --- a/docs/platforms/rust/common/logs/index.mdx +++ b/docs/platforms/rust/common/logs/index.mdx @@ -204,6 +204,39 @@ fn main() { We're always looking to expand integration support for Logs. If you'd like to see support for additional logging libraries, please open a [new issue](https://github.com/getsentry/sentry-rust/issues/new/choose) with your request. +## Default Attributes + +The Rust SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.rust`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) + ## Options ### `before_send_log` diff --git a/platform-includes/logs/default-attributes/android.mdx b/platform-includes/logs/default-attributes/android.mdx new file mode 100644 index 0000000000000..3a12ce5ce1130 --- /dev/null +++ b/platform-includes/logs/default-attributes/android.mdx @@ -0,0 +1,34 @@ +The Android SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.java.android`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Mobile Device Attributes + +For mobile applications: + +- `os.name`: The name of the operating system (`Android`) +- `os.version`: The version of the operating system +- `device.brand`: The brand of the device (e.g., `Samsung`, `Google`) +- `device.model`: The model of the device (e.g., `SM-G973F`, `Pixel 5`) +- `device.family`: The family of the device \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/dart.mdx b/platform-includes/logs/default-attributes/dart.mdx new file mode 100644 index 0000000000000..8f20c447b82e9 --- /dev/null +++ b/platform-includes/logs/default-attributes/dart.mdx @@ -0,0 +1,34 @@ +The Dart SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.dart` or `sentry.dart.flutter`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Mobile Device Attributes + +For mobile Flutter applications: + +- `os.name`: The name of the operating system (`iOS` or `Android`) +- `os.version`: The version of the operating system +- `device.brand`: The brand of the device (e.g., `Apple`, `Samsung`) +- `device.model`: The model of the device (e.g., `iPhone 15 Pro Max`, `SM-G973F`) +- `device.family`: The family of the device \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/java.mdx b/platform-includes/logs/default-attributes/java.mdx new file mode 100644 index 0000000000000..76ba33f3c231e --- /dev/null +++ b/platform-includes/logs/default-attributes/java.mdx @@ -0,0 +1,30 @@ +The Java SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.java`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%s`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/javascript.mdx b/platform-includes/logs/default-attributes/javascript.mdx new file mode 100644 index 0000000000000..76453e2e3beaa --- /dev/null +++ b/platform-includes/logs/default-attributes/javascript.mdx @@ -0,0 +1,37 @@ +The JavaScript SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (e.g., `sentry.javascript.browser`, `sentry.javascript.node`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using `logger.fmt` or format strings, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Browser Attributes + +For browser-based JavaScript applications: + +- `browser.name`: Display name of the browser application +- `browser.version`: Version string of the browser + +### Server Attributes + +For server-side JavaScript applications (Node.js, Bun, Deno, etc.): + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/php.mdx b/platform-includes/logs/default-attributes/php.mdx new file mode 100644 index 0000000000000..1d8e6fee9e0c5 --- /dev/null +++ b/platform-includes/logs/default-attributes/php.mdx @@ -0,0 +1,30 @@ +The PHP SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.php`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%s`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/python.mdx b/platform-includes/logs/default-attributes/python.mdx new file mode 100644 index 0000000000000..0a3fa41bf551b --- /dev/null +++ b/platform-includes/logs/default-attributes/python.mdx @@ -0,0 +1,30 @@ +The Python SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.python`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using `{attribute_name}` placeholder syntax, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position or name + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/react-native.mdx b/platform-includes/logs/default-attributes/react-native.mdx new file mode 100644 index 0000000000000..49d50e25d3e37 --- /dev/null +++ b/platform-includes/logs/default-attributes/react-native.mdx @@ -0,0 +1,34 @@ +The React Native SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.javascript.react-native`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using `logger.fmt` or format strings, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Mobile Device Attributes + +For mobile applications: + +- `os.name`: The name of the operating system (`iOS` or `Android`) +- `os.version`: The version of the operating system +- `device.brand`: The brand of the device (e.g., `Apple`, `Samsung`) +- `device.model`: The model of the device (e.g., `iPhone 15 Pro Max`, `SM-G973F`) +- `device.family`: The family of the device \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/ruby.mdx b/platform-includes/logs/default-attributes/ruby.mdx new file mode 100644 index 0000000000000..6bb5977e6292a --- /dev/null +++ b/platform-includes/logs/default-attributes/ruby.mdx @@ -0,0 +1,30 @@ +The Ruby SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.ruby`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%s`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/rust.mdx b/platform-includes/logs/default-attributes/rust.mdx new file mode 100644 index 0000000000000..833860777a42d --- /dev/null +++ b/platform-includes/logs/default-attributes/rust.mdx @@ -0,0 +1,30 @@ +The Rust SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.rust`) +- `sentry.sdk.version`: The version of the SDK that sent the log + +### Message Template Attributes + +If the log was parameterized using format specifiers, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position + +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address + +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file From 47048e56000f0c917a69db5f7eed681b35e0b2b1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Jul 2025 19:33:00 +0000 Subject: [PATCH 2/6] Refactor SDK logs default attributes to modular, reusable platform includes Co-authored-by: aprasad --- SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md | 214 +++++++++--------- docs/platforms/go/common/logs/index.mdx | 29 +-- docs/platforms/rust/common/logs/index.mdx | 29 +-- .../logs/default-attributes/android.mdx | 33 +-- .../logs/default-attributes/browser.mdx | 6 + .../logs/default-attributes/core.mdx | 7 + .../logs/default-attributes/dart.mdx | 33 +-- .../logs/default-attributes/java.mdx | 29 +-- .../logs/default-attributes/javascript.mdx | 36 +-- .../message-template/android.mdx | 6 + .../message-template/dart.mdx | 6 + .../message-template/go.mdx | 6 + .../message-template/java.mdx | 6 + .../message-template/javascript.mdx | 6 + .../message-template/php.mdx | 6 + .../message-template/python.mdx | 6 + .../message-template/ruby.mdx | 6 + .../message-template/rust.mdx | 6 + .../logs/default-attributes/mobile.mdx | 9 + .../logs/default-attributes/php.mdx | 29 +-- .../logs/default-attributes/python.mdx | 29 +-- .../logs/default-attributes/react-native.mdx | 33 +-- .../logs/default-attributes/ruby.mdx | 29 +-- .../logs/default-attributes/rust.mdx | 29 +-- .../logs/default-attributes/server.mdx | 5 + .../logs/default-attributes/user.mdx | 7 + 26 files changed, 236 insertions(+), 404 deletions(-) create mode 100644 platform-includes/logs/default-attributes/browser.mdx create mode 100644 platform-includes/logs/default-attributes/core.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/android.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/dart.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/go.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/java.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/javascript.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/php.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/python.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/ruby.mdx create mode 100644 platform-includes/logs/default-attributes/message-template/rust.mdx create mode 100644 platform-includes/logs/default-attributes/mobile.mdx create mode 100644 platform-includes/logs/default-attributes/server.mdx create mode 100644 platform-includes/logs/default-attributes/user.mdx diff --git a/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md b/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md index b76ec40ac3d8a..30729fb35e799 100644 --- a/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md +++ b/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md @@ -6,68 +6,53 @@ This document summarizes the changes made to update all SDK documentation files ## Changes Made -### 1. Created Default Attributes Platform Includes - -Created a new directory `platform-includes/logs/default-attributes/` with specific files for each SDK: - -- **JavaScript SDK** (`javascript.mdx`): - - Core attributes: `sentry.environment`, `sentry.release`, `sentry.trace.parent_span_id`, `sentry.sdk.name`, `sentry.sdk.version` - - Message template attributes: `sentry.message.template`, `sentry.message.parameter.X` - - User attributes: `user.id`, `user.name`, `user.email` - - **Browser-specific**: `browser.name`, `browser.version` - - **Server-specific**: `server.address` - -- **Python SDK** (`python.mdx`): - - Core attributes: Standard SDK attributes - - Message template attributes: For `{attribute_name}` placeholder syntax - - User attributes: Standard user attributes - - **Server-specific**: `server.address` - -- **PHP SDK** (`php.mdx`): - - Core attributes: Standard SDK attributes - - Message template attributes: For format specifiers like `%s` - - User attributes: Standard user attributes - - **Server-specific**: `server.address` - -- **Java SDK** (`java.mdx`): - - Core attributes: Standard SDK attributes - - Message template attributes: For format specifiers like `%s` - - User attributes: Standard user attributes - - **Server-specific**: `server.address` - -- **Ruby SDK** (`ruby.mdx`): - - Core attributes: Standard SDK attributes - - Message template attributes: For format specifiers like `%s` - - User attributes: Standard user attributes - - **Server-specific**: `server.address` - -- **Android SDK** (`android.mdx`): - - Core attributes: Standard SDK attributes with `sentry.java.android` as sdk name - - Message template attributes: For format specifiers - - User attributes: Standard user attributes - - **Mobile-specific**: `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` - -- **React Native SDK** (`react-native.mdx`): - - Core attributes: Standard SDK attributes with `sentry.javascript.react-native` as sdk name - - Message template attributes: For `logger.fmt` or format strings - - User attributes: Standard user attributes - - **Mobile-specific**: `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` - -- **Dart SDK** (`dart.mdx`): - - Core attributes: Standard SDK attributes with `sentry.dart` or `sentry.dart.flutter` as sdk name - - Message template attributes: For format specifiers - - User attributes: Standard user attributes - - **Mobile-specific** (Flutter): `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` - -- **Rust SDK** (`rust.mdx`): - - Core attributes: Standard SDK attributes with `sentry.rust` as sdk name - - Message template attributes: For format specifiers - - User attributes: Standard user attributes - - **Server-specific**: `server.address` +### 1. Created Modular Default Attributes Platform Includes + +Created a new modular structure in `platform-includes/logs/default-attributes/` with separate files for different types of attributes: + +#### Core Shared Attributes +- **`core.mdx`**: Core attributes common to all SDKs + - `sentry.environment`, `sentry.release`, `sentry.trace.parent_span_id`, `sentry.sdk.name`, `sentry.sdk.version` + +- **`user.mdx`**: User attributes common to all SDKs + - `user.id`, `user.name`, `user.email` + +- **`browser.mdx`**: Browser-specific attributes + - `browser.name`, `browser.version` + +- **`server.mdx`**: Server-specific attributes + - `server.address` + +- **`mobile.mdx`**: Mobile device-specific attributes + - `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` + +#### Message Template Attributes (SDK-specific) +- **`message-template/javascript.mdx`**: For `logger.fmt` or format strings +- **`message-template/python.mdx`**: For `{attribute_name}` placeholder syntax +- **`message-template/php.mdx`**: For format specifiers like `%s` +- **`message-template/java.mdx`**: For format specifiers like `%s` +- **`message-template/ruby.mdx`**: For format specifiers like `%s` +- **`message-template/android.mdx`**: For format specifiers +- **`message-template/dart.mdx`**: For format specifiers +- **`message-template/rust.mdx`**: For format specifiers +- **`message-template/go.mdx`**: For format specifiers like `%v` + +#### SDK-Specific Composition Files +Each SDK has its own composition file that includes the relevant modular components: + +- **`javascript.mdx`**: Includes core + javascript message template + user + browser + server +- **`python.mdx`**: Includes core + python message template + user + server +- **`php.mdx`**: Includes core + php message template + user + server +- **`java.mdx`**: Includes core + java message template + user + server +- **`ruby.mdx`**: Includes core + ruby message template + user + server +- **`android.mdx`**: Includes core + android message template + user + mobile +- **`react-native.mdx`**: Includes core + javascript message template + user + mobile +- **`dart.mdx`**: Includes core + dart message template + user + mobile +- **`rust.mdx`**: Includes core + rust message template + user + server ### 2. Updated SDK Documentation Files -Updated the following SDK documentation files to include the new "Default Attributes" section: +Updated all SDK documentation files to include the new "Default Attributes" section: #### Files Using Platform Includes: - `docs/platforms/python/logs/index.mdx` @@ -79,9 +64,29 @@ Updated the following SDK documentation files to include the new "Default Attrib - `docs/platforms/react-native/logs/index.mdx` - `docs/platforms/dart/guides/flutter/logs/index.mdx` -#### Files with Explicit Content: -- `docs/platforms/go/common/logs/index.mdx` - Added detailed default attributes section -- `docs/platforms/rust/common/logs/index.mdx` - Added detailed default attributes section +#### Files Updated to Use Modular Includes: +- `docs/platforms/go/common/logs/index.mdx` - Updated to use modular includes +- `docs/platforms/rust/common/logs/index.mdx` - Updated to use modular includes + +## Benefits of Modular Structure + +### 1. **Maintainability** +- Each type of attribute is defined in one place +- Changes to core attributes affect all SDKs automatically +- No duplication of common content + +### 2. **Consistency** +- All SDKs use the same definitions for shared attributes +- Consistent formatting and explanations across all platforms + +### 3. **Flexibility** +- Easy to add new attribute types +- Simple to customize message template explanations per SDK +- Easy to compose different attribute sets for different SDK types + +### 4. **Reusability** +- Common attributes can be reused across multiple SDKs +- Easy to add new SDKs by composing existing modules ## Default Attributes by SDK Type @@ -115,58 +120,45 @@ Updated the following SDK documentation files to include the new "Default Attrib - `device.model`: Model of the device - `device.family`: Family of the device +## File Structure + +``` +platform-includes/logs/default-attributes/ +├── core.mdx # Core attributes (all SDKs) +├── user.mdx # User attributes (all SDKs) +├── browser.mdx # Browser attributes (browser SDKs) +├── server.mdx # Server attributes (backend SDKs) +├── mobile.mdx # Mobile attributes (mobile SDKs) +├── message-template/ # Message template attributes (SDK-specific) +│ ├── javascript.mdx # logger.fmt syntax +│ ├── python.mdx # {attribute_name} syntax +│ ├── php.mdx # %s format specifiers +│ ├── java.mdx # %s format specifiers +│ ├── ruby.mdx # %s format specifiers +│ ├── android.mdx # format specifiers +│ ├── dart.mdx # format specifiers +│ ├── rust.mdx # format specifiers +│ └── go.mdx # %v format specifiers +├── javascript.mdx # Composition for JavaScript SDK +├── python.mdx # Composition for Python SDK +├── php.mdx # Composition for PHP SDK +├── java.mdx # Composition for Java SDK +├── ruby.mdx # Composition for Ruby SDK +├── android.mdx # Composition for Android SDK +├── react-native.mdx # Composition for React Native SDK +├── dart.mdx # Composition for Dart SDK +└── rust.mdx # Composition for Rust SDK +``` + ## Implementation Details -1. **Attribute Specificity**: Each SDK only mentions attributes relevant to its platform type. For example: - - Browser attributes are only mentioned for JavaScript browser SDKs - - Mobile device attributes are only mentioned for Android, React Native, and Flutter SDKs - - Server attributes are only mentioned for backend SDKs - -2. **Message Template Context**: Each SDK's default attributes documentation explains its specific message templating syntax: - - JavaScript: `logger.fmt` or format strings - - Python: `{attribute_name}` placeholder syntax - - PHP/Java/Ruby: Format specifiers like `%s` - - Go: Format specifiers like `%v` - - Rust: Format syntax - -3. **SDK Name Specificity**: Each SDK documents its specific `sentry.sdk.name` value: - - JavaScript: `sentry.javascript.browser`, `sentry.javascript.node`, etc. - - Python: `sentry.python` - - PHP: `sentry.php` - - Java: `sentry.java` - - Android: `sentry.java.android` - - React Native: `sentry.javascript.react-native` - - Dart: `sentry.dart` or `sentry.dart.flutter` - - Go: `sentry.go` - - Ruby: `sentry.ruby` - - Rust: `sentry.rust` +1. **Modular Design**: Each attribute type is defined once and reused across relevant SDKs +2. **Attribute Specificity**: Each SDK only includes attributes relevant to its platform type +3. **Message Template Context**: Each SDK has its own message template explanation for its specific syntax +4. **Consistent Formatting**: All shared attributes use the same formatting and descriptions ## SDKs Supported -All SDKs listed on the [Logs Getting Started page](https://docs.sentry.io/product/explore/logs/getting-started/) now have default attributes documentation: - -### JavaScript (all variants) -- Browser JavaScript, Angular, Astro, AWS Lambda, Azure Functions, Bun, Cloudflare, Connect, Electron, Ember, Express, Fastify, Gatsby, Google Cloud Functions, Hapi, Hono, Koa, Nest.js, Node.js, Next.js, Nuxt, React, React Router, Remix, Solid, SolidStart, Svelte, SvelteKit, TanStack Start, Vue, Wasm - -### Java -- Java, Spring, Spring Boot - -### Mobile -- Android, Flutter, React Native - -### PHP -- PHP, Laravel - -### Python -- Python - -### Ruby -- Ruby - -### Go -- Go - -### Rust -- Rust +All SDKs listed on the [Logs Getting Started page](https://docs.sentry.io/product/explore/logs/getting-started/) now have modular default attributes documentation that provides consistent, maintainable information about what attributes will be automatically attached to their log entries. -This ensures that developers using any of these SDKs can now understand exactly what default attributes will be automatically attached to their log entries, helping them make better use of Sentry's structured logging capabilities. \ No newline at end of file +This modular approach makes it easy to maintain consistency across all SDK documentation while allowing for platform-specific customizations where needed. \ No newline at end of file diff --git a/docs/platforms/go/common/logs/index.mdx b/docs/platforms/go/common/logs/index.mdx index 046e81ba68eeb..df195d6c8ec80 100644 --- a/docs/platforms/go/common/logs/index.mdx +++ b/docs/platforms/go/common/logs/index.mdx @@ -132,34 +132,13 @@ We're actively working on adding more integration support for Logs. Currently, w The Go SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.go`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers (like `%v`), the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Server Attributes - -For backend applications: - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) + ## Options diff --git a/docs/platforms/rust/common/logs/index.mdx b/docs/platforms/rust/common/logs/index.mdx index c2a253702c970..36dacf10bd944 100644 --- a/docs/platforms/rust/common/logs/index.mdx +++ b/docs/platforms/rust/common/logs/index.mdx @@ -208,34 +208,13 @@ If you'd like to see support for additional logging libraries, please open a [ne The Rust SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.rust`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers, the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Server Attributes - -For backend applications: - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) + ## Options diff --git a/platform-includes/logs/default-attributes/android.mdx b/platform-includes/logs/default-attributes/android.mdx index 3a12ce5ce1130..e16aa75dc391b 100644 --- a/platform-includes/logs/default-attributes/android.mdx +++ b/platform-includes/logs/default-attributes/android.mdx @@ -1,34 +1,9 @@ The Android SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.java.android`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers, the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Mobile Device Attributes - -For mobile applications: - -- `os.name`: The name of the operating system (`Android`) -- `os.version`: The version of the operating system -- `device.brand`: The brand of the device (e.g., `Samsung`, `Google`) -- `device.model`: The model of the device (e.g., `SM-G973F`, `Pixel 5`) -- `device.family`: The family of the device \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/browser.mdx b/platform-includes/logs/default-attributes/browser.mdx new file mode 100644 index 0000000000000..435498809f3ff --- /dev/null +++ b/platform-includes/logs/default-attributes/browser.mdx @@ -0,0 +1,6 @@ +### Browser Attributes + +For browser-based applications: + +- `browser.name`: Display name of the browser application +- `browser.version`: Version string of the browser \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/core.mdx b/platform-includes/logs/default-attributes/core.mdx new file mode 100644 index 0000000000000..c429f9102a7cd --- /dev/null +++ b/platform-includes/logs/default-attributes/core.mdx @@ -0,0 +1,7 @@ +### Core Attributes + +- `sentry.environment`: The environment set in the SDK if defined +- `sentry.release`: The release set in the SDK if defined +- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) +- `sentry.sdk.name`: The name of the SDK that sent the log +- `sentry.sdk.version`: The version of the SDK that sent the log \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/dart.mdx b/platform-includes/logs/default-attributes/dart.mdx index 8f20c447b82e9..0dfd05b22c5e3 100644 --- a/platform-includes/logs/default-attributes/dart.mdx +++ b/platform-includes/logs/default-attributes/dart.mdx @@ -1,34 +1,9 @@ The Dart SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.dart` or `sentry.dart.flutter`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers, the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Mobile Device Attributes - -For mobile Flutter applications: - -- `os.name`: The name of the operating system (`iOS` or `Android`) -- `os.version`: The version of the operating system -- `device.brand`: The brand of the device (e.g., `Apple`, `Samsung`) -- `device.model`: The model of the device (e.g., `iPhone 15 Pro Max`, `SM-G973F`) -- `device.family`: The family of the device \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/java.mdx b/platform-includes/logs/default-attributes/java.mdx index 76ba33f3c231e..ef19b684f8d41 100644 --- a/platform-includes/logs/default-attributes/java.mdx +++ b/platform-includes/logs/default-attributes/java.mdx @@ -1,30 +1,9 @@ The Java SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.java`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers (like `%s`), the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Server Attributes - -For backend applications: - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/javascript.mdx b/platform-includes/logs/default-attributes/javascript.mdx index 76453e2e3beaa..60597ac08d7d0 100644 --- a/platform-includes/logs/default-attributes/javascript.mdx +++ b/platform-includes/logs/default-attributes/javascript.mdx @@ -1,37 +1,11 @@ The JavaScript SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (e.g., `sentry.javascript.browser`, `sentry.javascript.node`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using `logger.fmt` or format strings, the SDK will also set: + -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Browser Attributes - -For browser-based JavaScript applications: - -- `browser.name`: Display name of the browser application -- `browser.version`: Version string of the browser - -### Server Attributes - -For server-side JavaScript applications (Node.js, Bun, Deno, etc.): - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/android.mdx b/platform-includes/logs/default-attributes/message-template/android.mdx new file mode 100644 index 0000000000000..5067178c84576 --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/android.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using format specifiers, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/dart.mdx b/platform-includes/logs/default-attributes/message-template/dart.mdx new file mode 100644 index 0000000000000..5067178c84576 --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/dart.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using format specifiers, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/go.mdx b/platform-includes/logs/default-attributes/message-template/go.mdx new file mode 100644 index 0000000000000..a6e1c255d5ece --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/go.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%v`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/java.mdx b/platform-includes/logs/default-attributes/message-template/java.mdx new file mode 100644 index 0000000000000..f2ee86c383ddf --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/java.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%s`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/javascript.mdx b/platform-includes/logs/default-attributes/message-template/javascript.mdx new file mode 100644 index 0000000000000..26d22aa54c387 --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/javascript.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using `logger.fmt` or format strings, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/php.mdx b/platform-includes/logs/default-attributes/message-template/php.mdx new file mode 100644 index 0000000000000..f2ee86c383ddf --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/php.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%s`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/python.mdx b/platform-includes/logs/default-attributes/message-template/python.mdx new file mode 100644 index 0000000000000..6ff4d6232759b --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/python.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using `{attribute_name}` placeholder syntax, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position or name \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/ruby.mdx b/platform-includes/logs/default-attributes/message-template/ruby.mdx new file mode 100644 index 0000000000000..f2ee86c383ddf --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/ruby.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using format specifiers (like `%s`), the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/message-template/rust.mdx b/platform-includes/logs/default-attributes/message-template/rust.mdx new file mode 100644 index 0000000000000..5067178c84576 --- /dev/null +++ b/platform-includes/logs/default-attributes/message-template/rust.mdx @@ -0,0 +1,6 @@ +### Message Template Attributes + +If the log was parameterized using format specifiers, the SDK will also set: + +- `sentry.message.template`: The parameterized template string +- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/mobile.mdx b/platform-includes/logs/default-attributes/mobile.mdx new file mode 100644 index 0000000000000..8b6c6d25a42bc --- /dev/null +++ b/platform-includes/logs/default-attributes/mobile.mdx @@ -0,0 +1,9 @@ +### Mobile Device Attributes + +For mobile applications: + +- `os.name`: The name of the operating system +- `os.version`: The version of the operating system +- `device.brand`: The brand of the device +- `device.model`: The model of the device +- `device.family`: The family of the device \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/php.mdx b/platform-includes/logs/default-attributes/php.mdx index 1d8e6fee9e0c5..a3543a9ef6ade 100644 --- a/platform-includes/logs/default-attributes/php.mdx +++ b/platform-includes/logs/default-attributes/php.mdx @@ -1,30 +1,9 @@ The PHP SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.php`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers (like `%s`), the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Server Attributes - -For backend applications: - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/python.mdx b/platform-includes/logs/default-attributes/python.mdx index 0a3fa41bf551b..68112e3eda272 100644 --- a/platform-includes/logs/default-attributes/python.mdx +++ b/platform-includes/logs/default-attributes/python.mdx @@ -1,30 +1,9 @@ The Python SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.python`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using `{attribute_name}` placeholder syntax, the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position or name - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Server Attributes - -For backend applications: - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/react-native.mdx b/platform-includes/logs/default-attributes/react-native.mdx index 49d50e25d3e37..912ffc1fad05b 100644 --- a/platform-includes/logs/default-attributes/react-native.mdx +++ b/platform-includes/logs/default-attributes/react-native.mdx @@ -1,34 +1,9 @@ The React Native SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.javascript.react-native`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using `logger.fmt` or format strings, the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Mobile Device Attributes - -For mobile applications: - -- `os.name`: The name of the operating system (`iOS` or `Android`) -- `os.version`: The version of the operating system -- `device.brand`: The brand of the device (e.g., `Apple`, `Samsung`) -- `device.model`: The model of the device (e.g., `iPhone 15 Pro Max`, `SM-G973F`) -- `device.family`: The family of the device \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/ruby.mdx b/platform-includes/logs/default-attributes/ruby.mdx index 6bb5977e6292a..8c4b936178736 100644 --- a/platform-includes/logs/default-attributes/ruby.mdx +++ b/platform-includes/logs/default-attributes/ruby.mdx @@ -1,30 +1,9 @@ The Ruby SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.ruby`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers (like `%s`), the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Server Attributes - -For backend applications: - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/rust.mdx b/platform-includes/logs/default-attributes/rust.mdx index 833860777a42d..2b3e90c4f4770 100644 --- a/platform-includes/logs/default-attributes/rust.mdx +++ b/platform-includes/logs/default-attributes/rust.mdx @@ -1,30 +1,9 @@ The Rust SDK automatically sets several default attributes on all log entries to provide context and improve debugging: -### Core Attributes + -- `sentry.environment`: The environment set in the SDK if defined -- `sentry.release`: The release set in the SDK if defined -- `sentry.trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span) -- `sentry.sdk.name`: The name of the SDK that sent the log (`sentry.rust`) -- `sentry.sdk.version`: The version of the SDK that sent the log + -### Message Template Attributes + -If the log was parameterized using format specifiers, the SDK will also set: - -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: The parameters to the template string, where X is the parameter's position - -### User Attributes - -If user information is available in the current scope: - -- `user.id`: The user ID -- `user.name`: The username -- `user.email`: The email address - -### Server Attributes - -For backend applications: - -- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file + \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/server.mdx b/platform-includes/logs/default-attributes/server.mdx new file mode 100644 index 0000000000000..7bec89d1b4726 --- /dev/null +++ b/platform-includes/logs/default-attributes/server.mdx @@ -0,0 +1,5 @@ +### Server Attributes + +For backend applications: + +- `server.address`: The address of the server that sent the log (equivalent to server_name attached to errors and transactions) \ No newline at end of file diff --git a/platform-includes/logs/default-attributes/user.mdx b/platform-includes/logs/default-attributes/user.mdx new file mode 100644 index 0000000000000..6964140bc71c9 --- /dev/null +++ b/platform-includes/logs/default-attributes/user.mdx @@ -0,0 +1,7 @@ +### User Attributes + +If user information is available in the current scope: + +- `user.id`: The user ID +- `user.name`: The username +- `user.email`: The email address \ No newline at end of file From c6d9a91548e31928fe04421b6e596411fa808b87 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Jul 2025 19:35:19 +0000 Subject: [PATCH 3/6] Remove SDK logs default attributes documentation update file Co-authored-by: aprasad --- SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md | 164 -------------------------- 1 file changed, 164 deletions(-) delete mode 100644 SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md diff --git a/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md b/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md deleted file mode 100644 index 30729fb35e799..0000000000000 --- a/SDK_LOGS_DEFAULT_ATTRIBUTES_UPDATE.md +++ /dev/null @@ -1,164 +0,0 @@ -# SDK Logs Default Attributes Documentation Update - -## Summary - -This document summarizes the changes made to update all SDK documentation files that have logging support to indicate what attributes they set by default. The changes were made based on the information from the [Sentry Developer Documentation for Logs](https://develop.sentry.dev/sdk/telemetry/logs/#default-attributes). - -## Changes Made - -### 1. Created Modular Default Attributes Platform Includes - -Created a new modular structure in `platform-includes/logs/default-attributes/` with separate files for different types of attributes: - -#### Core Shared Attributes -- **`core.mdx`**: Core attributes common to all SDKs - - `sentry.environment`, `sentry.release`, `sentry.trace.parent_span_id`, `sentry.sdk.name`, `sentry.sdk.version` - -- **`user.mdx`**: User attributes common to all SDKs - - `user.id`, `user.name`, `user.email` - -- **`browser.mdx`**: Browser-specific attributes - - `browser.name`, `browser.version` - -- **`server.mdx`**: Server-specific attributes - - `server.address` - -- **`mobile.mdx`**: Mobile device-specific attributes - - `os.name`, `os.version`, `device.brand`, `device.model`, `device.family` - -#### Message Template Attributes (SDK-specific) -- **`message-template/javascript.mdx`**: For `logger.fmt` or format strings -- **`message-template/python.mdx`**: For `{attribute_name}` placeholder syntax -- **`message-template/php.mdx`**: For format specifiers like `%s` -- **`message-template/java.mdx`**: For format specifiers like `%s` -- **`message-template/ruby.mdx`**: For format specifiers like `%s` -- **`message-template/android.mdx`**: For format specifiers -- **`message-template/dart.mdx`**: For format specifiers -- **`message-template/rust.mdx`**: For format specifiers -- **`message-template/go.mdx`**: For format specifiers like `%v` - -#### SDK-Specific Composition Files -Each SDK has its own composition file that includes the relevant modular components: - -- **`javascript.mdx`**: Includes core + javascript message template + user + browser + server -- **`python.mdx`**: Includes core + python message template + user + server -- **`php.mdx`**: Includes core + php message template + user + server -- **`java.mdx`**: Includes core + java message template + user + server -- **`ruby.mdx`**: Includes core + ruby message template + user + server -- **`android.mdx`**: Includes core + android message template + user + mobile -- **`react-native.mdx`**: Includes core + javascript message template + user + mobile -- **`dart.mdx`**: Includes core + dart message template + user + mobile -- **`rust.mdx`**: Includes core + rust message template + user + server - -### 2. Updated SDK Documentation Files - -Updated all SDK documentation files to include the new "Default Attributes" section: - -#### Files Using Platform Includes: -- `docs/platforms/python/logs/index.mdx` -- `docs/platforms/javascript/common/logs/index.mdx` -- `docs/platforms/php/common/logs/index.mdx` -- `docs/platforms/java/common/logs/index.mdx` -- `docs/platforms/ruby/logs/index.mdx` -- `docs/platforms/android/logs/index.mdx` -- `docs/platforms/react-native/logs/index.mdx` -- `docs/platforms/dart/guides/flutter/logs/index.mdx` - -#### Files Updated to Use Modular Includes: -- `docs/platforms/go/common/logs/index.mdx` - Updated to use modular includes -- `docs/platforms/rust/common/logs/index.mdx` - Updated to use modular includes - -## Benefits of Modular Structure - -### 1. **Maintainability** -- Each type of attribute is defined in one place -- Changes to core attributes affect all SDKs automatically -- No duplication of common content - -### 2. **Consistency** -- All SDKs use the same definitions for shared attributes -- Consistent formatting and explanations across all platforms - -### 3. **Flexibility** -- Easy to add new attribute types -- Simple to customize message template explanations per SDK -- Easy to compose different attribute sets for different SDK types - -### 4. **Reusability** -- Common attributes can be reused across multiple SDKs -- Easy to add new SDKs by composing existing modules - -## Default Attributes by SDK Type - -### Core Attributes (All SDKs) -- `sentry.environment`: Environment set in SDK if defined -- `sentry.release`: Release set in SDK if defined -- `sentry.trace.parent_span_id`: Span ID of active span (only if there was an active span) -- `sentry.sdk.name`: Name of the SDK that sent the log -- `sentry.sdk.version`: Version of the SDK that sent the log - -### Message Template Attributes (All SDKs) -- `sentry.message.template`: The parameterized template string -- `sentry.message.parameter.X`: Parameters to the template string - -### User Attributes (All SDKs) -- `user.id`: User ID -- `user.name`: Username -- `user.email`: Email address - -### Backend SDKs (Node.js, Python, PHP, Ruby, Go, Java, etc.) -- `server.address`: Address of the server that sent the log - -### Browser SDKs (JavaScript in browser) -- `browser.name`: Display name of the browser application -- `browser.version`: Version string of the browser - -### Mobile SDKs (Android, iOS, React Native, Flutter) -- `os.name`: Name of the operating system -- `os.version`: Version of the operating system -- `device.brand`: Brand of the device -- `device.model`: Model of the device -- `device.family`: Family of the device - -## File Structure - -``` -platform-includes/logs/default-attributes/ -├── core.mdx # Core attributes (all SDKs) -├── user.mdx # User attributes (all SDKs) -├── browser.mdx # Browser attributes (browser SDKs) -├── server.mdx # Server attributes (backend SDKs) -├── mobile.mdx # Mobile attributes (mobile SDKs) -├── message-template/ # Message template attributes (SDK-specific) -│ ├── javascript.mdx # logger.fmt syntax -│ ├── python.mdx # {attribute_name} syntax -│ ├── php.mdx # %s format specifiers -│ ├── java.mdx # %s format specifiers -│ ├── ruby.mdx # %s format specifiers -│ ├── android.mdx # format specifiers -│ ├── dart.mdx # format specifiers -│ ├── rust.mdx # format specifiers -│ └── go.mdx # %v format specifiers -├── javascript.mdx # Composition for JavaScript SDK -├── python.mdx # Composition for Python SDK -├── php.mdx # Composition for PHP SDK -├── java.mdx # Composition for Java SDK -├── ruby.mdx # Composition for Ruby SDK -├── android.mdx # Composition for Android SDK -├── react-native.mdx # Composition for React Native SDK -├── dart.mdx # Composition for Dart SDK -└── rust.mdx # Composition for Rust SDK -``` - -## Implementation Details - -1. **Modular Design**: Each attribute type is defined once and reused across relevant SDKs -2. **Attribute Specificity**: Each SDK only includes attributes relevant to its platform type -3. **Message Template Context**: Each SDK has its own message template explanation for its specific syntax -4. **Consistent Formatting**: All shared attributes use the same formatting and descriptions - -## SDKs Supported - -All SDKs listed on the [Logs Getting Started page](https://docs.sentry.io/product/explore/logs/getting-started/) now have modular default attributes documentation that provides consistent, maintainable information about what attributes will be automatically attached to their log entries. - -This modular approach makes it easy to maintain consistency across all SDK documentation while allowing for platform-specific customizations where needed. \ No newline at end of file From 1419f69ca5cabbeef3034e5306b194c75f0f11de Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Jul 2025 19:37:43 +0000 Subject: [PATCH 4/6] Remove extra blank lines in Go logging documentation Co-authored-by: aprasad --- docs/platforms/go/common/logs/index.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/platforms/go/common/logs/index.mdx b/docs/platforms/go/common/logs/index.mdx index df195d6c8ec80..d7ec1c1a2951f 100644 --- a/docs/platforms/go/common/logs/index.mdx +++ b/docs/platforms/go/common/logs/index.mdx @@ -169,5 +169,3 @@ if err := sentry.Init(sentry.ClientOptions{ ### Debug If the `Debug` init option is set to true, calls to the `sentry.Logger` will also print to the console with the appropriate log level. - -``` From eb5d4928fa6acc6c112d2d6eb92503562188f611 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Jul 2025 19:38:00 +0000 Subject: [PATCH 5/6] Changes from background composer bc-2a09cb26-c6d8-4a31-9501-b30c017b5f16 --- platform-includes/logs/default-attributes/mobile.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/logs/default-attributes/mobile.mdx b/platform-includes/logs/default-attributes/mobile.mdx index 8b6c6d25a42bc..6947ca9b86113 100644 --- a/platform-includes/logs/default-attributes/mobile.mdx +++ b/platform-includes/logs/default-attributes/mobile.mdx @@ -1,4 +1,4 @@ -### Mobile Device Attributes +### Mobile and Native Device Attributes For mobile applications: From 2f99929757408158b3ed6eade1ed61f24606758f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Jul 2025 19:41:17 +0000 Subject: [PATCH 6/6] Reorder Default Attributes section in platform logs documentation Co-authored-by: aprasad --- docs/platforms/android/logs/index.mdx | 8 +++---- .../dart/guides/flutter/logs/index.mdx | 8 +++---- docs/platforms/go/common/logs/index.mdx | 24 +++++++++---------- docs/platforms/java/common/logs/index.mdx | 8 +++---- .../javascript/common/logs/index.mdx | 8 +++---- docs/platforms/php/common/logs/index.mdx | 8 +++---- docs/platforms/python/logs/index.mdx | 8 +++---- docs/platforms/react-native/logs/index.mdx | 8 +++---- docs/platforms/ruby/logs/index.mdx | 4 ++++ docs/platforms/rust/common/logs/index.mdx | 24 +++++++++---------- 10 files changed, 56 insertions(+), 52 deletions(-) diff --git a/docs/platforms/android/logs/index.mdx b/docs/platforms/android/logs/index.mdx index 9e429a9813557..f0e5b76bf5bad 100644 --- a/docs/platforms/android/logs/index.mdx +++ b/docs/platforms/android/logs/index.mdx @@ -25,10 +25,10 @@ With Sentry Structured Logs, you can send text based log information from your a -## Default Attributes - - - ## Options + +## Default Attributes + + diff --git a/docs/platforms/dart/guides/flutter/logs/index.mdx b/docs/platforms/dart/guides/flutter/logs/index.mdx index dcc0b99d2812f..78627c769b40a 100644 --- a/docs/platforms/dart/guides/flutter/logs/index.mdx +++ b/docs/platforms/dart/guides/flutter/logs/index.mdx @@ -21,10 +21,10 @@ With Sentry Structured Logs, you can send text based log information from your a -## Default Attributes - - - ## Options + +## Default Attributes + + diff --git a/docs/platforms/go/common/logs/index.mdx b/docs/platforms/go/common/logs/index.mdx index d7ec1c1a2951f..3a3b1802c5ebd 100644 --- a/docs/platforms/go/common/logs/index.mdx +++ b/docs/platforms/go/common/logs/index.mdx @@ -128,18 +128,6 @@ slogger.Info("Implementing slog.Logger") We're actively working on adding more integration support for Logs. Currently, we are looking at adding support for [`zerolog`](https://pkg.go.dev/github.com/rs/zerolog). You can follow this [GitHub issue](https://github.com/getsentry/sentry-go/issues/1015) to track progress. -## Default Attributes - -The Go SDK automatically sets several default attributes on all log entries to provide context and improve debugging: - - - - - - - - - ## Options ### BeforeSendLog @@ -169,3 +157,15 @@ if err := sentry.Init(sentry.ClientOptions{ ### Debug If the `Debug` init option is set to true, calls to the `sentry.Logger` will also print to the console with the appropriate log level. + +## Default Attributes + +The Go SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + + + + + + + + diff --git a/docs/platforms/java/common/logs/index.mdx b/docs/platforms/java/common/logs/index.mdx index 9e429a9813557..f0e5b76bf5bad 100644 --- a/docs/platforms/java/common/logs/index.mdx +++ b/docs/platforms/java/common/logs/index.mdx @@ -25,10 +25,10 @@ With Sentry Structured Logs, you can send text based log information from your a -## Default Attributes - - - ## Options + +## Default Attributes + + diff --git a/docs/platforms/javascript/common/logs/index.mdx b/docs/platforms/javascript/common/logs/index.mdx index ed0d4e068414e..9c1d10f1c9657 100644 --- a/docs/platforms/javascript/common/logs/index.mdx +++ b/docs/platforms/javascript/common/logs/index.mdx @@ -31,10 +31,10 @@ With Sentry Structured Logs, you can send text based log information from your a -## Default Attributes - - - ## Options + +## Default Attributes + + diff --git a/docs/platforms/php/common/logs/index.mdx b/docs/platforms/php/common/logs/index.mdx index c5fad78dfa381..26bafb84dd521 100644 --- a/docs/platforms/php/common/logs/index.mdx +++ b/docs/platforms/php/common/logs/index.mdx @@ -27,10 +27,10 @@ Let us know what you would like to see on GitHub: [Symfony Logs](https://github. -## Default Attributes - - - ## Options + +## Default Attributes + + diff --git a/docs/platforms/python/logs/index.mdx b/docs/platforms/python/logs/index.mdx index 9e429a9813557..f0e5b76bf5bad 100644 --- a/docs/platforms/python/logs/index.mdx +++ b/docs/platforms/python/logs/index.mdx @@ -25,10 +25,10 @@ With Sentry Structured Logs, you can send text based log information from your a -## Default Attributes - - - ## Options + +## Default Attributes + + diff --git a/docs/platforms/react-native/logs/index.mdx b/docs/platforms/react-native/logs/index.mdx index 19b6b347e0bc1..c22d42ef3d836 100644 --- a/docs/platforms/react-native/logs/index.mdx +++ b/docs/platforms/react-native/logs/index.mdx @@ -27,10 +27,10 @@ With Sentry Structured Logs, you can send text based log information from your a -## Default Attributes - - - ## Options + +## Default Attributes + + diff --git a/docs/platforms/ruby/logs/index.mdx b/docs/platforms/ruby/logs/index.mdx index 9dcf3fa6eaa6b..78627c769b40a 100644 --- a/docs/platforms/ruby/logs/index.mdx +++ b/docs/platforms/ruby/logs/index.mdx @@ -21,6 +21,10 @@ With Sentry Structured Logs, you can send text based log information from your a +## Options + + + ## Default Attributes diff --git a/docs/platforms/rust/common/logs/index.mdx b/docs/platforms/rust/common/logs/index.mdx index 36dacf10bd944..91bbebf0e352c 100644 --- a/docs/platforms/rust/common/logs/index.mdx +++ b/docs/platforms/rust/common/logs/index.mdx @@ -204,18 +204,6 @@ fn main() { We're always looking to expand integration support for Logs. If you'd like to see support for additional logging libraries, please open a [new issue](https://github.com/getsentry/sentry-rust/issues/new/choose) with your request. -## Default Attributes - -The Rust SDK automatically sets several default attributes on all log entries to provide context and improve debugging: - - - - - - - - - ## Options ### `before_send_log` @@ -236,3 +224,15 @@ let _guard = sentry::init(("___PUBLIC_DSN___", sentry::ClientOptions { ..Default::default() })); ``` + +## Default Attributes + +The Rust SDK automatically sets several default attributes on all log entries to provide context and improve debugging: + + + + + + + +