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

[APM Onboarding] Use creation timestamp and UID of DatadogAgent as env vars for APM Telemetry KPIs #1157

Merged
merged 4 commits into from
May 1, 2024

Conversation

liliyadd
Copy link
Collaborator

@liliyadd liliyadd commented Apr 29, 2024

What does this PR do?

Move generation of DD_INSTALLATION_ID and DD_INSTALLATION_TIME from Datadog Operator to using values generated during DatadogAgent creation.

Motivation

https://datadoghq.atlassian.net/browse/CECO-1087

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

  1. Created Datadog Operator image with the PR change. Deployed it to the test cluster together with DatadogAgent CRD.
  2. Ran kubectl apply -f datadog-agent.yaml to. create CR, DA and DCA.
    On CR:
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"datadoghq.com/v2alpha1","kind":"DatadogAgent","metadata":{"annotations":{},"name":"datadog","namespace":"default"},"spec":{"global":{"clusterName":"apm-onboarding-injection","credentials":{"apiSecret":{"keyName":"api-key","secretName":"datadog-secret2"}},"site":"datad0g.com"}}}
  creationTimestamp: "2024-04-29T22:20:07Z"
  finalizers:
  - finalizer.agent.datadoghq.com
  generation: 1
  name: datadog
  namespace: default
  resourceVersion: "302000248"
  uid: b50e91aa-2744-4ee4-b89f-64c8bf8cf355

    - name: DD_INSTRUMENTATION_INSTALL_ID
      value: b50e91aa-2744-4ee4-b89f-64c8bf8cf355
    - name: DD_INSTRUMENTATION_INSTALL_TIME
      value: "1714429207"
  1. DA and DCA are created with the following env vars:
    • name: DD_INSTRUMENTATION_INSTALL_ID
      value: b50e91aa-2744-4ee4-b89f-64c8bf8cf355
    • name: DD_INSTRUMENTATION_INSTALL_TIME
      value: "1714429207"

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

@liliyadd liliyadd added the bug Something isn't working label Apr 29, 2024
@liliyadd liliyadd added this to the v1.6.0 milestone Apr 29, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 59.54%. Comparing base (29510eb) to head (b8696dd).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1157   +/-   ##
=======================================
  Coverage   59.54%   59.54%           
=======================================
  Files         174      174           
  Lines       21510    21510           
=======================================
  Hits        12809    12809           
  Misses       7930     7930           
  Partials      771      771           
Flag Coverage Δ
unittests 59.54% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ontrollers/datadogagent/component/agent/default.go 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29510eb...b8696dd. Read the comment docs.

@liliyadd liliyadd marked this pull request as ready for review April 29, 2024 22:26
@liliyadd liliyadd requested review from a team as code owners April 29, 2024 22:26
@levan-m levan-m merged commit 77d0df8 into main May 1, 2024
21 checks passed
@levan-m levan-m deleted the liliya.belaus/fix-apm-telemetry-envvar branch May 1, 2024 20:27
fanny-jiang pushed a commit that referenced this pull request May 2, 2024
…v vars for APM Telemetry KPIs (#1157)

* Use UUID and timestamp generated during DatadogAgent installation

* Fix unit tests

* Use util functions

(cherry picked from commit 77d0df8)
fanny-jiang added a commit that referenced this pull request May 2, 2024
…v vars for APM Telemetry KPIs (#1157) (#1164)

* Use UUID and timestamp generated during DatadogAgent installation

* Fix unit tests

* Use util functions

(cherry picked from commit 77d0df8)

Co-authored-by: Liliya Belaus <59583867+liliyadd@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants