Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
strategy:
matrix:
os: [ ubuntu-22.04 ]
python: ["3.10"]
python: ["3.14"]
manylinux_image: [ manylinux2014, manylinux_2_28 ]
# Disable for platforms where pure Python wheels would be generated
cibw_skip: [ "pp38-* pp39-* pp310-* pp311-* pp312-* pp313-*" ]
cibw_skip: [ "pp38-* pp39-* pp310-* pp311-*" ]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.10"
python-version: "3.14"

- name: Install cibuildwheel
run: |
Expand All @@ -83,22 +83,22 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
python: ["3.10"]
python: ["3.14"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python }}
- name: Install packaging tools
- name: Install build
run: |
python -m pip install --upgrade pip setuptools importlib_metadata wheel
python -m pip install --upgrade pip build

- name: Build Python pure Python wheel
env:
SCOUT_DISABLE_EXTENSIONS: "1"
run: python setup.py bdist_wheel
run: python -m build --wheel

- uses: actions/upload-artifact@v4
with:
Expand All @@ -114,10 +114,14 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.10"
python-version: "3.14"

- name: Install build
run: |
python -m pip install --upgrade pip build

- name: Build sdist
run: python setup.py sdist
run: python -m build --sdist

- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## Pending
### Fixed
- Attach `transaction_id` to error context to support querying for matching logs in errors service.

## [3.5.0] 2025-10-31
### Added
Expand Down
86 changes: 78 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,86 @@
[tool.poetry]
name="scout_apm_python"
description = "Scout APM Python Agent"
readme = "README.md"
version = "0.1.0"
authors = ["Developers <dev@scoutapm.com>"]

[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "scout_apm"
version = "3.5.0"
description = "Scout Application Performance Monitoring Agent"
readme = "README.md"
license = "MIT"
authors = [
{ name = "Scout", email = "support@scoutapm.com" }
]
requires-python = ">=3.8, <4"
keywords = ["apm", "performance monitoring", "development"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Bottle",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Flask",
"Intended Audience :: Developers",
"Topic :: System :: Monitoring",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"asgiref",
"psutil>=5",
"urllib3",
"certifi",
"wrapt>=1.10,<2.0",
]

[project.urls]
Homepage = "https://github.com/scoutapp/scout_apm_python"
Documentation = "https://docs.scoutapm.com/#python-agent"
Changelog = "https://github.com/scoutapp/scout_apm_python/blob/master/CHANGELOG.md"

[project.scripts]
core-agent-manager = "scout_apm.core.cli.core_agent_manager:main"

[tool.setuptools]
zip-safe = false
package-dir = { "" = "src" }
ext-modules = [
{ name = "scout_apm.core._objtrace", sources = ["src/scout_apm/core/_objtrace.c"], optional = true }
]

[tool.setuptools.packages.find]
where = ["src"]

[tool.black]
target-version = ["py311"]

[tool.isort]
profile = "black"

[tool.check-manifest]
ignore = [
".python-version",
"CHANGELOG.md",
"ci*",
"pytest.ini",
"tests*",
"tox.ini",
]

[tool.coverage.run]
branch = true

[tool.flake8]
max-line-length = 80
select = ["C", "E", "F", "W", "B", "B950", "I", "T", "YTT"]
ignore = ["E203", "E501", "W503"]
accept-encodings = "utf-8"
ban-relative-imports = true
22 changes: 0 additions & 22 deletions setup.cfg

This file was deleted.

89 changes: 0 additions & 89 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions src/scout_apm/core/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def send(

context = {}
context.update(tracked_request.tags)
context["transaction_id"] = tracked_request.request_id

if custom_params:
context["custom_params"] = custom_params
Expand Down
14 changes: 9 additions & 5 deletions tests/unit/core/test_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_monitor_ignore_exceptions(error_monitor_errors):
"request_session": None,
"environment": None,
"request_components": None,
"context": {"spam": "foo"},
"context": {"spam": "foo", "transaction_id": "sample_id"},
"host": None,
"revision_sha": "",
},
Expand All @@ -101,7 +101,7 @@ def test_monitor_ignore_exceptions(error_monitor_errors):
"controller": "test-controller",
"action": None,
},
"context": {"spam": "foo"},
"context": {"spam": "foo", "transaction_id": "sample_id"},
"host": None,
"revision_sha": "",
},
Expand All @@ -128,7 +128,7 @@ def test_monitor_ignore_exceptions(error_monitor_errors):
"controller": "DataView",
"action": "detail",
},
"context": {"spam": "foo"},
"context": {"spam": "foo", "transaction_id": "sample_id"},
"host": None,
"revision_sha": "",
},
Expand All @@ -155,7 +155,11 @@ def test_monitor_ignore_exceptions(error_monitor_errors):
"controller": "test-controller",
"action": "detail",
},
"context": {"spam": "foo", "custom_params": {"baz": 3}},
"context": {
"spam": "foo",
"transaction_id": "sample_id",
"custom_params": {"baz": 3},
},
"host": None,
"revision_sha": "",
},
Expand Down Expand Up @@ -247,7 +251,7 @@ def test_monitor_with_logged_payload(
assert "ZeroDivisionError" in actual_message
assert "division by zero" in actual_message
assert (
"tests/unit/core/test_error.py:227:in test_monitor_with_logged_payload"
"tests/unit/core/test_error.py:231:in test_monitor_with_logged_payload"
in actual_message
)
assert "sample.app" in actual_message
Expand Down
Loading