You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core agent code lives in `elasticapm/`, with feature areas split into packages such as `contrib/`, `instrumentation/`, `transport/`, `metrics/`, and `utils/`. Tests live under `tests/` and are grouped by subsystem, for example `tests/instrumentation/`, `tests/contrib/`, and `tests/config/`. Test-only helpers and dependency sets are in `tests/fixtures.py`, `tests/requirements/`, and `tests/scripts/`. CI matrix files are under `.ci/`, and end-user documentation is in `docs/`.
5
+
6
+
## Build, Test, and Development Commands
7
+
Use the repo `Makefile` for the standard workflow:
8
+
9
+
-`make test`: clears Python caches, then runs `pytest -v --showlocals`.
10
+
-`make coverage`: runs the test suite with branch coverage enabled.
11
+
-`make flake8`: runs lint checks.
12
+
-`make isort`: sorts imports across the repository.
13
+
-`make docs`: builds docs from `docs/` into `build/`.
14
+
15
+
For local setup, install the dependency set relevant to your area first, for example `pip install -r tests/requirements/reqs-flask-1.1.txt`. Install hooks with `pre-commit install`.
16
+
17
+
## Coding Style & Naming Conventions
18
+
Python uses 4-space indentation, LF line endings, and UTF-8 per `.editorconfig`; YAML and `.feature` files use 2 spaces. Format with `black` and keep lines at 120 characters. Keep imports ordered with `isort`, then run `flake8`. Module and function names use `snake_case`; classes use `PascalCase`. Follow existing test file patterns such as `*_tests.py` and `test_*.py`.
19
+
20
+
## Testing Guidelines
21
+
Pytest is the test runner, with random ordering enabled by default. Favor focused runs while developing, for example `pytest tests/instrumentation/httpx_tests.py -m httpx`. Mark integration-heavy cases with the existing pytest markers from `setup.cfg`, and use `pytest.importorskip()` for optional dependencies. Add new dependency-specific requirements in `tests/requirements/` and matching environment scripts in `tests/scripts/envs/` when expanding the matrix.
22
+
23
+
## Commit & Pull Request Guidelines
24
+
Recent history follows concise, Conventional Commit-style subjects such as `fix: ...` and `build(deps): ...`; keep commit messages short and scoped. Open PRs against `main`, link the related issue (`Closes #123`), summarize behavior changes, and note any test coverage added. Expect maintainers to squash-merge, so keep branch history clean and rebased.
Spans shorter than this threshold can be ignored. This applies to successful spans in general.
622
+
623
+
For leaf/exit spans, [`exit_span_min_duration`](#config-exit-span-min-duration) takes precedence when it is configured.
624
+
625
+
This feature is disabled by default.
626
+
627
+
::::{note}
628
+
If a span propagates distributed tracing IDs, it will not be ignored, even if it is shorter than the configured threshold. This is to ensure that no broken traces are recorded.
629
+
::::
630
+
613
631
614
632
### `api_request_size`[config-api-request-size]
615
633
@@ -1086,4 +1104,3 @@ The *size* format is used for options like maximum buffer sizes. The unit is pro
1086
1104
We use the power-of-two sizing convention, e.g. `1 kilobyte == 1024 bytes`
Copy file name to clipboardExpand all lines: docs/reference/performance-tuning.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,8 @@ The average amount of spans per transaction can influence how much time the agen
60
60
61
61
To avoid these edge cases overloading both the agent and the APM Server, the agent stops recording spans when a specified limit is reached. You can configure this limit by changing the [`transaction_max_spans`](/reference/configuration.md#config-transaction-max-spans) setting.
62
62
63
+
You can also ignore very short spans by configuring [`span_min_duration`](/reference/configuration.md#config-span-min-duration). If you only want to target leaf/exit spans, use [`exit_span_min_duration`](/reference/configuration.md#config-exit-span-min-duration).
@@ -89,4 +91,3 @@ Reading source files inside a running application can cause a lot of disk I/O, a
89
91
You can configure the Elastic APM agent to capture headers of both requests and responses ([`capture_headers`](/reference/configuration.md#config-capture-headers)), as well as request bodies ([`capture_body`](/reference/configuration.md#config-capture-body)). By default, capturing request bodies is disabled. Enabling it for transactions may introduce noticeable overhead, as well as increased storage use, depending on the nature of your POST requests. In most scenarios, we advise against enabling request body capturing for transactions, and only enable it if necessary for errors.
90
92
91
93
Capturing request/response headers has less overhead on the agent, but can have an impact on storage use. If storage use is a problem for you, it might be worth disabling.
0 commit comments