Scope tags set via scope.setTag() (including Sentry.getIsolationScope().setTag()) are not included in logs captured by the Pino integration. Only scope attributes (set via scope.setAttribute()) and user fields (id, email, username) are propagated to log envelopes.
Root cause
In _INTERNAL_captureLog (packages/core/src/logs/internal.ts), getCombinedScopeData() is called but only user and attributes are destructured — tags is ignored:
const {
user: { id, email, username },
attributes: scopeAttributes = {},
} = getCombinedScopeData(getIsolationScope(), currentScope);
The tags field from ScopeData is never merged into the log's attributes before the envelope is sent. This is inconsistent with error capturing, where captureException/captureMessage run through the full scope pipeline and include tags.
Impact
- Any tag set via
Sentry.setTag(), scope.setTag(), or getIsolationScope().setTag() is silently dropped for log events.
- This affects all integrations that call
_INTERNAL_captureLog, including the Pino, Winston, and console integrations.
Workaround
Use scope.setAttribute() / getIsolationScope().setAttribute() instead of setTag() for values that need to appear on logs.
Expected behavior
Scope tags should be included in captured log attributes, consistent with how they are applied to error events.
Action taken on behalf of Kyle Tryon.
Scope tags set via
scope.setTag()(includingSentry.getIsolationScope().setTag()) are not included in logs captured by the Pino integration. Only scopeattributes(set viascope.setAttribute()) and user fields (id, email, username) are propagated to log envelopes.Root cause
In
_INTERNAL_captureLog(packages/core/src/logs/internal.ts),getCombinedScopeData()is called but onlyuserandattributesare destructured —tagsis ignored:The
tagsfield fromScopeDatais never merged into the log's attributes before the envelope is sent. This is inconsistent with error capturing, wherecaptureException/captureMessagerun through the full scope pipeline and include tags.Impact
Sentry.setTag(),scope.setTag(), orgetIsolationScope().setTag()is silently dropped for log events._INTERNAL_captureLog, including the Pino, Winston, and console integrations.Workaround
Use
scope.setAttribute()/getIsolationScope().setAttribute()instead ofsetTag()for values that need to appear on logs.Expected behavior
Scope tags should be included in captured log attributes, consistent with how they are applied to error events.
Action taken on behalf of Kyle Tryon.