dcg

New Relic

monitoring.newrelic

Protects against destructive New Relic CLI/API operations like deleting entities or alerting resources.

  • 6blocking rules
  • 4safe patterns
  • 6High
~/.config/dcg/config.toml
[packs]
enabled = ["monitoring.newrelic"]

Evaluated when a command contains newrelic, api.newrelic.com, graphql.

Blocking rules

Each rule ID is monitoring.newrelic:<name>. Use it in allowlists and [policy.rules].

  1. newrelic-api-delete

    High

    New Relic API DELETE calls remove monitoring/alerting resources.

    Explanation
    Direct API DELETE calls permanently remove New Relic resources without confirmation. Alert policies, dashboards, and monitors are deleted immediately. Safer alternatives: - GET the resource first to verify the ID and export configuration - Use the New Relic CLI for better feedback and confirmation - Use Terraform/Pulumi for version-controlled resource management
  2. newrelic-apm-app-delete

    High

    newrelic apm application delete removes an APM application.

    Explanation
    Deleting an APM application removes all application performance data, traces, and associated alert policies. You lose visibility into application behavior and historical performance trends. Safer alternatives: - newrelic apm application get <id>: Review application details first - Disable the APM agent in your application instead - Export application settings and dashboards as backup
  3. newrelic-entity-delete

    High

    newrelic entity delete removes a New Relic entity, impacting observability.

    Explanation
    Deleting a New Relic entity removes all associated telemetry data, relationships, and alert configurations. Historical metrics for this entity will no longer be accessible. Safer alternatives: - newrelic entity search: Find and verify the entity first - Tag the entity as deprecated instead of deleting - Export entity configuration before deletion
  4. newrelic-graphql-delete-mutation

    High

    New Relic GraphQL delete mutations can remove monitoring resources.

    Explanation
    GraphQL delete mutations remove New Relic resources via the NerdGraph API. This affects entities, dashboards, alert policies, and other observability resources. Safer alternatives: - Run a query first to verify the GUID or resource ID - Use the New Relic CLI or UI for deletion with better feedback - Export the resource definition before deletion
  5. newrelic-synthetics-delete

    High

    newrelic synthetics delete removes a synthetics monitor.

    Explanation
    Deleting a synthetics monitor stops all uptime and availability checking for the monitored endpoint. You will no longer receive alerts when the endpoint becomes unavailable or slow. Safer alternatives: - Disable the monitor temporarily instead of deleting - Export monitor configuration as code (Terraform/Pulumi) - newrelic synthetics search: Verify you're deleting the correct monitor
  6. newrelic-workload-delete

    High

    newrelic workload delete removes a workload definition.

    Explanation
    Deleting a workload removes the logical grouping of entities and any associated health status calculations. Teams using this workload for service overview will lose their aggregated view. Safer alternatives: - Review workload entities and dependencies first - Export workload definition using the API - Modify the workload rather than deleting and recreating

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • newrelic-entity-search
  • newrelic-apm-app-get
  • newrelic-query
  • newrelic-api-get