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

Report to different AppSignal apps using namespaces #17

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jeffkreeftmeijer
Copy link
Member

This is a work-in-progress patch to test support for reporting to multiple apps through using Kubernetes namespaces. By setting the APPSIGNAL_NAMESPACE_API_KEY_MAP environment variable to hold a frontend key per namespace (namespace1=123abc,namespace2=abc123), any node metrics for that specific namespace get posted to a different app in AppSignal. All non-node metrics, as well as metrics for namespaces not listed in the new environment variable, are pushed to the default app configured through the APPSIGNAL_API_KEY environment variable.

Closes #16.

To allow for different API keys per namespace, we can't memoize the
metrics URL like we did before. In preparation for this, this patch
moves the call to must_metrics_url_from_env to evaluate just in time.
In preparation of namespaced data, replace the existing HashSet with a
HashMap, which will hold a key per namespace. For now, place all data
under the "default" namespace. Then, loop over each namespace in the
out variable when sending metrics to AppSignal, and send all matrics
for one namespace as one request.
Update the must_metrics_url_from_env function to take a namespace as
an argument, in preparation for having multiple API keys. For now,
always return the URL with the default API key.
To allow for selecting a different key for a different namespace, this
patch adds another environment variable that has a list namespaces and
API keys. If one matches, api_key_for_namespace returns the associated
key instead of the default.
Instead of hardcoding the namespace to "default", use the pod's actual
namespace when looking up the metric URL.
In the deployment, get the value from the namespace-api-key-map secret
and configure it as the APPSIGNAL_NAMESPACE_API_KEY_MAP.
To allow for testing the namespaced API keys, suffix the version
number so an image can be pushed without having to do a proper release.
This is a branch separate from the rest of the integration, so any
releases shouldn't be tagged as latest.
@backlog-helper

This comment has been minimized.

1 similar comment
@backlog-helper
Copy link

backlog-helper bot commented Dec 2, 2024

  • This Pull Request has not had any activity in 14 days. Please provide a status update if it is still relevant. Closed it if it is no longer relevant. Or move it to another column if it's blocked or requires another look at it. - (More info)

This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report data to multiple apps
1 participant