Skip to content

Commit

Permalink
Merge pull request #1 from zebbra/feature/AssignmentGroup
Browse files Browse the repository at this point in the history
add assignmentGroup
  • Loading branch information
maetthu authored Nov 15, 2022
2 parents 57b78ed + 4ac4024 commit 7284571
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/lib/collector/snow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()),
)
Expand Down
3 changes: 2 additions & 1 deletion internal/lib/snow/incident.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
)

Expand All @@ -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"`
}

Expand Down

0 comments on commit 7284571

Please sign in to comment.