π @backstage-community/plugin-analytics-module-newrelic-browser: What is the new relic browser agent version
sharadpattanshetti opened this issue Β· comments
Plugin Name
@backstage-community/plugin-analytics-module-newrelic-browser
π Description
We are using this plugin for the browser analytics. Our app version in New relic points to 1.260 however, this plugin is loading NR browser script version 1.257.
How to verify which version of script does plugin use??
π Expected behavior
We are using this plugin for the browser analytics. Our app version in New relic points to 1.260 however, this plugin is loading NR browser script version 1.257.
How to verify which version of script does plugin use??
π Actual Behavior with Screenshots
Point to which version of script does plugin use?
π Reproduction steps
Configure and deploy plugin with backstage app and check the nr browser agent version in new relic.
π Provide the context for the Bug.
No response
π Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
None
@benjdlambert any idea on this?
We tried to find this few ways (checking the script in the developer tools when backstage app but still find older version of script?
Hi @sharadpattanshetti, I'm not a New Relic user but can try and help. I need more details from you on this though. What does this mean exactly: "Our app version in New relic points to 1.260"
This plugin is using this version:
It should use any version greater then this that is compatible based on the version range (^
)
Can you run yarn why @newrelic/browser-agent
and share the results?
Hi @awanlin,
I meant this info in new relic where it indicates the new relic browser agent app version.
Hi @sharadpattanshetti, sadly that still doesn't help me, again not a New Relic user. Can you share any New Relic documentation that explains this in more details?
No issues @awanlin. Basically when we instrument the New Relic Browser monitoring app from our application using the new relic script or plugin it uses the Browser Interaction script given by New Relic. That script will have certain version of New Relic Browser Interaction. If we directly embed the script in index.html then we know which version of New Relic Browser Interaction it is using. However, through this plugin we are not able to ascertain that.
I am facing another issue with this plugin. I am able to get it working in my local using app-config.local.yaml. However, when same configuration is moved to app-config.override.yaml.tpl
where the configurations are loaded based on environments we have then the feature is not working. We do not see the New Relic payloads in Network tab as in local.
Can you please let me know if the plugin has ability to read config from app-config.override.yaml.tpl
at run time and provide Browser Interaction events in New Relic?
Please let me know if I need to create different issue for this?
Thanks,
Hi @benjdlambert , @freben any help on this will be very useful for us.
Thanks,
No issues @awanlin. Basically when we instrument the New Relic Browser monitoring app from our application using the new relic script or plugin it uses the Browser Interaction script given by New Relic. That script will have certain version of New Relic Browser Interaction. If we directly embed the script in index.html then we know which version of New Relic Browser Interaction it is using. However, through this plugin we are not able to ascertain that.
I am facing another issue with this plugin. I am able to get it working in my local using app-config.local.yaml. However, when same configuration is moved to
app-config.override.yaml.tpl
where the configurations are loaded based on environments we have then the feature is not working. We do not see the New Relic payloads in Network tab as in local. Can you please let me know if the plugin has ability to read config fromapp-config.override.yaml.tpl
at run time and provide Browser Interaction events in New Relic?Please let me know if I need to create different issue for this? Thanks,
Backstage doesn't support any of these *.yaml.tpl
files so I guess this is something you have created by yourself?
Hi @jmezach, as the author of this plugin could you help us out with this, please?
From what I can tell we are not doing anything explicit about which version of the New Relic Browser script we're loading. So I guess that is determined by the @newrelic/browser-agent
package.
Thanks @jmezach that helps.
Reg. *.yaml.tpl
, we do load app-config.override.yaml.tpl
which gets renamed to app-config.override.yaml
at run time and values for the configuration variables (like New Relic App name, license key, trust key etc) are loaded for each environment using the Helm charts.
Issue I am facing is that when I configure new relic values in my app-config.local.yaml
the browser agent works fine. However, when I deploy this to our higher environments where the new relic values are supplied to app-config.override.yaml
as explained above the plugin fails to read them. Looks like it only has the capability to read from app-config.yaml
and not from app-config.override.yaml
file. Note that app-config.override.yaml
file takes precedence when we deploy to higher environments.
This method is working fine for us for all other Backstage plugins (ex. Gitlab, pagerduty for which a different token/keys are loaded for each environment ).
Hope this helps you understand the issue. Please let me know if you still have any questions.
Thanks,
Sharad
This plugin is using the built-in configuration system of Backstage, so nothing special there. If it works for other plugins I can't think of a reason that it wouldn't work for this plugin. Could you share the relevant sections of both the app-config.yaml and app-config.override.yaml? Perhaps that would give us some insights into what is going wrong.
As for the agent version, perhaps we should update the dependency and release a new version of the plugin that uses the latest New Relic Browser agent.
issue I am facing is that when I configure new relic values in my app-config.local.yaml the browser agent works fine. However, when I deploy this to our higher environments where the new relic values are supplied to app-config.override.yaml
are you passing your custom configuration file using the --config
flag as described in https://backstage.io/docs/conf/#supplying-configuration ?
Hi @vinzscam, yes we do use the --config to load the app-config-production.yaml. I am providing below the config set in both the files, please see if this gives any hints:
In app-config.yaml file
app:
title: Developer Portal
baseUrl: http://localhost:3000
analytics:
newRelic:
endpoint: 'bam.nr-data.net'
accountId:
$env: NEWRELIC_ACCOUNT_ID
applicationId:
$env: NEWRELIC_BROWSER_APPLICATION_ID
licenseKey:
$env: NEWRELIC_BROWSER_LICENSE_KEY
agentID:
$env: NEWRELIC_BROWSER_AGENT_ID
distributedTracingEnabled: true
cookiesEnabled: true
useEuEndpoint: false
In app-config.override.yaml.tpl file (I have verified that the actual values are loading on deployment)
app:
baseUrl: {{ .Values.appConfig.app.baseUrl | quote }}
analytics:
newRelic:
endpoint: {{ .Values.appConfig.app.newrelic.endpoint | quote }}
accountId: {{ .Values.appConfig.app.newrelic.accountID | quote }}
applicationId: {{ .Values.appConfig.app.newrelic.applicationID | quote }}
licenseKey: {{ .Values.appConfig.app.newrelic.licenseKey | quote }}
distributedTracingEnabled: true
cookiesEnabled: true
useEuEndpoint: false