Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
04-27-2018 08:39 PM
My company builds an Atomic SPA JavaScript application, compiled once, deployed for any Environment (DEV, QA, PROD). Because the same piece of code is used for DEV, QA and PROD we cannot have a Static AppKey. We have multiple AppDynamics accounts, one for each environment.
So, how do we configure the SPA JavaScript application at runtime? Simple we call a REST service at a "local" url of : /spa/config and it returns the appropiate configuration for that environment.
Note: We don't want to compile a JS app for every environment, we like having one build that can be deployed anywhere.
So that doesn't work with AppDynamics because you must put the AppKey in the header of your index file.
What I would like to happen:
1. add AppDynamic snippit to index.html header. do all the initial loading and setup but don't transfer any data back to AppDynamic central, just store it.
2. SPA finished loading and calls /spa/config REST service to pull config, including EUM_APP_KEY.
2. Once EUM_APP_KEY is set, start transmitting data, both stored and live.
Is this currently possible? If not, is it possible to update current scripts?
04-30-2018 01:32 AM
Hi Taylor,
Currently we don't support modifying our JS agent files as it can lead to unexpected errrors on the page and can even effect the monitoring as well.
From your use case I can understand that for all your three environments, i.e. Dev, QA and Prod there is a need to get JS agents with different app keys, so instead of doing that at runtime, can you just use the same agent code with different app key as described in our manual injection piece and then see if that works?
https://docs.appdynamics.com/display/PRO44/Manual+Injection+of+the+JavaScript+Agent
You can even customize each JS agent for different environment as mentioned below:
https://docs.appdynamics.com/display/PRO44/Customize+the+JavaScript+Agent
Let us know is this helps.
Thanks,
Deepanshu
04-30-2018 05:17 AM
05-03-2018 09:59 PM
Hi Taylor,
Yes, your understanding is correct and you might miss few metrics if JS agent is not loaded/initialized early on the application page.
Let us know if you have any further queries around this.
Thanks,
Deepanshu
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form