Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Django 5 Collector app #256

Merged
merged 10 commits into from
Feb 6, 2025
Merged

Add Django 5 Collector app #256

merged 10 commits into from
Feb 6, 2025

Conversation

jeffkreeftmeijer
Copy link
Member

Aside from the existing OpenTelemetry apps, add one that uses the new collector. This app is a copy of the django5-celery-opentelemetry app with the appsignal-collector added to the compose instead of appsignal-agent.

There are three things to keep in mind:

  1. This test app reports to staging, and has the PUSH_API_ENDPOINT set in its compose file, because the collector only works on staging right now. This should be removed after the required changes are deployed to production.

  2. Since the collector uses a PUSH_API_KEY environment variable as opposed to the APPSIGNAL_PUSH_API_KEY used previously, this PR adds the former to the appsignal_key.env template file in c65d0d4 with the same value as the APPSIGNAL_PUSH_API_KEY. Regenerating the file before starting the collector properly sets the key.

  3. The now-required "appsignal.config.revision" configuration option is set to a static value. Although there was an commented-out implementation to determine the revision, that didn't work as the git repository isn't copied to the Docker container.

Copy django5-celery-opentelemetry and update the application name in
docker-compose.yml
The collector uses PUSH_API_KEY instead of the previously used
APPSIGNAL_PUSH_API_KEY. To remedy that in the current setup, add a
line to the appsignal_key.env.rb template file that sets that in
addition to the APPSIGNAL_PUSH_API_KEY environment variable.
Use appsignal-collector instead of appsignal-agent in
django5-celery-collector. Also set the PUSH_API_ENDPOINT to push to
staging, as the required logic for the collector hasn't been deployed
to production just yet.
Update the configuration in django5-celery-collector to use the
colelctor endpoint instead of the agent one, in both settings.py and
tasks.py:

1. Update the configuration to adhere to the changes that have been
   made in the configuration names:

  "appsignal.config.app_name" -> "appsignal.config.name"
  "appsignal.config.app_environment" -> "appsignal.config.environment"

2. Set the "appsignal.config.revision" configuration option to a
   static value. Although there was an commented-out implementation to
   determine the revision, that didn't work as the git repository
   isn't copied to the Docker container. For now, set the revision to
   a static value of "test-setups".

3. Set the "host.name" configuration option to the result of
   socket.gethostname().
@backlog-helper

This comment has been minimized.

1 similar comment
@backlog-helper
Copy link


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

jeffkreeftmeijer and others added 6 commits January 29, 2025 14:54
Make testing of metrics possible by setting up an metrics exporter and
sending the types of metrics we support.

I copied the exporter config from our Python package.
Debug logs help with debugging the collector's behavior.
The collector data can now be received by production, so let's remove
the staging config. If you do want to push to staging, set these env
vars in the `appsignal_key.env` file in the root of the project.
Make sure we test if the apps actually works.
@tombruijn tombruijn force-pushed the django5-celery-collector branch from d3f376d to e886e40 Compare February 6, 2025 13:54
@tombruijn tombruijn merged commit 311db45 into main Feb 6, 2025
1 check passed
@tombruijn tombruijn deleted the django5-celery-collector branch February 6, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants