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

[AIT-8952] Generate DD_INSTRUMENTATION_INSTALL_TIME and DD_INSTRUMENTATION_INSTALL_ID #1263

Merged
merged 15 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Datadog changelog

## 3.51.0

* Add env variables to support APM Telemetry KPIs
liliyadd marked this conversation as resolved.
Show resolved Hide resolved

## 3.50.5

* Add option to use containerd snapshotter to generate SBOMs.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 3.50.5
version: 3.51.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.50.5](https://img.shields.io/badge/Version-3.50.5-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.51.0](https://img.shields.io/badge/Version-3.51.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)

[Datadog](https://www.datadoghq.com/) is a hosted infrastructure monitoring platform. This chart adds the Datadog Agent to all nodes in your cluster via a DaemonSet. It also optionally depends on the [kube-state-metrics chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics). For more information about monitoring Kubernetes with Datadog, please refer to the [Datadog documentation website](https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/).

Expand Down
15 changes: 15 additions & 0 deletions charts/datadog/templates/_container-trace-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@
- name: DD_DOGSTATSD_SOCKET
value: {{ .Values.datadog.dogstatsd.socketPath | quote }}
{{- end }}
- name: DD_INSTRUMENTATION_INSTALL_TIME
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-kpi-telemetry-configmap
key: install_time
- name: DD_INSTRUMENTATION_INSTALL_ID
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-kpi-telemetry-configmap
key: install_id
- name: DD_INSTRUMENTATION_INSTALL_TYPE
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-kpi-telemetry-configmap
key: install_type
{{- include "additional-env-entries" .Values.agents.containers.traceAgent.env | indent 4 }}
{{- include "additional-env-dict-entries" .Values.agents.containers.traceAgent.envDict | indent 4 }}
volumeMounts:
Expand Down
10 changes: 10 additions & 0 deletions charts/datadog/templates/_containers-common-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,13 @@ Return a list of env-vars if the cluster-agent is enabled
key: token
{{- end }}
{{- end -}}


{{- define "kpi-envvar" -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this redundant since env vars are inlined in both trace agent and DCA containers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it. This code re-appeared after merge from remote branch.

- name: DD_INSTRUMENTATION_INSTALL_TIME
value: {{ now | unixEpoch | quote }}
- name: DD_INSTRUMENTATION_INSTALL_ID
value: {{ uuidv4 | quote }}
- name: DD_INSTRUMENTATION_INSTALL_TYPE
value: placeholder
{{- end -}}
15 changes: 15 additions & 0 deletions charts/datadog/templates/cluster-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,21 @@ spec:
value: {{ .Values.datadog.prometheusScrape.version | quote }}
{{- end }}
{{- end }}
- name: DD_INSTRUMENTATION_INSTALL_TIME
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-kpi-telemetry-configmap
key: install_time
- name: DD_INSTRUMENTATION_INSTALL_ID
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-kpi-telemetry-configmap
key: install_id
- name: DD_INSTRUMENTATION_INSTALL_TYPE
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-kpi-telemetry-configmap
key: install_type
{{- include "fips-envvar" . | nindent 10 }}
{{- include "additional-env-entries" .Values.clusterAgent.env | indent 10 }}
{{- include "additional-env-dict-entries" .Values.clusterAgent.envDict | indent 10 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/datadog/templates/kpi-telemetry-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-kpi-telemetry-configmap
namespace: {{ .Release.Namespace }}
labels:
{{ include "datadog.labels" . | indent 4 }}
data:
install_id: {{ uuidv4 | quote }}
install_type: k8s_manual
install_time: {{ now | unixEpoch | quote }}
Loading