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 2) #91711

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

Vets API: Datadog Source Code Integration Implementation (dupe 2) #91711

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

Comments

@jennb33
Copy link
Contributor

jennb33 commented Aug 28, 2024

This ticket is a duplicate of #90707, for Sprint 9, so that the work can be finished. It was delayed due to needing support from DataDog.

Description

Following up on the work done in the Discovery in #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
@rmtolmach
Copy link
Contributor

rmtolmach commented Nov 13, 2024

Waiting on reply. Jason sent an email (from VA email) and will check to see if he got a response. Update: the contact was out of office, so we're still waiting.

@AshleyGuerrant
Copy link

AshleyGuerrant commented Nov 20, 2024

Not completed during Sprint 14 because it is blocked pending a response from the VA to troubleshoot email access. Moving to Sprint 16 when the dev. returns from PTO.

@AshleyGuerrant
Copy link

@jwoodman5 - did the VA ever respond to your email?

cc @Kshitiz-devops

@AshleyGuerrant
Copy link

AshleyGuerrant commented Dec 18, 2024

Standup note: @Kshitiz-devops has access to his VA email but is still waiting on a response from the contact at the VA so the work is still blocked. He will send a follow-up email. This ticket will roll over to Sprint 18.

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

No branches or pull requests

4 participants