You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried using the built files to host the SPA agent locally with a configuration like the following:
<scripttype="text/javascript">window.NREUM||(NREUM={});NREUM.init={distributed_tracing: {enabled: true,cors_use_newrelic_header: true,cors_use_tracecontext_headers: true,allowed_origins: [/* array of strings of origins, e.g. 'https://example.com', 'https://mydomain' */]},privacy: {cookies_enabled: true}};NREUM.info={licenseKey: "/* my license key */",applicationID: /* my application id */,agent: "https://MY_CDN/nr-spa.js"};</script><scriptsrc="https://MY_CDN/nr-loader-spa.js"></script>
It appears that most of the standard browser monitoring works, but distributed tracing does not.
Steps to Reproduce
clone this project
run npm run build
upload the generated nr-spa.js and nr-spa-loader.js to a CDN, web server, etc.
initialise the agent to use distributed tracing with a set of allowed domains that are also configured to support distributed tracing headers
in a browser app using the generated scripts make XHR requests which should be included in distributed traces
Expected Behavior
AJAX requests are made with tracestate, traceparent and newrelic headers
requests appear in Distributed Tracing
Relevant Logs / Console output
Your Environment
Chome 91.0.4472.101
OS X 11.4
Additional context
The text was updated successfully, but these errors were encountered:
Hey @wrumsby, thanks for all the detail here! You may need to include some additional attributes in NREUM.info for distributed tracing to work. If you add accountId and agentId to that config block, are the headers still not showing up on outgoing requests?
The agent checks these attributes before generating Distributed Tracing headers here:
Hello @aubreymasten, yes it does seem I need to include the following to get distributed tracing to work:
NREUM.loader_config={accountID: /* my account id */,trustKey: /* my account id */,agentID: /* my application id */};
I'll close this issue as this now works for me, but it might be worth including more details about init, info and loader_config in the agent documentation.
Description
I've tried using the built files to host the SPA agent locally with a configuration like the following:
It appears that most of the standard browser monitoring works, but distributed tracing does not.
Steps to Reproduce
npm run build
nr-spa.js
andnr-spa-loader.js
to a CDN, web server, etc.Expected Behavior
Relevant Logs / Console output
Your Environment
Additional context
The text was updated successfully, but these errors were encountered: