diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index d8bfe2e9fd7..9c86aea99a6 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -57,6 +57,11 @@ jobs: -DskipTests=true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: DataDog sourcemap upload + run: npx --package=@datadog/datadog-ci datadog-ci sourcemaps upload tools/cldr-apps/src/main/webapp/dist/ --minified-path-prefix=/cldr-apps/dist/ --release-version=r${{ github.event.inputs.git-ref }} --service=surveytool + env: + DATADOG_SITE: ${{ secrets.DATADOG_SITE }} + DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} - name: Build liberty server run: > mvn -s .github/workflows/mvn-settings.xml -B -pl cldr-apps liberty:create liberty:deploy liberty:package -Dinclude=usr --file tools/pom.xml diff --git a/tools/cldr-apps/js/src/index.js b/tools/cldr-apps/js/src/index.js index 498ec85015c..45eb723441b 100644 --- a/tools/cldr-apps/js/src/index.js +++ b/tools/cldr-apps/js/src/index.js @@ -29,8 +29,7 @@ if (window.dataDogClientToken) { site: "us5.datadoghq.com", service: "surveytool", env: window.dataDogEnv, - // Specify a version number to identify the deployed version of your application in Datadog - // version: '1.0.0', + version: "r" + window.dataDogSha, sessionSampleRate: 100, sessionReplaySampleRate: 20, trackUserInteractions: true, diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java index b86d1f1de8d..53ff7b3ce60 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java @@ -222,6 +222,7 @@ private void includeCss(HttpServletRequest request, PrintWriter out) { private static final String DD_CLIENT_TOKEN = System.getenv("DD_CLIENT_TOKEN"); private static final String DD_CLIENT_APPID = System.getenv("DD_CLIENT_APPID"); + private static final String DD_GIT_COMMIT_SHA = System.getenv("DD_GIT_COMMIT_SHA"); private static final String DD_ENV = System.getProperty("dd.env", ""); /** if DD_CLIENT_TOKEN is set, set these variables so index.js can pick them up. */ @@ -233,8 +234,9 @@ public static void includeDatadog(Writer out) throws IOException { + "window.dataDogClientToken='%s';\n" + "window.dataDogAppId='%s';\n" + "window.dataDogEnv='%s';\n" + + "window.dataDogSha='%s';\n" + "\n", - DD_CLIENT_TOKEN, DD_CLIENT_APPID, DD_ENV)); + DD_CLIENT_TOKEN, DD_CLIENT_APPID, DD_ENV, DD_GIT_COMMIT_SHA)); } else { out.write("\n"); }