cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

monaco download configuration fail

Laszlo
Newcomer

monaco version 2.0.0

 

I am trying to download the configuration from the free trial Dynatrace instance with the following command:

monaco download --url "https://{environmentid}.live.dynatrace.com" --token "dt0c01.**********.**********************"
 
When I run it I get the following error:
2023/04/19 16:11:22 ERROR the content of the environment variable "dt0c01.*************.*****************" is not set
Error: not all necessary information is present to start downloading configurations
 
It is strange as the documentation says, I only need the URL and the TOKEN to download the complete configuration.
 
Then I tried to use an environment file and a manifest file following Observability Clinic on Monaco 2.0. video and this command: 
monaco download --manifest ${ENVIRONMENT_DIR}/manifest.yaml -e ${ENVIRONMENT_DIR}/dtenv.yaml
 
dtenv.yaml file content:
foo:
  - name: foo
  - env-url: https://{environmentid}.live.dynatrace.com
  - env-token-name: "DYNATRACE_TOKEN"
 
 
manifest.yaml file content:
manifest_version: 1.0
projects:
  - name: foo
environments:
  - group: research
    entries:
      - name: foo
        url:
          value: "https://{environmentid}.live.dynatrace.com"
        token:
          value: "DYNATRACE_TOKEN"
 
 
Error:
2023/04/19 16:43:44 ERROR ../../../deployment/environments/foo/manifest.yaml: error during parsing the manifest: yaml: unmarshal errors:
line 1: field manifest_version not found in type manifest.manifest
line 7: field environments not found in type manifest.manifest
Error: failed to load manifest '../../../deployment/environments/foo/manifest.yaml'

 

Monitoring, or better Observability Configuration, needs to be expressible as Code in order to scale and automate into DevOps platforms enabling a true shift-left approach of managing observability configuration like managing source code. #Dynatrace has been a pioneer by open-sourcing Monaco 1.0 ...
4 REPLIES 4

Mohamed_Hamdy
DynaMight Champion
DynaMight Champion

Hi @Laszlo,

you need to set the enviornment variable first, so from PowerShell use the following command and add your token

$env:API_TOKEN_ENV_VAR = 'dt0c01.xxxxxxxxxxxxxxxxxxxx'

then run the command again with API_TOKEN_ENV_VAR

monaco download --url https://{environmentid}.live.dynatrace.com --token API_TOKEN_ENV_VAR

Certified Dynatrace Professional | Certified Dynatrace Services Delivery - Observability & CloudOps | Dynatrace Partner - yourcompass.ca

also, you can set the environment persistently so they should remain even when close the session

[System.Environment]::SetEnvironmentVariable('API_TOKEN_ENV_VAR','dt0c01.xxxxxxxxxxxxxxxxxxxx')

then run the command again with API_TOKEN_ENV_VAR

monaco download --url https://{environmentid}.live.dynatrace.com --token API_TOKEN_ENV_VAR

Certified Dynatrace Professional | Certified Dynatrace Services Delivery - Observability & CloudOps | Dynatrace Partner - yourcompass.ca

Thanks Mohamed,

It seems to work, but the result is kind of disappointing.

Alert profiles are a basic thing, but cannot be managed by monaco. We hope calling the API with good old curl will yield better results. We need a solution where we can store our configuration as code.


2023/04/20 15:03:37 INFO  Downloaded 2 settings for schema builtin:alerting.profile
2023/04/20 15:03:37 WARN  Downloaded setting of schema "builtin:alerting.profile" will be discarded. Reason: "Default" cannot be managed via configuration as code
2023/04/20 15:03:37 WARN  Downloaded setting of schema "builtin:alerting.profile" will be discarded. Reason: "Default for ActiveGate Token Expiry" cannot be managed via configuration as code


Mohamed_Hamdy
DynaMight Champion
DynaMight Champion

Hi @Laszlo,

alerting profiles will be downloaded but not the default alerting profiles, the default alerting profiles are already available in every environment,

for instance, I have two alerting profiles that are not the "Default" and "Default for ActiveGate Token Expiry", and the alerting profiles I've created have already been downloaded while the default failed. so the total will be 4 alerting profiles including the default profiles


2023/04/21 05:16:24 INFO Downloaded 4 settings for schema builtin:alerting.profile
2023/04/21 05:16:24 WARN Downloaded setting of schema "builtin:alerting.profile" will be discarded. Reason: "Default" cannot be managed via configuration as code
2023/04/21 05:16:24 WARN Downloaded setting of schema "builtin:alerting.profile" will be discarded. Reason: "Default for ActiveGate Token Expiry" cannot be managed via configuration as code


as per the log you've provided, it seems that you don't have any other alerting profiles except for the default ones

Certified Dynatrace Professional | Certified Dynatrace Services Delivery - Observability & CloudOps | Dynatrace Partner - yourcompass.ca