Skip to content

Send app_path and ignore_logs to the collector - #276

Merged
unflxw merged 3 commits into
mainfrom
send-app-path-and-ignore-logs
Aug 27, 2026
Merged

Send app_path and ignore_logs to the collector#276
unflxw merged 3 commits into
mainfrom
send-app-path-and-ignore-logs

Conversation

@unflxw

@unflxw unflxw commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #273.
Fixes #275.

Send the app path to the collector

The processor strips the app path from each backtrace line, and decides
whether a frame belongs to the application by checking that its path is
relative. Without the app path, every frame keeps its absolute path, so
no line is recognized as the application's own.

Add the ignore_logs option

Collector mode sends log records, and the collector filters out the ones
matching this option when the resource carries it. The package had no
option for it because agent mode sends no logs at all, which is also why
it is not passed on to the agent.

The option is documented in https://github.com/appsignal/appsignal-docs/pull/192,
including that it only has an effect in collector mode.

@backlog-helper

backlog-helper Bot commented Aug 25, 2026

Copy link
Copy Markdown

鉁旓笍 All good!

New issue guide | Backlog management | Rules | Feedback

Comment thread .changesets/add-the-ignore-logs-option.md Outdated
Comment thread .changesets/send-the-app-path-to-the-collector.md Outdated
@unflxw
unflxw force-pushed the send-app-path-and-ignore-logs branch from b5dda91 to 754e0d3 Compare August 25, 2026 16:08
The processor strips the app path from each backtrace line, and decides
whether a frame belongs to the application by checking that its path is
relative. Without the app path, every frame keeps its absolute path, so
no line is recognized as the application's own.
@unflxw
unflxw force-pushed the send-app-path-and-ignore-logs branch from 754e0d3 to bb004b7 Compare August 25, 2026 16:17
@unflxw unflxw added the bug Confirmed and unconfirmed bugs reported by us and customers. label Aug 25, 2026
@unflxw
unflxw requested a lite review from Copilot August 25, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the AppSignal Python integration鈥檚 OpenTelemetry resource attributes so the collector receives (1) the application root path needed for correct backtrace parsing and (2) the new ignore_logs configuration for log filtering in collector mode.

Changes:

  • Add appsignal.config.app_path to the OpenTelemetry Resource so the collector/processor can correctly relativize and classify backtrace frames.
  • Add ignore_logs configuration (env + options) and send it as appsignal.config.ignore_logs in the OpenTelemetry Resource.
  • Extend config/resource tests and add changesets documenting both changes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_config.py Extends env/config parsing assertions and validates new OTel resource attributes (app_path, ignore_logs).
src/appsignal/opentelemetry.py Adds app_path and ignore_logs to the OTel Resource attributes sent to the collector.
src/appsignal/config.py Adds the ignore_logs option to config typing and loads it from APPSIGNAL_IGNORE_LOGS.
.changesets/send-the-app-path-to-the-collector.md Documents the backtrace/app-frame fix in collector mode (patch).
.changesets/add-the-ignore-logs-option.md Documents the new ignore_logs option and its collector-mode-only behavior (minor).

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/appsignal/config.py
Collector mode sends log records, and the collector filters out the ones
matching this option when the resource carries it. The package had no
option for it because agent mode sends no logs at all, which is also why
it is not passed on to the agent.
@unflxw
unflxw force-pushed the send-app-path-and-ignore-logs branch from bb004b7 to 723fc30 Compare August 25, 2026 16:30
@unflxw
unflxw requested a lite review from Copilot August 25, 2026 16:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/appsignal/config.py
Comment thread .changesets/add-the-ignore-logs-option.md
@unflxw
unflxw marked this pull request as ready for review August 25, 2026 18:48
@unflxw
unflxw requested a review from lipskis August 25, 2026 18:48
* Detect the revision from the platform

The agent reads these same variables, but only for the data it reports
itself. In collector mode the package puts the revision in a resource
attribute instead, and the collector cannot read it from the
environment, because it runs as its own process and usually on another
host.

* Prefer the dyno name for the hostname

The agent falls back to the dyno name when it detects the hostname, but
the package's value reaches it first as _APPSIGNAL_HOSTNAME, so that
step never ran. In collector mode there is nothing to fall back on at
all, because the collector runs as its own process and usually on
another host.

* Detect the platform and send it

The agent detects the platform the same way, but only for the data it
reports itself. In collector mode the package has to put it in a
resource attribute, and the collector cannot detect it, because
DOKKU_ROOT and DYNO are set in the application's environment while the
collector runs as its own process, usually on another host.

There is no config option for the platform. The detected value reaches
the agent through the private environment variable that its own
detection already reads first.

* Keep detected values when an option is None

The options passed to the client merge last, so a None among them
replaces what the system source detected: the app path, the hostname,
the revision and the platform. A None carries no value, so it now leaves
those alone. It still overrides a default, which is how
`request_headers=None` turns off request header collection.

The unreleased changeset for reporting `unknown` when the host name is
set to `None` goes with it, because that case now reports the detected
host name instead.
@unflxw
unflxw merged commit 6d1c01e into main Aug 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Confirmed and unconfirmed bugs reported by us and customers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the ignore_logs option now that collector mode sends logs Send app_path as a resource attribute in collector mode

3 participants