Skip to main content

LogsAlert

Resource LogsAlert in pulumi-posthog.
7 min read

Resource LogsAlert in pulumi-posthog.

Pulumi type: posthog:index/logsAlert:LogsAlert.

name is the Pulumi resource name. Nested object fields are documented under that object. They are not arguments of this resource.

Example#

Only required arguments are set. A string in angle brackets stands in for that argument. Any other value is an option or example written in the SDK description.

Arguments#

PropertyTypeRequiredDescription
blockedWindowsLogsAlertBlockedWindow (input)[]noQuiet hours: time windows during which the alert is not evaluated. Times use the project timezone. Windows must not overlap or touch each other. A window may cross midnight (for example 22:00 to 06:00), but only as the sole window, because PostHog stores a crossing window as two windows when anything else is configured. PostHog enforces its own limits on window length and count, and reports them on apply. Omit the attribute, or set it to an empty list, to disable quiet hours.
cooldownMinutesnumbernoMinimum minutes between repeated notifications after the alert fires. Defaults to 0, meaning no cooldown.
datapointsToAlarmnumbernoHow many of the evaluationPeriods most recent check periods must breach the threshold before the alert fires. Must be between 1 and 10 and must not exceed evaluationPeriods. Defaults to 1.
enabledbooleannoWhether the alert is actively evaluated. Defaults to true. Disabling resets the alert state to notFiring.
evaluationPeriodsnumbernoHow many of the most recent check periods to consider. PostHog checks a log alert every 5 minutes, so 3 periods covers the last 15 minutes. Must be between 1 and 10. Defaults to 1.
filterGroupJsonstringnoAttribute-level filters as JSON, matching the filters.filterGroup object of the logs alerts API. Use this for anything beyond severity and service, such as filtering on a log attribute. Must be a non-empty JSON object. Only the fields you declare are tracked: PostHog annotates saved filters with defaults (such as label) that would otherwise surface as permanent drift. The flip side is that a field you omit is not tracked either. If someone edits it in the PostHog UI Terraform will not detect the drift, so declare every field you care about. An imported alert adopts PostHog's stored filter group verbatim, so the first plan after an import may show one diff that clears on apply.
namestringnoHuman-readable name for the alert. PostHog defaults this to Untitled alert when omitted, so this attribute is computed: leaving it out adopts the server's default rather than producing a diff.
projectIdstringnoProject ID (environment) for this resource. Overrides the provider-level project_id.
serviceNamesstring[]noService names to scope the alert to.
severityLevelsstring[]noLog severity levels to count: trace, debug, info, warn, error, or fatal.
snoozeUntilstringnoRFC 3339 timestamp until which the alert is silenced, for example 2026-01-31T09:00:00Z. Useful for planned work when you want a window of silence in version control rather than in someone's memory. Managed only when you set it. Leave it out and Terraform never sends it, so a snooze an operator sets in the PostHog UI is left alone rather than being reverted on the next apply.
thresholdCountnumbernoLog entry count to compare against. The alert fires when the number of matching entries in the window is above (or below) this value. Defaults to 100. Use 0 with above to fire on any matching log.
thresholdOperatorstringnoWhether the alert fires when the count is above or below the threshold. Defaults to above.
windowMinutesnumbernoTime window in minutes over which log entries are counted: 5, 10, 15, 30, or 60. Defaults to 5.

Outputs#

Computed outputs are produced by the provider. They are not constructor arguments.

PropertyTypeComputedDescription
blockedWindowsLogsAlertBlockedWindow (output)[]noQuiet hours: time windows during which the alert is not evaluated. Times use the project timezone. Windows must not overlap or touch each other. A window may cross midnight (for example 22:00 to 06:00), but only as the sole window, because PostHog stores a crossing window as two windows when anything else is configured. PostHog enforces its own limits on window length and count, and reports them on apply. Omit the attribute, or set it to an empty list, to disable quiet hours.
cooldownMinutesnumbernoMinimum minutes between repeated notifications after the alert fires. Defaults to 0, meaning no cooldown.
datapointsToAlarmnumbernoHow many of the evaluationPeriods most recent check periods must breach the threshold before the alert fires. Must be between 1 and 10 and must not exceed evaluationPeriods. Defaults to 1.
enabledbooleannoWhether the alert is actively evaluated. Defaults to true. Disabling resets the alert state to notFiring.
evaluationPeriodsnumbernoHow many of the most recent check periods to consider. PostHog checks a log alert every 5 minutes, so 3 periods covers the last 15 minutes. Must be between 1 and 10. Defaults to 1.
filterGroupJsonstringnoAttribute-level filters as JSON, matching the filters.filterGroup object of the logs alerts API. Use this for anything beyond severity and service, such as filtering on a log attribute. Must be a non-empty JSON object. Only the fields you declare are tracked: PostHog annotates saved filters with defaults (such as label) that would otherwise surface as permanent drift. The flip side is that a field you omit is not tracked either. If someone edits it in the PostHog UI Terraform will not detect the drift, so declare every field you care about. An imported alert adopts PostHog's stored filter group verbatim, so the first plan after an import may show one diff that clears on apply.
namestringnoHuman-readable name for the alert. PostHog defaults this to Untitled alert when omitted, so this attribute is computed: leaving it out adopts the server's default rather than producing a diff.
projectIdstringnoProject ID (environment) for this resource. Overrides the provider-level project_id.
serviceNamesstring[]noService names to scope the alert to.
severityLevelsstring[]noLog severity levels to count: trace, debug, info, warn, error, or fatal.
snoozeUntilstringnoRFC 3339 timestamp until which the alert is silenced, for example 2026-01-31T09:00:00Z. Useful for planned work when you want a window of silence in version control rather than in someone's memory. Managed only when you set it. Leave it out and Terraform never sends it, so a snooze an operator sets in the PostHog UI is left alone rather than being reverted on the next apply.
statestringyesCurrent evaluation state of the alert, as PostHog reports it: notFiring, firing, pendingResolve, errored, snoozed or broken. A broken alert has stopped evaluating after repeated failed checks and notifies nobody; clearing that is a PostHog UI action, so the provider warns about it on refresh rather than managing it.
thresholdCountnumbernoLog entry count to compare against. The alert fires when the number of matching entries in the window is above (or below) this value. Defaults to 100. Use 0 with above to fire on any matching log.
thresholdOperatorstringnoWhether the alert fires when the count is above or below the threshold. Defaults to above.
windowMinutesnumbernoTime window in minutes over which log entries are counted: 5, 10, 15, 30, or 60. Defaults to 5.

LogsAlertBlockedWindow (input)#

Input object LogsAlertBlockedWindow. Fields below belong to this object, not to the parent.

PropertyTypeRequiredDescription
endstringyesEnd time as HH:MM (24-hour, project timezone). Exclusive.
startstringyesStart time as HH:MM (24-hour, project timezone). Inclusive.

LogsAlertBlockedWindow (output)#

Output object LogsAlertBlockedWindow. Fields below belong to this object.

PropertyTypeAlways presentDescription
endstringyesEnd time as HH:MM (24-hour, project timezone). Exclusive.
startstringyesStart time as HH:MM (24-hour, project timezone). Inclusive.