Skip to content

Commit 7aee4a6

Browse files
authored
Merge pull request #637 from neo4j-labs/fix/sentryOnServed
Sentry on served
2 parents 735f37d + 1a4bb4b commit 7aee4a6

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

src/extensions/query-translator/clients/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const reportExampleQueries = {
7474
'Single Value': 'MATCH (n) RETURN COUNT(n)',
7575
'Gauge Chart': 'MATCH (c:CPU) WHERE c.id = 1 RETURN c.load_percentage * 100',
7676
'Raw JSON': 'MATCH (n) RETURN COUNT(n)',
77-
'Pie Chart': 'Match (n:Person)-[e]->(m:Movie) RETURN m.title as Title, COUNT(p) as People LIMIT 10',
77+
'Pie Chart': 'Match (p:Person)-[e]->(m:Movie) RETURN m.title as Title, COUNT(p) as People LIMIT 10',
7878
};
7979

8080
export const TASK_DEFINITION = `Task: Generate Cypher queries to query a Neo4j graph database based on the provided schema definition. These queries will be used inside NeoDash reports.

src/index.tsx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@ import './index.pcss';
1111
import StyleConfig from './config/StyleConfig';
1212
import * as Sentry from '@sentry/react';
1313

14-
Sentry.init({
15-
dsn: 'https://[email protected]/4505397810167808',
16-
integrations: [
17-
new Sentry.BrowserTracing({
18-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
19-
tracePropagationTargets: [/^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
20-
}),
21-
new Sentry.Replay(),
22-
],
23-
// Performance Monitoring
24-
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
25-
// Session Replay
26-
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
27-
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
28-
});
29-
14+
if (window.location.href == 'https://neodash.graphapp.io/' || window.location.href == 'http://neodash.graphapp.io/') {
15+
Sentry.init({
16+
dsn: 'https://[email protected]/4505397810167808',
17+
allowUrls: [/^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
18+
integrations: [
19+
new Sentry.BrowserTracing({
20+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
21+
tracePropagationTargets: [/^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
22+
}),
23+
new Sentry.Replay({
24+
networkDetailAllowUrls: [/^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
25+
}),
26+
],
27+
// Performance Monitoring
28+
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
29+
// Session Replay
30+
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
31+
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
32+
});
33+
}
3034
/**
3135
* Set up the NeoDash application and wrap it in the needed providers.
3236
*/

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = (env) => {
5656
},
5757
entry: ['./src/index.tsx'],
5858
mode: production ? 'production' : 'development',
59-
devtool: production ? undefined : 'eval-cheap-module-source-map',
59+
devtool: production ? 'source-map' : 'eval-cheap-module-source-map',
6060
module: {
6161
rules: rules,
6262
},

0 commit comments

Comments
 (0)