Monitor class

Monitor

Implemented types

Constructors

Monitor({required String $id, required String $createdAt, required String $updatedAt, required String name, required String projectId, required List<String> rules, required MonitorType type, required MonitorResourceType resourceType, required String resourceId, required int window, required int cooldown, required bool enabled, required List<String> notify, required String escalationId, required MonitorSeverity severity, required MonitorStatus status, double? value, String? evaluatedAt, required String alertId, String? triggeredAt, required int interval, required int timeout, required String url, MonitorMethod? method, Map<String, dynamic>? headers, required String body, required String domain, MonitorRecord? record, required String resolver, required String host, required int port, MonitorTlsMode? tlsMode, MonitorResult? result, int? latency, int? code, String? certificateExpiresAt})
Monitor.fromMap(Map<String, dynamic> map)
factory

Properties

$createdAt → String
Monitor creation date in ISO 8601 format.
final
$id → String
Monitor ID.
final
$updatedAt → String
Monitor update date in ISO 8601 format.
final
alertId → String
ID of the alert the monitor is firing for. Empty while it is not firing.
final
body → String
HTTP monitors: request body sent.
final
certificateExpiresAt → String?
Probe monitors: expiry date of the TLS certificate the last check saw, in ISO 8601 format. Null without TLS.
final
code → int?
Probe monitors: last status code an HTTP target answered with, reply code an SMTP server sent, or response code a DNS resolver returned.
final
cooldown → int
Minimum seconds between two team notifications of this monitor firing. Events fire on every change regardless.
final
domain → String
DNS monitors: domain queried.
final
enabled → bool
Whether the monitor is evaluated.
final
escalationId → String
ID of the organization's escalation that notifies the team of this monitor's alerts, step by step until one is acknowledged. When set, notify is not used. Empty to notify the notify roles once.
final
evaluatedAt → String?
Last evaluation date in ISO 8601 format.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, dynamic>?
HTTP monitors: headers sent, as an object of header names and values.
final
host → String
TCP and SMTP monitors: hostname or IP address connected to.
final
interval → int
Probe monitors: seconds between two checks, read back raised to the plan's minimum. 0 for usage monitors, which are evaluated on the server's interval.
final
latency → int?
Probe monitors: milliseconds the last check took.
final
method → MonitorMethod?
HTTP monitors: method the URL is requested with. Null for other types.
final
name → String
Monitor name.
final
notify → List<String>
Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Empty when the alert events are the only delivery. Not used while escalationId is set.
final
port → int
TCP and SMTP monitors: port connected to.
final
projectId → String
Project ID.
final
record → MonitorRecord?
DNS monitors: record type queried. Null for other types.
final
resolver → String
DNS monitors: resolver queried. Empty for the server's DNS resolver.
final
resourceId → String
ID of the resource the monitor watches, from its rules. The project ID for a project-wide monitor.
final
resourceType → MonitorResourceType
Type of the resource the monitor watches, from its rules: the project, or one database, bucket, function or site.
final
result → MonitorResult?
Probe monitors: what the last check found. ok passes; anything else opened the monitor's alert. Null before the first check.
final
rules → List<String>
Rules that must all hold for the monitor to fire, as query strings. A usage monitor has one comparing a metric with a threshold, optionally scoped with equal(&#039;resourceType&#039;) and equal(&#039;resourceId&#039;). A probe monitor fires when its rules match the check, over these variables: http statusCode, latency, certificateDays and certificateLifetime; dns answer, answers and latency; tcp latency; smtp code, latency, certificateDays and certificateLifetime. A failed connection fires whatever the rules.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
severity → MonitorSeverity
How urgent the monitor's alerts are: info, warning, error or critical. Critical alerts may be delivered with higher urgency by the notification channels that support it.
final
status → MonitorStatus
Whether the monitor is firing, as of its last evaluation.
final
timeout → int
Probe monitors: seconds a check may take before it fails.
final
tlsMode → MonitorTlsMode?
SMTP monitors: how the connection is secured. auto picks implicit TLS on port 465, STARTTLS on 587 and none otherwise. Null for other types.
final
triggeredAt → String?
Date the monitor last announced an alert, in ISO 8601 format.
final
type → MonitorType
What the monitor checks: usage compares a usage metric with a threshold; http, dns, tcp and smtp probe a target on their own interval.
final
url → String
HTTP monitors: URL requested.
final
value → double?
Metric value at the last evaluation. Null before the first evaluation, and when the last evaluation (evaluatedAt) found no usage recorded to read: without data a monitor is not compared, so it keeps its status and open alert.
final
window → int
Seconds a counter metric is summed over, and a growth metric is measured across. Gauges compare their latest value. Usage is read a short lag behind the evaluation (_APP_ALERTS_USAGE_LAG, 120 seconds by default) so events still being written are counted by the next evaluation.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited