Commit fe1b5559 authored by Robert Knight's avatar Robert Knight

Record document URL as "extra" metadata rather than a tag

It turns out that Sentry has various contraints on the characters that
can appear in tags as well as their length. For debugging purposes we
want to capture the full document URL unmodified. Therefore capture this
as un-indexed "extra" metadata, which has fewer constraints, rather than
an indexed "tag".
parent 4865ee82
...@@ -50,7 +50,7 @@ function init(config) { ...@@ -50,7 +50,7 @@ function init(config) {
// via `document.referrer`. More information about the document is available // via `document.referrer`. More information about the document is available
// later when frames where the "annotator" code has loaded have connected to // later when frames where the "annotator" code has loaded have connected to
// the sidebar via `postMessage` RPC messages. // the sidebar via `postMessage` RPC messages.
Sentry.setTag('document_url', document.referrer); Sentry.setExtra('document_url', document.referrer);
} }
/** /**
......
...@@ -10,7 +10,7 @@ describe('sidebar/util/sentry', () => { ...@@ -10,7 +10,7 @@ describe('sidebar/util/sentry', () => {
beforeEach(() => { beforeEach(() => {
fakeSentry = { fakeSentry = {
init: sinon.stub(), init: sinon.stub(),
setTag: sinon.stub(), setExtra: sinon.stub(),
setUser: sinon.stub(), setUser: sinon.stub(),
}; };
...@@ -55,7 +55,7 @@ describe('sidebar/util/sentry', () => { ...@@ -55,7 +55,7 @@ describe('sidebar/util/sentry', () => {
it('adds extra context to reports', () => { it('adds extra context to reports', () => {
sentry.init({ dsn: 'test-dsn', environment: 'dev' }); sentry.init({ dsn: 'test-dsn', environment: 'dev' });
assert.calledWith( assert.calledWith(
fakeSentry.setTag, fakeSentry.setExtra,
'document_url', 'document_url',
'https://example.com' 'https://example.com'
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment