Skip to content

Commit

Permalink
Enable installing non-core integrations (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpt1313 authored Sep 24, 2024
1 parent 9c42e39 commit 74e5692
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jobs/dd-agent/spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages:
templates:
config/confd.sh.erb: config/confd.sh
config/datadog.yaml.erb: config/datadog.yaml
config/extra-integrations.sh.erb: config/extra-integrations.sh
config/system-probe.yaml.erb: config/system-probe.yaml
config/bpm.yml.erb: config/bpm.yml
data/properties.sh.erb: data/properties.sh
Expand Down Expand Up @@ -238,6 +239,9 @@ properties:
dd.integrations:
default: {}
description: Agent integration configuration. Each key will have ".yaml" appended to it and the value dumped a file
dd.extra_integrations:
default: {}
description: Additional agent integrations to be installed. Each key should be the integration name and the value should be the integration version; the integration configuration has to be added to `dd.integrations` property
dd.expvar_port:
default: 15000
description: The port that the agent reports expvar metrics over. (Set to a different port if there's a collision)
Expand Down
3 changes: 3 additions & 0 deletions jobs/dd-agent/templates/bin/pre-start
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ fi

ensure_agent_ownership

# Install additional integrations
source /var/vcap/jobs/dd-agent/config/extra-integrations.sh

# sysctl -e -w net.ipv4.tcp_fin_timeout 10
# sysctl -e -w net.ipv4.tcp_tw_reuse 1
10 changes: 10 additions & 0 deletions jobs/dd-agent/templates/config/extra-integrations.sh.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables

DD_AGENT="$JOB_DIR/packages/dd-agent/bin/agent/agent"

<% p("dd.extra_integrations", {}).each do |integration, version| %>
(cd ${JOB_DIR}/packages/dd-agent && exec chpst -v -u vcap:vcap ${DD_AGENT} integration install -t datadog-<%= integration %>==<%= version %>)
<% end %>

0 comments on commit 74e5692

Please sign in to comment.