//native
/**
* Retrieve a metric alert rule for an organization
* Return details on an individual metric alert rule.
A metric alert rule is a configuration that defines the conditions for triggering an alert.
It specifies the metric type, function, time interval, and threshold
values that determine when an alert should be triggered. Metric alert rules are used to monitor
and notify you when certain metrics, like error count, latency, or failure rate, cross a
predefined threshold. These rules help you proactively identify and address issues in your
project.
*/
export async function main(auth: RT.Sentry, alert_rule_id: string) {
const url = new URL(
`https://${auth.region}.sentry.io/api/0/organizations/${auth.organizationSlug}/alert-rules/${alert_rule_id}/`
)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago