Skip to content

Commit

Permalink
update for apm rum agent
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmj8537 committed Dec 9, 2022
1 parent cd3eb59 commit f67c472
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"request": "2.88.2",
"sharp": "0.31.2",
"tileserver-gl-styles": "2.0.0",
"elastic-apm-node": "3.40.1",
"@elastic/apm-rum": "5.12.0",
"sanitize-filename": "1.6.3"
},
"devDependencies": {
Expand Down
10 changes: 10 additions & 0 deletions public/templates/data.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
{{/is_vector}}
<script src="/elastic-apm-rum.umd.min.js" ></script>
<script>
elasticApm.init({
serviceName: 'RBT-TileserverGL',
serverUrl: 'http://10.232.234.20:8200',
serviceVersion: '5.2.0',
logLevel: 'info',
breakdownMetrics: 'true'
})
</script>
</head>
<body>
{{#is_vector}}
Expand Down
12 changes: 11 additions & 1 deletion public/templates/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
return false;
}
</script>
<script src="/elastic-apm-rum.umd.min.js" ></script>
<script>
elasticApm.init({
serviceName: 'RBT-TileserverGL',
serverUrl: 'http://10.232.234.20:8200',
serviceVersion: '5.2.0',
logLevel: 'info',
breakdownMetrics: 'true'
})
</script>
</head>
<body>
<section>
Expand Down Expand Up @@ -109,4 +119,4 @@
</p>
</footer>
</body>
</html>
</html>
10 changes: 10 additions & 0 deletions public/templates/viewer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
<script src="/elastic-apm-rum.umd.min.js" ></script>
<script>
elasticApm.init({
serviceName: 'RBT-TileserverGL',
serverUrl: 'http://10.232.234.20:8200',
serviceVersion: '5.2.0',
logLevel: 'info',
breakdownMetrics: 'true'
})
</script>
</head>
<body>
<h1 style="display:none;">{{name}}</h1>
Expand Down
19 changes: 0 additions & 19 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
#!/usr/bin/env node

'use strict';
const apmUrl = process.env.APM_URL
import { init as initApm } from '@elastic/apm-rum'
const rum = initApm({
serviceName: 'RBT-TileserverGL',
serverUrl: '${apmUrl}',
serviceVersion: '5.2.0',
breakdownMetrics: true,
logLevel: 'debug'
})
import elasticapm from 'elastic-apm-node';
const apm = elasticapm.start({
serviceName: 'RBT-TileserverGL',
serverUrl: '${apmUrl}',
serviceVersion: '5.2.0',
captureBody: 'all',
errorOnAbortedRequests: true,
logLevel: 'debug',
logUncaughtExceptions: true
})
import fs from 'node:fs';
import path from 'path';
import { fileURLToPath } from 'url';
Expand Down
1 change: 1 addition & 0 deletions src/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node

'use strict';

import os from 'os';
Expand Down

0 comments on commit f67c472

Please sign in to comment.