---
title: "Create an alert with code | Grafana Labs"
description: "Write an alert query in PromQL with Code mode, then create a silence to suppress notifications."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Create an alert with code

Write an alert query in PromQL with Code mode, then create a silence to suppress notifications.

Estimated time: 3 min

[Start this section →](/docs/learning-hub/basic-alerting/06-create-alert-with-code/16-build-alert-with-code/)
