Skip to content

Commit

Permalink
feat: add Datadog monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloGoncalvesBH committed Aug 9, 2023
1 parent 200feed commit c7dfafe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/deploy-online-serverest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
GCP_IAM_SERVICE_ACCOUNT_KEY: op://CI-CD/google-cloud/SERVICE_ACCOUNT_KEY
DD_API_KEY: op://CI-CD/Datadog/DD_API_KEY
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
- name: Authentication on GCloud
Expand All @@ -80,7 +81,12 @@ jobs:
gcloud run \
deploy $SERVICE_STAGING \
--image gcr.io/$PROJECT_ID/$SERVICE_NAME:${{ github.sha }} \
--region $REGION
--region $REGION \
--update-env-vars=DD_API_KEY=$DD_API_KEY \
--update-env-vars=DD_TRACE_ENABLED=true \
--update-env-vars=DD_SITE='datadoghq.eu' \
env:
DD_API_KEY: ${{ env.DD_API_KEY }}

test-e2e-staging:
name: E2E test on staging environment
Expand Down
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ LABEL repository="https://github.com/ServeRest/ServeRest" \
homepage="https://github.com/ServeRest/ServeRest" \
maintainer="Paulo Gonçalves <https://www.linkedin.com/in/paulo-goncalves/>"

# hadolint ignore=DL3022
COPY --from=datadog/serverless-init:1-alpine /datadog-init /app/datadog-init
# hadolint ignore=DL3022
COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/
ENV DD_SERVICE=datadog-demo-run-nodejs
ENV DD_ENV=$USERNAME
ENV DD_VERSION=1
ENV DD_LOGS_ENABLED=true

WORKDIR /app

COPY package*.json ./
Expand All @@ -19,5 +28,5 @@ ENV USERNAME='docker'
ENV TERM=xterm-256color

EXPOSE 3000

ENTRYPOINT [ "npm", "start", "--" ]
ENTRYPOINT ["/app/datadog-init"]
CMD ["npm", "start", "--"]

0 comments on commit c7dfafe

Please sign in to comment.