diff --git a/internal/lib/collector/snow.go b/internal/lib/collector/snow.go index e8c0998..5c6ce66 100644 --- a/internal/lib/collector/snow.go +++ b/internal/lib/collector/snow.go @@ -75,7 +75,7 @@ func (c *SNOWCollector) Collect(ch chan<- prometheus.Metric) { prometheus.NewDesc( "snow_incident_info", "Info about a SNOW incident", - []string{"ShortDescription", "ClosedAt", "ClosedAtUnix", "Description", "Priority", "ChildIncidents", "SysId", "Number", "OpenedAt", "OpenedAtUnix", "ResolvedBy", "CallerId", "Location", "State", "AssignedTo", "ModifiedAt", "ModifiedAtUnix"}, + []string{"ShortDescription", "ClosedAt", "ClosedAtUnix", "Description", "Priority", "ChildIncidents", "SysId", "Number", "OpenedAt", "OpenedAtUnix", "ResolvedBy", "CallerId", "Location", "State", "AssignedTo", "AssignmentGroup", "ModifiedAt", "ModifiedAtUnix"}, nil, ), prometheus.GaugeValue, @@ -95,6 +95,7 @@ func (c *SNOWCollector) Collect(ch chan<- prometheus.Metric) { i.Location, i.State, i.AssignedTo, + i.AssignmentGroup, i.ModifiedAt(), snow.ToUnixString(i.ModifiedAt()), ) diff --git a/internal/lib/snow/incident.go b/internal/lib/snow/incident.go index 21a6edb..f68fde7 100644 --- a/internal/lib/snow/incident.go +++ b/internal/lib/snow/incident.go @@ -7,7 +7,7 @@ import ( func (c *Client) Incident(ctx context.Context) ([]Incident, error) { resp, err := c.Fetch( ctx, - "/api/now/table/incident?sysparm_limit=500&sysparm_query=active=true^ORDERBYDESCsys_created_on&sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_fields=sys_id,number,state,priority,short_description,description,caller_id,opened_at,closed_at,resolved_by,location,service_offeringclose_notes,child_incidents,assigned_to,sys_updated_on", + "/api/now/table/incident?sysparm_limit=500&sysparm_query=active=true^ORDERBYDESCsys_created_on&sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_fields=sys_id,number,state,priority,short_description,description,caller_id,opened_at,closed_at,resolved_by,location,service_offeringclose_notes,child_incidents,assigned_to,assignment_group,sys_updated_on", &IncidentList{}, ) @@ -33,6 +33,7 @@ type Incident struct { Location string `json:"location"` State string `json:"state"` AssignedTo string `json:"assigned_to"` + AssignmentGroup string `json:"assignment_group"` SysUpdatedOn string `json:"sys_updated_on"` }