Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
fix(handlers.js): handle env vars correctly (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranrib committed Mar 24, 2021
1 parent c2e733d commit 1cc7cf2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ const WRAPPER_CODE = ({
}) => {
const commonNode = `
if (!process.env.EPSAGON_IGNORED_KEYS) {
process.env.EPSAGON_IGNORED_KEYS = "${ignoredKeys || ''}";
}
if (!process.env.EPSAGON_URLS_TO_IGNORE) {
process.env.EPSAGON_URLS_TO_IGNORE = "${urlsToIgnore || ''}";
}
epsagon.init({
token: '${token}',
appName: '${appName}',
traceCollectorURL: ${collectorUrl},
metadataOnly: Boolean(${metadataOnly}),
labels: ${labels || '[]'},
urlPatternsToIgnore: ${urlsToIgnore ? "['".concat(urlsToIgnore.replace(',', "', '")).concat("']") : '[]'},
ignoredKeys: ${ignoredKeys ? "['".concat(ignoredKeys.replace(',', "', '")).concat("']") : '[]'},
});`;

return ({
Expand Down

0 comments on commit 1cc7cf2

Please sign in to comment.