Skip to content

Commit

Permalink
CLDR-17699 DataDog in Ansible (#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 authored Jun 11, 2024
1 parent c5c2381 commit 678fda9
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ jobs:
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: DataDog sourcemap upload
# only on push to main!
if: github.repository == 'unicode-org/cldr' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.inputs.git-ref == ''
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: Checkout CLDR archive
run: >
mkdir -v ../cldr-archive && java -jar tools/cldr-code/target/cldr-code.jar checkout-archive
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,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
Expand Down
8 changes: 8 additions & 0 deletions tools/scripts/ansible/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
cldr-smoke.unicode.org
cldr-staging.unicode.org

[staging:vars]
# dd_env is the DataDog environment, staging vs prod
dd_env=staging

[prod]
st.unicode.org

[prod:vars]
# dd_env is the DataDog environment, staging vs prod
dd_env=prod

# CLDR Commit Checker web hosting here
[ccc]
cldr-smoke.unicode.org
Expand Down
21 changes: 15 additions & 6 deletions tools/scripts/ansible/monitoring-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
- hosts: cldr-staging.unicode.org
- hosts:
- cldr-staging.unicode.org
- st.unicode.org
become: yes
vars_files:
- vars/main.yml
- local-vars/local.yml
tasks:
- name: Import the Datadog Agent role from the Datadog collection
import_role:
name: datadog.dd.agent
roles:
- { role: datadog.datadog, become: yes }
vars:
datadog_api_key: "{{ dd_key }}"
datadog_site: "{{ dd_site }}"
datadog_apm_instrumentation_enabled: "host" # docker not installed else 'all'

tasks:
- name: Update datadog.yaml for apm/env
blockinfile:
path: /etc/datadog-agent/datadog.yaml
block: |
# enable apm and set the env
enabled: true
env: {{ dd_env }}
marker: '# {mark} ANSIBLE MANAGED BLOCK'
insertafter: '^apm_config:'
2 changes: 1 addition & 1 deletion tools/scripts/ansible/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- src: derjd.journald
version: 0.0.1
- src: DataDog.datadog
version: 4.20.1
version: 4.21.0
# - src: https://github.com/Naillik13/ansible-role-mysql
# version:

Expand Down
9 changes: 9 additions & 0 deletions tools/scripts/ansible/templates/bootstrap-properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
# the full path to the config dir.
# It requires a code update in CLDRConfigImpl.
org.unicode.cldr.util.CLDRConfigImpl.cldrHome="{{ cldr_path }}"

# datadog things
dd.dynamic.instrumentation.enabled=true
dd.logs.injection=true
dd.env={{ dd_env }}

# for DD: use json!
com.ibm.ws.logging.message.format=json
com.ibm.ws.logging.message.source=message,trace,accessLog,ffdc,audit

0 comments on commit 678fda9

Please sign in to comment.