A project is a folder containing specially named sub-folders representing APIs. The API folders contain another layer of folders defining configurations. The configuration folders contain YAML files specifying what gets deployed.
To list all supported APIs and folder names, see Configuration types and access permissions.
A configuration consists of two parts:
The configuration YAML file contains basic information about the configuration to deploy. This includes the name of the configuration, the location of the template file, and the parameters usable in the template file. Parameters can be overwritten based on what group or environment is currently deployed.
For details on configuration syntax, see Configuration.
The JSON template contains the payload that will be uploaded to the Dynatrace API endpoints. It allows you to reference all defined parameters of the configuration via {{ .PARAMETER_NAME }}
syntax. For example:
template.json
:
{"name": "{{ .name }}","type": "{{ .type }}","value": {{ .numericValue }}}
config.yaml
:
configs:- id: sampleconfig:name: "Sample"parameters:type: "simple"numericValue: 42[...]
As you can see, it's also possible to reference the name of a configuration.
The Dynatrace Monaco CLI uses Go templates, which, in theory, allow you to define more complex templates, but we highly recommend that you keep templates as simple as possible. Referencing variables via {{ .PARAMETER_NAME }}
should be sufficient.
For more on advanced templating use cases, see Advanced use cases with Go templating.
The json
files that can be uploaded with this tool are the JSON objects that the respective Dynatrace APIs accept/return. Adding a new configuration is generally done via the Dynatrace web UI unless you know the configuration JSON structures well enough to prefer writing them. Configurations can then be downloaded via the respective GET endpoint defined in the Dynatrace Configuration API, and should be cleaned up for auto-deployment.
A checked-in configuration should not include:
id
but only its name
. The entity can be created or updated if one of the same name exists. The name
must be defined as a variable.tileFilter
s on dashboards).Special requirements for JSON templates
Some configuration types have special requirements for their JSON payloads and might need manual modification to be used with Configuration as Code.
For details, see Special configuration types.