Skip to content

Feature Request: Validate resources locally before applying (extend dtctl verify) #49

@hk9890

Description

@hk9890

Problem

dtctl verify currently only supports DQL queries (dtctl verify query). But when working with dashboards, notebooks, workflows, or settings, there's no way to check if a resource file is valid before running dtctl apply. Errors are only caught after the API rejects the request — which is too late for CI pipelines, pre-commit hooks, or quick local feedback.

Proposal

Extend dtctl verify to support additional resource types:

dtctl verify dashboard -f dashboard.yaml
dtctl verify notebook -f notebook.yaml
dtctl verify workflow -f workflow.yaml
dtctl verify settings -f settings.yaml
dtctl verify analyzer -f analyzer.yaml

Each command should validate the resource file and report errors/warnings without modifying anything in the Dynatrace environment.

Use Cases

  • Local development: catch typos, missing fields, and structural mistakes before applying
  • CI/CD pipelines: fail fast on invalid resource files with --fail-on-warn
  • Pre-commit hooks: validate changed resource files automatically
  • Scripting: machine-readable output with -o json

Expected Behavior

$ dtctl verify dashboard -f broken-dashboard.yaml
✖ Dashboard has issues
  ERROR: missing required field "tiles"
  WARN: no 'version' field in content

$ dtctl verify workflow -f my-workflow.yaml
✔ Workflow is valid
  Name: "My Workflow"
  Tasks: 3

$ echo $?
0

Exit codes should be consistent with dtctl verify query: 0 = valid, 1 = invalid/warnings with --fail-on-warn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions