Skip to content

ref(attributes): Enforce sentry-conventions in core and tracing - #8406

Draft
srothh wants to merge 3 commits into
srothh/add-conventions-dependencyfrom
srothh/conventions-core-tracing
Draft

srothh wants to merge 3 commits into
srothh/add-conventions-dependencyfrom
srothh/conventions-core-tracing

Conversation

@srothh

@srothh srothh commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Description

Enforce attribute names from sentry-conventions in core and tracing files.

Issues

resolves #8322
PY-3089

Enforce sentry-conventions attribute names in core files (_log_batcher.py, logger.py, scope.py, traces.py, tracing_utils.py).

GH-8322
PY-3089
@linear-code

linear-code Bot commented Nov 26, 2026

Copy link
Copy Markdown

PY-3089

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 58818 passed | ❌ 2 failed | ⏭️ 3044 skipped | Total: 61864 | Pass Rate: 95.08% | Execution Time: 158m 29s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -712
Passed Tests 📉 -639
Failed Tests 📈 +2
Skipped Tests 📉 -75

➕ New Tests (2)

View new tests
  • test_cron_job_ok
    • File: tests.integrations.arq.test_arq_crons
    • Status: ❌ Failing
  • test_execution_outcome[start_sync_execution-SUCCEEDED-None]
    • File: tests.integrations.boto3.test_stepfunctions
    • Status: ❌ Failing

❌ Failed Tests

test_cron_job_ok

File: tests.integrations.arq.test_arq_crons
Suite: py3.10-arq-v0.23
Error: ValueError: too many values to unpack (expected 2)

Stack Trace
tests/integrations/arq/test_arq_crons.py:84: in test_cron_job_ok
    in_progress, ok = _check_ins(envelopes)
E   ValueError: too many values to unpack (expected 2)

test_execution_outcome[start_sync_execution-SUCCEEDED-None]

File: tests.integrations.boto3.test_stepfunctions
Suite: py3.10-boto3-v1.44.4
Error: assert '4242' not in "{'trace_id': '9ab79db328424218bf08a97e6f2a6881', 'span_id': '8f522feee6105112', 'name': 'SFN.StartSyncExecution', 'status': 'ok', 'is_segment': False, 'start_timestamp': 1795692603.627692, 'end_timestamp': 1795692603.628798, 'parent_span_id': 'a8364afb9782b205', 'attributes': {'sentry.origin': 'auto.aws.boto3', 'sentry.trace_lifecycle': 'stream', 'cloud.provider': 'aws', 'rpc.method': 'StartSyncExecution', 'rpc.system.name': 'aws-api', 'sentry.kind': 'client', 'rpc.service'... [+4 more lines; full report in element text]

Stack Trace
tests/integrations/boto3/test_stepfunctions.py:152: in test_execution_outcome
    assert "4242" not in str(span)
E   assert '4242' not in "{'trace_id': '9ab79db328424218bf08a97e6f2a6881', 'span_id': '8f522feee6105112', 'name': 'SFN.StartSyncExecution', 'status': 'ok', 'is_segment': False, 'start_timestamp': 1795692603.627692, 'end_timestamp': 1795692603.628798, 'parent_span_id': 'a8364afb9782b205', 'attributes': {'sentry.origin': 'auto.aws.boto3', 'sentry.trace_lifecycle': 'stream', 'cloud.provider': 'aws', 'rpc.method': 'StartSyncExecution', 'rpc.system.name': 'aws-api', 'sentry.kind': 'client', 'rpc.service': 'SFN', 'cloud.region': 'eu-north-1', 'server.address': 'states.eu-north-1.amazonaws.com', 'server.port': 443, 'aws.step_functions.state_machine.arn': 'arn:aws:states:eu-north-1:123456789012:stateMachine:orders', 'cloud.resource_id': 'arn:aws:states:eu-north-1:123456789012:stateMachine:orders', 'cloud.account.id': '123456789012', 'aws.step_functions.state_machine.name': 'orders', 'sentry.op': 'rpc', 'thread.id': '140570163589568', 'thread.name': 'MainThread', 'aws.step_functions.execution.arn': 'arn:aws:states:eu-north-1:123456789012:execution:orders:order-1234', 'sentry.segment.id': 'a8364afb9782b205', 'sentry.segment.name': 'parent', 'sentry.sdk.name': 'sentry.python', 'sentry.sdk.version': '3.0.0', 'process.runtime.name': 'CPython', 'process.runtime.version': '3.10.12', 'sentry.environment': 'production', 'sentry.release': '107b7a04afa758d73cbdab06e03244e8d970f8dd'}}"
E     
E     '4242' is contained here:
E       {'trace_id': '9ab79db328424218bf08a97e6f2a6881', 'span_id': '8f522feee6105112', 'name': 'SFN.StartSyncExecution', 'status': 'ok', 'is_segment': False, 'start_timestamp': 1795692603.627692, 'end_timestamp': 1795692603.628798, 'parent_span_id': 'a8364afb9782b205', 'attributes': {'sentry.origin': 'auto.aws.boto3', 'sentry.trace_lifecycle': 'stream', 'cloud.provider': 'aws', 'rpc.method': 'StartSyncExecution', 'rpc.system.name': 'aws-api', 'sentry.kind': 'client', 'rpc.service': 'SFN', 'cloud.region': 'eu-north-1', 'server.address': 'states.eu-north-1.amazonaws.com', 'server.port': 443, 'aws.step_functions.state_machine.arn': 'arn:aws:states:eu-north-1:123456789012:stateMachine:orders', 'cloud.resource_id': 'arn:aws:states:eu-north-1:123456789012:stateMachine:orders', 'cloud.account.id': '123456789012', 'aws.step_functions.state_machine.name': 'orders', 'sentry.op': 'rpc', 'thread.id': '140570163589568', 'thread.name': 'MainThread', 'aws.step_functions.execution.arn': 'arn:aws:states:eu-north-1:123456789012:execution:orders:order-1234', 'sentry.segment.id': 'a8364afb9782b205', 'sentry.segment.name': 'parent', 'sentry.sdk.name': 'sentry.python', 'sentry.sdk.version': '3.0.0', 'process.runtime.name': 'CPython', 'process.runtime.version': '3.10.12', 'sentry.environment': 'production', 'sentry.release': '107b7a04afa758d73cbdab06e03244e8d970f8dd'}}
E     ?                         ++++

✅ Patch coverage is 97.73% (43 of 44 changed executable lines covered; target 80%).
Project statement coverage is 90.11%.

Changed files with executable lines (4)
File Patch coverage Changed executable lines
sentry_sdk/traces.py 95.45% 21/22 covered; missed: 711; partial branches: 526, 708
sentry_sdk/scope.py 100.00% 8/8 covered; partial branches: 739
sentry_sdk/tracing_utils.py 100.00% 12/12 covered; partial branches: 913
sentry_sdk/logger.py 100.00% 2/2 covered

Generated by Coverage Action

Enforce sentry-conventions attribute names in core tests (conftest, profiler, tracing,
test_attributes, test_logs, test_metrics, test_scope, test_transport).

GH-8322
PY-3089

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant