Export extension assets

You can add a maximum of 10 dashboards and 10 custom events for alerting definitions to the extension environment configuration.

Export dashboard definition

Export a dashboard definition through the Dynatrace web UI or Dynatrace API.

  1. Display the dashboard.
  2. Select Edit.
  3. Switch to the Settings tab.
  4. Select the Advanced settings link.
  5. Select Dashboard JSON.
  6. On the Dashboard JSON page, select Download.
    A JSON file with the dashboard's name is downloaded to your local machine.

For more information, see Edit dashboard JSON.

Export custom event for alerting definition

  1. From the navigation menu, select Settings > Anomaly detection > Custom events for alerting.
  2. Select the pencil button next to the alert of your choice.
  3. In the URL, find the id parameter (for example, id=1be8d58d-71a7-4566-9058-754d635363ab) and save the parameter value.
  4. Run the following command to get the definition of the custom event for alerting. For this example, we use the Dynatrace SaaS URL:
    curl -X GET "https://{env-id}.live.dynatrace.com/api/config/v1/anomalyDetection/metricEvents/{custom-event-id}" \
    -H "accept: application/json; charset=utf-8" \
    -H "Authorization: Api-Token `{api-token}"
    
    Replace:
    • {env-id} with your Environment ID.
    • {api-token} with an API token that has the required permissions.
    • {custom-event-id} with the custom event for the alerting identifier you determined in the previous step.
  5. The call returns the JSON payload containing a custom event for the alerting definition. Save it as a JSON file.

Add assets to your extension package

Declare the exported JSON files in your extension.yaml file and add them to your extension package. For more information, see Extensions 2.0 hands-on excercise.