Add agent/collector mode toggle to test setups - #368
Merged
Conversation
Test setups can now be run in either "agent mode" (the native integration, the default) or "collector mode" (the integration sends data to AppSignal through a local AppSignal collector over OpenTelemetry), selected with a `mode=` parameter. A setup supports collector mode when it ships a `docker-compose.collector.yml`; asking for an unsupported mode errors, and the chosen mode is printed at the start of the command output. The shared AppSignal collector service lives in support/collector so per-app collector files can include it. Also fix the README bot-app detection, which matched an inline service that is now pulled in via an include, so regeneration is faithful again.
Convert ruby/grape, ruby/rack, ruby/rails7-postgres, ruby/rails8-sidekiq and python/django5-celery to the agent/collector toggle. Each is split into a shared compose file plus per-mode files: the agent file keeps the existing app name, the collector file adds the AppSignal collector, points the integration at it, and reports under a `-collector` app name so the two modes stay separate in AppSignal. The Ruby apps gain the optional OpenTelemetry gems collector mode needs; they are only loaded when collector mode is active. This is the first batch; the remaining Ruby 3.1+ and Python agent setups can adopt the same pattern later.
The django5-celery setup now supports collector mode through the mode toggle, so the separate integration-collector setup is no longer needed. Its only app-level difference, a /logs endpoint that emits log messages, is folded into django5-celery.
These setups wire up an OpenTelemetry stack by hand to send data to AppSignal through the collector. Now that integrations can do this themselves in collector mode, "-collector" is ambiguous: rename them to "-opentelemetry" to distinguish the manual setups from the integration's collector mode. Renames the directories and updates the app names, image names and test labels. The collector service and its host name are unchanged.
Roll the agent/collector toggle out to the remaining Ruby 3.1+ agent setups, following the pattern already used for the initial subset: a shared compose file per app, included by the agent and collector files, with a mode-aware app name and the OpenTelemetry gems needed for collector mode.
Apply the same agent/collector toggle to the remaining Python agent setups. Python needs no dependency changes; collector mode is enabled purely by the collector compose file and the mode-aware app name.
|
✔️ All good! |
The rename of the manual-OpenTelemetry setups missed the hardcoded app matrix in the CI workflow, leaving it pointed at directories that no longer exist. Point the 13 entries at their new -opentelemetry paths so they are tested again.
unflxw
marked this pull request as draft
June 12, 2026 15:15
The shared-file compose layout includes a per-app shared file and then overrides the app service in the agent/collector files. The Docker Compose bundled with the ubuntu-22.04 runner rejects this with "services.app conflicts with imported resource"; newer Compose accepts it. Install a current Compose in each test job so the toggle works in CI.
A mode is now any docker-compose.<mode>.yml file, instead of a hard-coded agent/collector pair. A plain docker-compose.yml (or docker-compose.default.yml) is the "default" mode; with no mode= the default is used, falling back to agent, else an error listing the available modes. The shared file is reserved and never selectable. Dual-mode setups have their docker-compose.yml renamed to docker-compose.agent.yml so they resolve to agent implicitly. The exec-based tasks (bash, console, diagnose, etc.) now pass -f, since those setups no longer have a plain compose file to auto-discover.
unflxw
marked this pull request as ready for review
June 18, 2026 06:59
This comment has been minimized.
This comment has been minimized.
11 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is a message from the daily scheduled checks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of appsignal/appsignal-ruby#1515.
AppSignal integrations are gaining a "collector mode", in which the
integration sets up OpenTelemetry itself and ships data to AppSignal
through a local AppSignal collector. Rather than copying each setup with
a suffix, this makes a single setup toggle-able between "agent mode" (the
default) and "collector mode" with a
mode=parameter.It wires up the toggle, converts a representative subset to prove it out,
removes the now-redundant
-integration-collectorsetup, renames themanual-OpenTelemetry
-collectorsetups to-opentelemetryto avoidambiguity, and then rolls the toggle out to the rest of the Ruby 3.1+ and
Python agent setups.
Add agent/collector mode toggle to rake tasks
Test setups can now be run in either "agent mode" (the native
integration, the default) or "collector mode" (the integration sends
data to AppSignal through a local AppSignal collector over
OpenTelemetry), selected with a
mode=parameter.A setup supports collector mode when it ships a
docker-compose.collector.yml; asking for an unsupported mode errors,and the chosen mode is printed at the start of the command output. The
shared AppSignal collector service lives in support/collector so per-app
collector files can include it.
Also fix the README bot-app detection, which matched an inline service
that is now pulled in via an include, so regeneration is faithful again.
Add collector mode to a representative set of setups
Convert ruby/grape, ruby/rack, ruby/rails7-postgres, ruby/rails8-sidekiq
and python/django5-celery to the agent/collector toggle. Each is split
into a shared compose file plus per-mode files: the agent file keeps the
existing app name, the collector file adds the AppSignal collector,
points the integration at it, and reports under a
-collectorapp nameso the two modes stay separate in AppSignal.
The Ruby apps gain the optional OpenTelemetry gems collector mode needs;
they are only loaded when collector mode is active.
Remove redundant django5-celery-integration-collector
The django5-celery setup now supports collector mode through the mode
toggle, so the separate integration-collector setup is no longer needed.
Its only app-level difference, a /logs endpoint that emits log messages,
is folded into django5-celery.
Rename -collector setups to -opentelemetry
These setups wire up an OpenTelemetry stack by hand to send data to
AppSignal through the collector. Now that integrations can do this
themselves in collector mode, "-collector" is ambiguous: rename them to
"-opentelemetry" to distinguish the manual setups from the integration's
collector mode.
Renames the directories and updates the app names, image names and test
labels. The collector service and its host name are unchanged.
Add collector mode to Ruby 3.1+ agent setups
Roll the agent/collector toggle out to the remaining Ruby 3.1+ agent
setups, following the pattern already used for the initial subset: a
shared compose file per app, included by the agent and collector files,
with a mode-aware app name and the OpenTelemetry gems needed for
collector mode.
Add collector mode to Python agent setups
Apply the same agent/collector toggle to the remaining Python agent
setups. Python needs no dependency changes; collector mode is enabled
purely by the collector compose file and the mode-aware app name.