The dynatrace-bootstrapper
is a small CLI binary built into a Dynatrace CodeModule (after version <to-be-determined-codemodule-version>
) so that it can be used in conjunction with the dynatrace-operator to optimize the download and configuration of a CodeModule in Kubernetes.
- Copy a Dynatrace CodeModule to a target directory
- Configure the Dynatrace CodeModule according to the configuration options provided
Example: --source="/opt/dynatrace/oneagent"
⚠️ This is a required arg⚠️ - The
--source
arg defines the base path where to copy the CodeModule FROM.
Example: --target="example/bins/1.2.3"
⚠️ This is a required arg⚠️ - The
--target
arg defines the base path where to copy the CodeModule TO.
Example: --work="/example/work"
- This is an optional arg
- The
--work
arg defines the base path for a tmp folder, this is where the command will do its work, to make sure the operations are atomic. It must be on the same disk as the target folder.
Example: --technology="python,java"
- This is an optional arg
- The
--technology
arg defines the paths associated to the given technology in the<source>/manifest.json
file. Only those files will be copied that match the technology. It is a comma-separated list.
Example: --config-directory="/example/config/dir"
- This is an optional arg
- The
--config-directory
arg defines the path whereenrichment
andconfig
files will be created in.
Example: --input-directory="/example/input"
- This is an optional arg
- The
--input-directory
arg defines the base path where configuration files are provided.- Intended use is to mount a k8s
Secret
with the correct content in the provided path.- So when we are talking about "files", it is just the fields of the
Secret's data
- So when we are talking about "files", it is just the fields of the
- Config files:
-
ruxitagentproc.json
: A json file containing a response from the/deployment/installer/agent/processmoduleconfig
endpoint of the Dynatrace Environment(v1) API.- This file is required if
--input-directory
is defined. - Used to update the
<target>/agent/conf/ruxitagentproc.conf
file
- This file is required if
-
initial-connect-retry
: A file containing a single number value. Defines the delay before the initial connection attempt. (Useful in case ofistio-proxy
is used.)- Used to create/update the
<config-directory>/<container-name>/oneagent/agent/customkeys/curl_options.conf
file.
- Used to create/update the
-
trusted.pem
: A file containing the certificates used by the CodeModule for all its communication (proxy communication's not included).- Used to create the
<config-directory>/<container-name>/oneagent/agent/customkeys/custom.pem
and<config-directory>/<container-name>/oneagent/agent/customkeys/custom_proxy.pem
file.
- Used to create the
-
activegate.pem
: A file containing the certificates used by the CodeModule for all its communication with the ActiveGate (proxy communication's NOT included).- Used to create the
<config-directory>/<container-name>/oneagent/agent/customkeys/custom.pem
. - Is concatenated with the
trusted.pem
if both is present.
- Used to create the
-
endpoint.properties
: A file containing the necessary info so the metadata-enrichment metrics can be ingested properly- Used to create the
<config-directory>/<container-name>/enrichment/endpoint/endpoint.properties
. - Example:
DT_METRICS_INGEST_URL=http://test-activegate.dynatrace/e/tenant/api/v2/metrics/ingest DT_METRICS_INGEST_API_TOKEN=<data-ingest-token>
- Used to create the
-
- Intended use is to mount a k8s
Example: --input-directory="/opt/dynatrace/oneagent"
- This is an optional arg
- Defaults to
/opt/dynatrace/oneagent
- Defaults to
- The
--install-path
arg defines the base path where the agent binary will be put. This is only necessary to properly configure theld.so.preload
file.- The
ld.so.preload
is put under<config-directory>/oneagent/ld.so.preload
- The
Example: --attribute="k8s.pod.name=test"
- This is an optional arg
- The
--attribute
arg defines the passed in Pod attributes that will be used to configure the metadata-enrichment and injected CodeModule. It is a key value pair.
Example: --attribute-container="{k8s.container.name=app, container_image.registry=gcr.io, container_image.repository=test}"
- This is an optional arg
- The
--attribute-container
arg defines the passed in Container attributes that will be used to configure the metadata-enrichment and injected CodeModule. It is a JSON formatted string.
- To run tests:
make test
- To run linting:
make lint
- To build a testing image:
make build
- The flag
--debug
enables debug logs. - Create new debug logs via
log.V(1).Info(...)
- The logging levels between
zap
andlogr
is different, so we had to get creative.
- The logging levels between