The type field in the configs YAML file defines the Dynatrace configuration type.
The list of type fields
The type field api can be defined as follows.
configs:id: [...]type:api: synthetic-monitorconfig:[...]
or
configs:id: [...]type: synthetic-monitorconfig:[...]
For more information, see supported API types.
Some of the api type configuration have a parent-child relationship with another configuration.
Such a configuration requires a scope field that points to the parent configuration.
Define scope as value, reference, or environment.
Because such configurations are made in the scope of their parent API, referencing the parent configuration's id is a useful way of configuring entities after they've been created via the Dynatrace Monaco CLI.
In the example below, a mobile application and related key-user actions are configured, and the configs id references the mobile application.
configs:- id: mobile-application-idconfig:name: my-mobile-apptemplate: mobile-app.jsonskip: falsetype:api: application-mobile- id: MyKuaconfig:name: myKeyUserActiontemplate: kua.jsonskip: falsetype:api:name: key-user-actions-mobilescope:type: referenceconfigType: application-mobileconfigId: mobile-application-idproperty: id
The Settings API are defined by their schema, scope, and an optional schemaVersion.
The type field settings can be defined as follows.
configs:id: [...]type:settings:schema: builtin:davis.anomaly-detectorsschemaVersion: 1.0.2scope: environmentconfig:[...]
You can define the scope parameter as value, reference, or environment.
Setting the scope to environment allows the creation of a settings configuration for the entire Dynatrace environment.
A Dynatrace entity has many settings made, so referencing another configs id is a useful way of configuring entities after you've created them via the Dynatrace Monaco CLI.
In the example below, a web application is configured, and then the settings for this application are made.
The rum.web.enablement settings scope references the web application MyApp.
configs:- id: MyAppIdtype:api: application-webconfig:name: My Sample Web Applicationtemplate: application.jsonskip: false- id: MyApp_RUMSettingsIdtype:settings:schema: builtin:rum.web.enablementscope:type: referenceconfigType: application-webconfigId: MyAppIdproperty: idconfig:name: MyApp_RUMSettingstemplate: rum-settings.jsonskip: false
Another useful parameter is insertAfter.
This parameter enforces a specific ordering of single Settings 2.0 objects.
In the example below, if the insertAfter is set, Dynatrace Monaco ensures the settings object is deployed:
For Dynatrace Monaco CLI version 2.14.0+ after the referenced one using the reference parameter.
- id: mySecondAppDetectionRuleIdconfig:parameters:[...]template: wed-detect-rule.jsonskip: falsetype:settings:schema: builtin:rum.web.app-detectionschemaVersion: 2.1.1scope: environmentinsertAfter:configId: myFirstAppDetectionRuleId # Monaco config idproperty: id # must be “id”type: reference # must be “reference”
For Dynatrace Monaco CLI version 2.21.0+ after a specified configuration via a hardcoded ID using the value parameter
type:settings:schema: builtin:rum.web.app-detectionschemaVersion: 2.1.1scope: environmentinsertAfter:value: myFirstAppDetectionRuleId # hardcoded config idtype: value # must be “value”
For Dynatrace Monaco CLI version 2.21.0+ at the top or bottom of the list using the values front or back.
type:settings:schema: builtin:rum.web.app-detectionschemaVersion: 2.1.1scope: environmentinsertAfter: front # “front” puts the config on top of the list, “back” puts it at the bottom
configs in parallel, we recommend that you add the insertAfter parameter to all configs to ensure that one config is placed at the top or bottom of the list.Since Dynatrace Monaco CLI version 2.23.0+ specific Settings 2.0 objects allow the definition of a more granular permission scope to specify read or write access to single settings objects, using the permissions parameter.
The permissions parameter supports the allUser field:
none: only the owner (creator) of the settings object has full access to it, while other users have no access.read: owner (creator) has full access to the settings object, while other users, who have generic settings:objects:read permissions, only have read-only access.write: every user who has settings:objects:read and settings:objects:write permissions has full access, read and write, to the settings object.An example is shown below.
configs:- id: security-jira-connectionconfig:name: 'Security: Jira Connection'template: jira-connection.jsonskip: falseparameters:[…]type:settings:schema: app:dynatrace.jira:connectionscope: environmentpermissions:allUsers: read
Since Dynatrace Monaco CLI version 2.6.0+, the automation type is supported.
The automation type configurations represent Workflows related resources.
The type field automation can be defined as follows.
type:automation:resource: workflow # or business-calendar, or scheduling-rule
The resource field specifies the desired automation resource. Each resource requires distinct OAuth permissions.
For more information, see Monaco API support and access permission handling.
An example is shown below.
configs:- id: myRemediationWorkflowconfig:name:value: ‘High Prio Incident Remediation’parameters:[...]template: remediationWorkflow.jsonskip: falsetype:automation:resource: workflow
The automation API supports an adminAccess query parameter to fetch all available workflow resources on a given tenant.
If not used, only workflow resources are bound to the permissions of the user who created the OAuth client.
To use this parameter, the OAuth client needs to have the scope automation:workflows:admin configured.
To get the scope automation:workflows:admin configured
automation:workflows:admin permissions using the following policy statement ALLOW automation:workflows:admin.By default, the Dynatrace Monaco CLI uses this flag when accessing the API. If it fails, the operation is repeated without the flag, but you can only access the workflow created by your own user.
Workflows use the same templating characters as the Dynatrace Monaco CLI {{ ... }}. It is required to escape the templating characters used in the desired workflow JSONs as follows:
{{ becomes {{`{{`}}}} becomes {{`}}`}}With monaco download, these characters will be escaped automatically.
Since Dynatrace Monaco CLI version 2.9.0+, the bucket type is supported, and it represents the configurations of the data storage management in Grail with custom Grail buckets.
The type field bucket can be defined as follows.
type: bucket
It does not require any additional fields.
In addition to defining and creating a new storage bucket, you need an additional bucket rule Settings API to specify what data is stored in it.
An example is shown below.
configs:# this is the new custom bucket- id: my-bucket-idconfig:name: My awesome buckettemplate: bucket.jsonparameters:retention_days: 372type: bucket# this is a new setting to define the rule what data shall be stored in the previously defined custom Grail bucket- id: log-bucket-ruletype:settings:schema: builtin:logmonitoring.log-buckets-rulesscope: environmentconfig:name: My custom ruletemplate: log-bucket-rule.jsonparameters:phrase: My phrase to look forbucket:type: referenceconfigType: bucketconfigId: my-bucket-idproperty: id
Since Dynatrace Monaco CLI version 2.15.0+, the document type is supported, and it represents the API for Dashboards and Notebooks.
Since Dynatrace Monaco CLI version 2.18.0+, the document type also represents the launchpad.
The type field document can be defined as follows.
type:document:kind: dashboard # other possible types: “notebook” or “launchpad”private: true # optional field specifying the visibility of the document
The optional field private specifies whether a document is not visible.
If not specified otherwise, the document is public by default, which means everyone with access permissions can see it.
Monaco does not download Ready-made documents.
Depending on the user’s credentials, Monaco may not be able to redeploy all downloaded documents in certain situations. This situation happens when documents are publicly accessible, but the Monaco user does not have ownership rights. In other words, the Monaco user does not own the document. For more information on sharing documents or changing their owner, see Dashboards, Notebooks, or Launchpads.
For more information, see Configuration as code sample repo
deprecated
Since Dynatrace Monaco CLI version 2.15.0+, the openpipeline type is supported.
openpipeline configuration manages the data ingestion and processing of data from different sources.
The type field openpipeline can be defined as follows.
type:openpipeline:kind: bizevents # id of openpipeline configuration (for example, "bizevents", "events", "logs", "spans", or "metrics")
Deploying an openpipeline configuration overwrites the existing one of the same kind, causing any manual changes made in the web UI or other configurations managed by Monaco or Terraform to be lost.
To prevent data loss, ensure all configurations are defined within a single Monaco or Terraform configuration.
This resource is deprecated and has been moved to
Settings. For more information, see OpenPipeline API.
The kind field specifies the id of a pre-existing openpipeline configuration.
Monaco can retrieve and update configurations, but can't create or delete new ones.
Since Dynatrace Monaco CLI version 2.19.0+, the segment type is supported.
Segments are used to structure and filter data for tailored views in Dynatrace.
The type field segment can be defined as follows.
type: segment
It does not require further fields, but can be referenced in other configurations to filter visualized data accordingly.
An example is shown below.
configs:- id: segment # configures the desired segmenttype: segmentconfig:template: segment.json- id: dashboard # creates a dashboard that references a segmenttype:document:kind: dashboardprivate: trueconfig:name: Log Dashboard with Dynatrace Segmentparameters:segment_id: # references the previously created segment within a dashboardconfigId: segmentconfigType: segmentproperty: idtype: referencetemplate: dashboard.json
slo-v2 (Service-level objective) type field Since Dynatrace Monaco CLI version 2.22.0+, the slo-v2 type is supported.
Configure and monitor service-level objectives with Dynatrace, based on Grail and utilizing DQL are managed via the type slo-v2.
The slo-v2 configuration type is distinct from the existing slo type and represents SLOs leveraging Grail, as described in the Configure and monitor service-level objectives with Dynatrace overview.
These two configuration types are incompatible, and deploying a slo configuration as a slo-v2 or vice versa results in the API rejecting the request.
The type field slo-v2 can be defined as follows.
type: slo-v2
This type does not require additional fields.
An example is shown below.
configs:- id: custom-sli # An SLO based using a custom DQL query as SLItype: slo-v2config:name: custom-slitemplate: custom-sli.json- id: sli-reference # another SLO using an out-of-the-box template (aka reference)type: slo-v2config:name: sli-referencetemplate: sli-reference.json
To define the accounts for which Monaco configures Account Management resources, you need to create an accounts section in the configuration file.
The following example defines a single accounts object containing account-related information.
The name property specifies the account name, my-account, which can be referenced using the Monaco CLI command's --account flag.
accounts:- name: my-accountaccountUUID: 12345678-1234-5678-1234-123456789012oAuth:clientId:name: OAUTH_CLIENT_IDclientSecret:name: OAUTH_CLIENT_SECRET
Using Monaco, you can define users, service users, groups, and policies as dedicated types.
Unlike the usual environment-level configurations, no JSON template files are needed. Monaco builds the required API data directly from your YAML configuration.
Account-level configuration is usually distinct from environment-level configuration.
It changes less frequently; existing commands like monaco deploy ignore any account configuration that may be defined in a manifest file.
A dedicated monaco account deploy command needs to be used instead.
The example shows how Monaco represents account management resources locally, with examples defining users, service users, groups, and policies.
users: # users define one or more users bound to different groups- email: monaco@dynatrace.comgroups:- Log viewer # default group- type: referenceid: my-group# id: specifies a custom group. The ID must match a group defined in groups. Custom groups need to be referenced (vs. default groups)serviceUsers: # supported with Monaco CLI v2.23.0+- name: Monaco service user # name: must be unique. Otherwise, an originObjectId is neededdescription: Description of service useroriginObjectId: 3037325d-6475-4adf-a14d-93d1c862f9e9 # (optional) only needed if the user’s name is not uniquegroups:- Log viewer # default group- type: reference # custom group my-group needs to be referencedid: my-groupgroups:- name: My Groupid: my-groupdescription: This is my groupaccount: # specifies permissions and policies to which the group is bound on the account level.permissions:- account-viewerpolicies:- policy: Environment role - Access environmentenvironments: # specify the permissions and policies to which the group is bound on the environment/tenant level.- name: abc12345permissions:- tenant-viewerpolicies:- policy: Environment role - Replay session data without masking- type: referenceid: my-policymanagementZones: # classic Dynatrace only- environment: abc12345managementZone: Management Zone 2000permissions:- tenant-viewerpolicies: # defines one or more policies for the selected group- name: My Policyid: my-policylevel:type: accountdescription: abcdepolicy: |- # contains any policy rules of this particular policy.ALLOW automation:workflows:read;
While this sample shows users, service users, policies, and groups defined in a single file, you can define them in individual files and structure your account resource projects and files as needed.