Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vets API: Datadog Source Code Integration Implementation (dupe 1) #90707

Closed
4 of 8 tasks
Tracked by #80122
jennb33 opened this issue Aug 14, 2024 · 4 comments
Closed
4 of 8 tasks
Tracked by #80122

Vets API: Datadog Source Code Integration Implementation (dupe 1) #90707

jennb33 opened this issue Aug 14, 2024 · 4 comments
Assignees
Labels
2024 Datadog devops practice area categorization -- NOT a team assignment platform-product-team vets-api

Comments

@jennb33
Copy link
Contributor

jennb33 commented Aug 14, 2024

This ticket is a duplicate of 82531, for Sprint 8, so that the work can be finished.

Description

Following up on the work done in the Discovery ticket 79623, this ticket is the implementation work for source code integration using DataDog, in anticipation of the deprecation of Sentry and to further build out DataDog functionality. This feature will enhance error investigation by offering direct links to the relevant sections of the Vets API repository within the error logs. See setup configuration. Integrating source code with Datadog's APM is a valuable step to consider for improved error analysis and debugging.

Tasks

Detailed Steps for Ruby implementation:

  • Step 1: Update the Dockerfile

  • We'll start by adding build arguments to our Dockerfile. These will capture the Git repository URL and the current commit SHA. Add the following lines to your Dockerfile: dockerfile

  • Define build-time arguments for Git repository URL and commit SHA

  • ARG DD_GIT_REPOSITORY_URL

  • ARG DD_GIT_COMMIT_SHA

  • Set an environment variable that Datadog can use to tag telemetry

  • ENV DD_TAGS="git.repository_url:${DD_GIT_REPOSITORY_URL},git.commit.sha:${DD_GIT_COMMIT_SHA}"

  • These instructions set up build-time arguments which are then converted into an environment variable, DD_TAGS. This environment variable will store our version control information in a format that Datadog can use to tag telemetry data.

  • Step 2: Building the Docker Image
    Next, we'll build our Docker image and pass in the necessary version control information as arguments. This is crucial for ensuring each image build can be accurately traced back to its codebase state. Use the following command in your terminal or CI/CD pipeline: bash
    docker build .
    -t my-application
    --build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo>
    --build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
    Replace <git-provider.example/me/my-repo> with the actual URL of your Git repository. The $(git rev-parse HEAD) command fetches the latest commit SHA from your repository, ensuring your build is tagged with the most recent codebase state.

  • Step 3: Deploy and Run
    With the build complete, you can run your Docker container as usual. The environment variable containing the Git details is now embedded within the container.

  • Step 4: Validation in Datadog
    Once application is deployed, log into Datadog to confirm that the telemetry data is being tagged correctly. We should see git.repository_url and git.commit.sha tags accompanying metrics, logs, and traces, which help in tracing issues back to their source changes.

Acceptability Criteria

  • Telemetry data is being tagged correctly
  • Validate git.repository_url and git.commit.sha tags accompanying metrics, logs, and traces

Definition of Done

  • Telemetry data is correctly tagged
  • Metrics, logs, and traces are validated for git.repository_url and git.commit.sha
@jennb33 jennb33 added 2024 Datadog devops practice area categorization -- NOT a team assignment platform-product-team vets-api labels Aug 14, 2024
@jennb33 jennb33 changed the title Copy of Vets API: Datadog Source Code Integration Implementation Vets API: Datadog Source Code Integration Implementation (dupe 1) Aug 14, 2024
@jennb33
Copy link
Contributor Author

jennb33 commented Aug 19, 2024

8/19 update: @Kshitiz-devops checked in with DataDog regarding the GitHub app that is still liked to the VA org. However, in Datadog it used to list the Vets API but now it's not.

@jennb33
Copy link
Contributor Author

jennb33 commented Aug 21, 2024

8/21 update: there are some issues with DataDog, they are working on fixing this issue on the DataDog side.

@jennb33
Copy link
Contributor Author

jennb33 commented Aug 26, 2024

8/26 update: @Kshitiz-devops has reached out to DataDog (Fri) and will set up meeting with DD tech.

@jennb33
Copy link
Contributor Author

jennb33 commented Aug 28, 2024

8/28 update: created 91711 for this work to be continued in Sprint 9; we are still pending support by DataDog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024 Datadog devops practice area categorization -- NOT a team assignment platform-product-team vets-api
Projects
None yet
Development

No branches or pull requests

2 participants