-
Notifications
You must be signed in to change notification settings - Fork 0
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
jeffkreeftmeijer
wants to merge
8
commits into
main
Choose a base branch
from
namespace-keys
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
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.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This is a message from the daily scheduled checks. |
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.
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 theAPPSIGNAL_API_KEY
environment variable.Closes #16.