diff --git a/develop-docs/sdk/telemetry/logs.mdx b/develop-docs/sdk/telemetry/logs.mdx index 6bb46e3ef9f72..b5328e573ec50 100644 --- a/develop-docs/sdk/telemetry/logs.mdx +++ b/develop-docs/sdk/telemetry/logs.mdx @@ -125,8 +125,8 @@ Log processing **MUST** follow this order: 1. Capture log via [Public APIs](#logger-module) (e.g. `Sentry.logger.info`) or via [SDK integrations](#sdk-integrations). 2. Check if logging is enabled via `enableLogs`/`enable_logs` — if not, skip remaining steps. -3. Pass the log to Hub/Scope, which **MUST** offer the same methods as the static API `Sentry.logger.X`. -4. Pass the log to the Client via a generic method (e.g., `captureLog(log, scope)`). +3. Pass the log to Hub/Scope via a generic method (e.g., `captureLog`). +4. Pass the log to the Client via a generic method (e.g., `captureLog`). 5. Process captured log (attach attributes per [Default Attributes](#default-attributes)). 6. Run `beforeSendLog`/`before_send_log` to filter or modify the log. 7. Add log to buffer/batch processor per [Buffering](#buffering). @@ -461,9 +461,7 @@ SDKs **MUST** expose logging methods in a `logger` module or namespace, with one These methods accept a string template and parameters for structured logging. They **MAY** also accept arbitrary attributes. -The Hub/Scope **MUST** offer the same methods as the static `Sentry.logger.X` API (since 1.10.0). The Client **SHOULD** only offer one generic method (e.g., `captureLog(log, scope)`). - -SDKs **MAY** add additional helpers (e.g., decorators, string template helpers) as appropriate for their platform. +The Hub/Scope and Client **MUST** exclusively provide a generic logging method (e.g., `captureLog`). They **MUST NOT** replicate the static `Sentry.logger.X` API methods to avoid increasing our API surface. Users utilizing multiple Hub/Scope or Clients will need to rely on the generic method for logging. diff --git a/develop-docs/sdk/telemetry/metrics.mdx b/develop-docs/sdk/telemetry/metrics.mdx index 30664770f81d3..5e9e10b9a1ba1 100644 --- a/develop-docs/sdk/telemetry/metrics.mdx +++ b/develop-docs/sdk/telemetry/metrics.mdx @@ -97,10 +97,12 @@ Metric processing **MUST** follow this order: 1. Capture metric via [Public APIs](#metrics-module) (e.g. `Sentry.metrics.count`). 2. Check if metrics are disabled as per `enableMetrics`/`enable_metrics` configuration — if so, skip the rest of the steps. -3. Process captured metric (attach default attributes as per [Default Attributes](#default-attributes)). -4. Run `beforeSendMetric`/`before_send_metric` to filter or modify the metric. -5. Add metric to buffer/batch processor as detailed in [Buffering](#buffering). -6. At time of flushing buffer, send array of metrics to Sentry via `trace_metric` envelope, apply rate limiting as per [Data Category and Rate Limiting](#data-category-and-rate-limiting). +3. Pass the metric to Hub/Scope via a generic method (e.g., `captureMetric(metric)`). +4. Pass the metric to the Client via a generic method (e.g., `captureMetric(metric)`). +5. Process captured metric (attach default attributes as per [Default Attributes](#default-attributes)). +6. Run `beforeSendMetric`/`before_send_metric` to filter or modify the metric. +7. Add metric to buffer/batch processor as detailed in [Buffering](#buffering). +8. At time of flushing buffer, send array of metrics to Sentry via `trace_metric` envelope, apply rate limiting as per [Data Category and Rate Limiting](#data-category-and-rate-limiting). @@ -319,6 +321,8 @@ SDKs **MUST** expose metrics methods in a `metrics` module or namespace. At mini - `attributes` **Object, optional** — a dictionary of attributes (key-value pairs with type information). - `scope` **Scope, optional** — the scope to capture the metric with. +The Hub/Scope and Client **MUST** exclusively provide a generic method for capturing metrics (e.g., `captureMetric(metric)`). They **MUST NOT** replicate the static `Sentry.metrics.X` API methods to avoid increasing our API surface. Users utilizing multiple Hub/Scope or Clients will need to rely on the generic method for capturing metrics. + ### Threading and Concurrency Considerations