alerts

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

BaseURLs represents the base API URLs for the different environments of the New Relic REST API V2.

View Source
var (
	// ChannelTypes enumerates the possible channel types for an alert channel.
	ChannelTypes = struct {
		Email     ChannelType
		OpsGenie  ChannelType
		PagerDuty ChannelType
		Slack     ChannelType
		User      ChannelType
		VictorOps ChannelType
		Webhook   ChannelType
	}{
		Email:     "email",
		OpsGenie:  "opsgenie",
		PagerDuty: "pagerduty",
		Slack:     "slack",
		User:      "user",
		VictorOps: "victorops",
		Webhook:   "webhook",
	}
)
View Source
var (
	// ConditionTypes enumerates the possible condition types for an alert condition.
	ConditionTypes = struct {
		APMApplicationMetric    ConditionType
		APMKeyTransactionMetric ConditionType
		ServersMetric           ConditionType
		BrowserMetric           ConditionType
		MobileMetric            ConditionType
	}{
		APMApplicationMetric:    "apm_app_metric",
		APMKeyTransactionMetric: "apm_kt_metric",
		ServersMetric:           "servers_metric",
		BrowserMetric:           "browser_metric",
		MobileMetric:            "mobile_metric",
	}
)
View Source
var (
	// IncidentPreferenceTypes specifies the possible incident preferenece types for an alert policy.
	IncidentPreferenceTypes = struct {
		PerPolicy             IncidentPreferenceType
		PerCondition          IncidentPreferenceType
		PerConditionAndTarget IncidentPreferenceType
	}{
		PerPolicy:             "PER_POLICY",
		PerCondition:          "PER_CONDITION",
		PerConditionAndTarget: "PER_CONDITION_AND_TARGET",
	}
)
View Source
var (
	// MetricTypes enumerates the possible metric types for an alert condition.
	// Not all metric types are valid for all condition types.  See the docuentation for more details.
	MetricTypes = struct {
		AjaxResponseTime       MetricType
		AjaxThroughput         MetricType
		Apdex                  MetricType
		CPUPercentage          MetricType
		Database               MetricType
		DiskIOPercentage       MetricType
		DomProcessing          MetricType
		EndUserApdex           MetricType
		ErrorCount             MetricType
		ErrorPercentage        MetricType
		FullestDiskPercentage  MetricType
		Images                 MetricType
		JSON                   MetricType
		LoadAverageOneMinute   MetricType
		MemoryPercentage       MetricType
		MobileCrashRate        MetricType
		Network                MetricType
		NetworkErrorPercentage MetricType
		PageRendering          MetricType
		PageViewThroughput     MetricType
		PageViewsWithJsErrors  MetricType
		RequestQueuing         MetricType
		ResponseTime           MetricType
		ResponseTimeBackground MetricType
		ResponseTimeWeb        MetricType
		StatusErrorPercentage  MetricType
		Throughput             MetricType
		ThroughputBackground   MetricType
		ThroughputWeb          MetricType
		TotalPageLoad          MetricType
		UserDefined            MetricType
		ViewLoading            MetricType
		WebApplication         MetricType
	}{
		AjaxResponseTime:       "ajax_response_time",
		AjaxThroughput:         "ajax_throughput",
		Apdex:                  "apdex",
		CPUPercentage:          "cpu_percentage",
		Database:               "database",
		DiskIOPercentage:       "disk_io_percentage",
		DomProcessing:          "dom_processing",
		EndUserApdex:           "end_user_apdex",
		ErrorCount:             "error_count",
		ErrorPercentage:        "error_percentage",
		FullestDiskPercentage:  "fullest_disk_percentage",
		Images:                 "images",
		JSON:                   "json",
		LoadAverageOneMinute:   "load_average_one_minute",
		MemoryPercentage:       "memory_percentage",
		MobileCrashRate:        "mobile_crash_rate",
		Network:                "network",
		NetworkErrorPercentage: "network_error_percentage",
		PageRendering:          "page_rendering",
		PageViewThroughput:     "page_view_throughput",
		PageViewsWithJsErrors:  "page_views_with_js_errors",
		RequestQueuing:         "request_queuing",
		ResponseTime:           "response_time",
		ResponseTimeBackground: "response_time_background",
		ResponseTimeWeb:        "response_time_web",
		StatusErrorPercentage:  "status_error_percentage",
		Throughput:             "throughput",
		ThroughputBackground:   "throughput_background",
		ThroughputWeb:          "throughput_web",
		TotalPageLoad:          "total_page_load",
		UserDefined:            "user_defined",
		ViewLoading:            "view_loading",
		WebApplication:         "web_application",
	}
)
View Source
var (
	// TimeFunctionTypes enumerates the possible time function types for alert condition terms.
	TimeFunctionTypes = struct {
		All TimeFunctionType
		Any TimeFunctionType
	}{
		All: "all",
		Any: "any",
	}
)
View Source
var (
	// ValueFunctionTypes enumerates the possible value function types for custom metrics.
	ValueFunctionTypes = struct {
		Average    ValueFunctionType
		Min        ValueFunctionType
		Max        ValueFunctionType
		Total      ValueFunctionType
		SampleSize ValueFunctionType
	}{
		Average:    "average",
		Min:        "min",
		Max:        "max",
		Total:      "total",
		SampleSize: "sample_size",
	}
)

Functions

This section is empty.

Types

type AlertPlugin

type AlertPlugin struct {
	ID   string `json:"id,omitempty"`
	GUID string `json:"guid,omitempty"`
}

AlertPlugin represents a plugin to use with a Plugin alert condition.

type Alerts

type Alerts struct {
	// contains filtered or unexported fields
}

Alerts is used to communicate with New Relic Alerts.

func New

func New(config config.Config) Alerts

New is used to create a new Alerts client instance.

func (*Alerts) AcknowledgeIncident added in v0.3.0

func (alerts *Alerts) AcknowledgeIncident(id int) (*Incident, error)

AcknowledgeIncident acknowledges an existing incident.

func (*Alerts) CloseIncident added in v0.3.0

func (alerts *Alerts) CloseIncident(id int) (*Incident, error)

CloseIncident closes an existing open incident.

func (*Alerts) CreateChannel added in v0.3.0

func (alerts *Alerts) CreateChannel(channel Channel) (*Channel, error)

CreateChannel creates an alert channel within a given account. The configuration options different based on channel type. For more information on the different configurations, please view the New Relic API documentation for this endpoint. Docs: https://docs.newrelic.com/docs/alerts/rest-api-alerts/new-relic-alerts-rest-api/rest-api-calls-new-relic-alerts#channels

func (*Alerts) CreateCondition added in v0.3.0

func (alerts *Alerts) CreateCondition(policyID int, condition Condition) (*Condition, error)

CreateCondition creates an alert condition for a specified policy.

func (*Alerts) CreateInfrastructureCondition

func (a *Alerts) CreateInfrastructureCondition(condition InfrastructureCondition) (*InfrastructureCondition, error)

CreateInfrastructureCondition is used to create a New Relic Infrastructure alert condition.

func (*Alerts) CreateMultiLocationSyntheticsCondition added in v0.9.0

func (alerts *Alerts) CreateMultiLocationSyntheticsCondition(condition MultiLocationSyntheticsCondition, policyID int) (*MultiLocationSyntheticsCondition, error)

CreateMultiLocationSyntheticsCondition creates an alert condition for a specified policy.

func (*Alerts) CreateNrqlCondition added in v0.3.0

func (alerts *Alerts) CreateNrqlCondition(policyID int, condition NrqlCondition) (*NrqlCondition, error)

CreateNrqlCondition creates a NRQL alert condition.

func (*Alerts) CreatePluginsCondition

func (alerts *Alerts) CreatePluginsCondition(policyID int, condition PluginsCondition) (*PluginsCondition, error)

CreatePluginsCondition creates an alert condition for a plugin.

func (*Alerts) CreatePolicy added in v0.3.0

func (alerts *Alerts) CreatePolicy(policy Policy) (*Policy, error)

CreatePolicy creates a new alert policy for a given account.

func (*Alerts) CreateSyntheticsCondition

func (alerts *Alerts) CreateSyntheticsCondition(policyID int, condition SyntheticsCondition) (*SyntheticsCondition, error)

CreateSyntheticsCondition creates a new Synthetics alert condition.

func (*Alerts) DeleteChannel added in v0.3.0

func (alerts *Alerts) DeleteChannel(id int) (*Channel, error)

DeleteChannel deletes the alert channel with the specified ID.

func (*Alerts) DeleteCondition added in v0.3.0

func (alerts *Alerts) DeleteCondition(id int) (*Condition, error)

DeleteCondition delete an alert condition.

func (*Alerts) DeleteInfrastructureCondition

func (a *Alerts) DeleteInfrastructureCondition(conditionID int) error

DeleteInfrastructureCondition is used to delete a New Relic Infrastructure alert condition.

func (*Alerts) DeleteMultiLocationSyntheticsCondition added in v0.9.0

func (alerts *Alerts) DeleteMultiLocationSyntheticsCondition(conditionID int) (*MultiLocationSyntheticsCondition, error)

DeleteMultiLocationSyntheticsCondition delete an alert condition.

func (*Alerts) DeleteNrqlCondition added in v0.3.0

func (alerts *Alerts) DeleteNrqlCondition(id int) (*NrqlCondition, error)

DeleteNrqlCondition deletes a NRQL alert condition.

func (*Alerts) DeletePluginsCondition

func (alerts *Alerts) DeletePluginsCondition(id int) (*PluginsCondition, error)

DeletePluginsCondition deletes a plugin alert condition.

func (*Alerts) DeletePolicy added in v0.3.0

func (alerts *Alerts) DeletePolicy(id int) (*Policy, error)

DeletePolicy deletes an existing alert policy for a given account.

func (*Alerts) DeletePolicyChannel

func (alerts *Alerts) DeletePolicyChannel(policyID int, channelID int) (*Channel, error)

DeletePolicyChannel deletes a notification channel from an alert policy. This method returns a response containing the Channel that was deleted from the policy.

func (*Alerts) DeleteSyntheticsCondition

func (alerts *Alerts) DeleteSyntheticsCondition(conditionID int) (*SyntheticsCondition, error)

DeleteSyntheticsCondition deletes a Synthetics alert condition.

func (*Alerts) GetChannel added in v0.3.0

func (alerts *Alerts) GetChannel(id int) (*Channel, error)

GetChannel returns a specific alert channel by ID for a given account.

func (*Alerts) GetCondition added in v0.3.0

func (alerts *Alerts) GetCondition(policyID int, id int) (*Condition, error)

GetCondition gets an alert condition for a specified policy ID and condition ID.

func (*Alerts) GetInfrastructureCondition

func (a *Alerts) GetInfrastructureCondition(conditionID int) (*InfrastructureCondition, error)

GetInfrastructureCondition is used to retrieve a specific New Relic Infrastructure alert condition.

func (*Alerts) GetNrqlCondition added in v0.3.0

func (alerts *Alerts) GetNrqlCondition(policyID int, id int) (*NrqlCondition, error)

GetNrqlCondition gets information about a NRQL alert condition for a specified policy ID and condition ID.

func (*Alerts) GetPluginsCondition

func (alerts *Alerts) GetPluginsCondition(policyID int, pluginID int) (*PluginsCondition, error)

GetPluginsCondition gets information about an alert condition for a plugin given a policy ID and plugin ID.

func (*Alerts) GetPolicy added in v0.3.0

func (alerts *Alerts) GetPolicy(id int) (*Policy, error)

GetPolicy returns a specific alert policy by ID for a given account.

func (*Alerts) GetSyntheticsCondition added in v0.6.0

func (alerts *Alerts) GetSyntheticsCondition(policyID int, conditionID int) (*SyntheticsCondition, error)

GetSyntheticsCondition retrieves a specific Synthetics alert condition.

func (*Alerts) ListChannels added in v0.3.0

func (alerts *Alerts) ListChannels() ([]*Channel, error)

ListChannels returns all alert channels for a given account.

func (*Alerts) ListConditions added in v0.3.0

func (alerts *Alerts) ListConditions(policyID int) ([]*Condition, error)

ListConditions returns alert conditions for a specified policy.

func (*Alerts) ListIncidents added in v0.3.0

func (alerts *Alerts) ListIncidents(onlyOpen bool, excludeViolations bool) ([]*Incident, error)

ListIncidents returns all alert incidents.

func (*Alerts) ListInfrastructureConditions

func (a *Alerts) ListInfrastructureConditions(policyID int) ([]InfrastructureCondition, error)

ListInfrastructureConditions is used to retrieve New Relic Infrastructure alert conditions.

func (*Alerts) ListMultiLocationSyntheticsConditions added in v0.9.0

func (alerts *Alerts) ListMultiLocationSyntheticsConditions(policyID int) ([]*MultiLocationSyntheticsCondition, error)

ListMultiLocationSyntheticsConditions returns alert conditions for a specified policy.

func (*Alerts) ListNrqlConditions added in v0.3.0

func (alerts *Alerts) ListNrqlConditions(policyID int) ([]*NrqlCondition, error)

ListNrqlConditions returns NRQL alert conditions for a specified policy.

func (*Alerts) ListPluginsConditions

func (alerts *Alerts) ListPluginsConditions(policyID int) ([]*PluginsCondition, error)

ListPluginsConditions returns alert conditions for New Relic plugins for a given alert policy.

func (*Alerts) ListPolicies added in v0.3.0

func (alerts *Alerts) ListPolicies(params *ListPoliciesParams) ([]Policy, error)

ListPolicies returns a list of Alert Policies for a given account.

func (*Alerts) ListSyntheticsConditions

func (alerts *Alerts) ListSyntheticsConditions(policyID int) ([]*SyntheticsCondition, error)

ListSyntheticsConditions returns a list of Synthetics alert conditions for a given policy.

func (*Alerts) UpdateCondition added in v0.3.0

func (alerts *Alerts) UpdateCondition(condition Condition) (*Condition, error)

UpdateCondition updates an alert condition.

func (*Alerts) UpdateInfrastructureCondition

func (a *Alerts) UpdateInfrastructureCondition(condition InfrastructureCondition) (*InfrastructureCondition, error)

UpdateInfrastructureCondition is used to update a New Relic Infrastructure alert condition.

func (*Alerts) UpdateMultiLocationSyntheticsCondition added in v0.9.0

func (alerts *Alerts) UpdateMultiLocationSyntheticsCondition(condition MultiLocationSyntheticsCondition) (*MultiLocationSyntheticsCondition, error)

UpdateMultiLocationSyntheticsCondition updates an alert condition.

func (*Alerts) UpdateNrqlCondition added in v0.3.0

func (alerts *Alerts) UpdateNrqlCondition(condition NrqlCondition) (*NrqlCondition, error)

UpdateNrqlCondition updates a NRQL alert condition.

func (*Alerts) UpdatePluginsCondition

func (alerts *Alerts) UpdatePluginsCondition(condition PluginsCondition) (*PluginsCondition, error)

UpdatePluginsCondition updates an alert condition for a plugin.

func (*Alerts) UpdatePolicy added in v0.3.0

func (alerts *Alerts) UpdatePolicy(policy Policy) (*Policy, error)

UpdatePolicy update an alert policy for a given account.

func (*Alerts) UpdatePolicyChannels

func (alerts *Alerts) UpdatePolicyChannels(policyID int, channelIDs []int) (*PolicyChannels, error)

UpdatePolicyChannels updates a policy by adding the specified notification channels.

func (*Alerts) UpdateSyntheticsCondition

func (alerts *Alerts) UpdateSyntheticsCondition(condition SyntheticsCondition) (*SyntheticsCondition, error)

UpdateSyntheticsCondition updates an existing Synthetics alert condition.

type Channel added in v0.3.0

type Channel struct {
	ID            int                  `json:"id,omitempty"`
	Name          string               `json:"name,omitempty"`
	Type          ChannelType          `json:"type,omitempty"`
	Configuration ChannelConfiguration `json:"configuration,omitempty"`
	Links         ChannelLinks         `json:"links,omitempty"`
}

Channel represents a New Relic alert notification channel

type ChannelConfiguration added in v0.3.0

type ChannelConfiguration struct {
	Recipients            string `json:"recipients,omitempty"`
	IncludeJSONAttachment string `json:"include_json_attachment,omitempty"`
	AuthToken             string `json:"auth_token,omitempty"`
	APIKey                string `json:"api_key,omitempty"`
	Teams                 string `json:"teams,omitempty"`
	Tags                  string `json:"tags,omitempty"`
	URL                   string `json:"url,omitempty"`
	Channel               string `json:"channel,omitempty"`
	Key                   string `json:"key,omitempty"`
	RouteKey              string `json:"route_key,omitempty"`
	ServiceKey            string `json:"service_key,omitempty"`
	BaseURL               string `json:"base_url,omitempty"`
	AuthUsername          string `json:"auth_username,omitempty"`
	AuthPassword          string `json:"auth_password,omitempty"`
	PayloadType           string `json:"payload_type,omitempty"`
	Region                string `json:"region,omitempty"`
	UserID                string `json:"user_id,omitempty"`

	// Payload is unmarshaled to type map[string]string
	Payload serialization.MapStringInterface `json:"payload,omitempty"`

	// Headers is unmarshaled to type map[string]string
	Headers serialization.MapStringInterface `json:"headers,omitempty"`
}

ChannelConfiguration represents a Configuration type within Channels

type ChannelLinks struct {
	PolicyIDs []int `json:"policy_ids,omitempty"`
}

ChannelLinks represent the links between policies and alert channels

type ChannelType added in v0.14.0

type ChannelType string

ChannelType specifies the channel type used when creating the alert channel.

type Condition added in v0.3.0

type Condition struct {
	ID                  int                  `json:"id,omitempty"`
	Type                ConditionType        `json:"type,omitempty"`
	Name                string               `json:"name,omitempty"`
	Enabled             bool                 `json:"enabled"`
	Entities            []string             `json:"entities,omitempty"`
	Metric              MetricType           `json:"metric,omitempty"`
	RunbookURL          string               `json:"runbook_url,omitempty"`
	Terms               []ConditionTerm      `json:"terms,omitempty"`
	UserDefined         ConditionUserDefined `json:"user_defined,omitempty"`
	Scope               string               `json:"condition_scope,omitempty"`
	GCMetric            string               `json:"gc_metric,omitempty"`
	ViolationCloseTimer int                  `json:"violation_close_timer,omitempty"`
}

Condition represents a New Relic alert condition. TODO: custom unmarshal entities to ints?

type ConditionTerm added in v0.3.0

type ConditionTerm struct {
	Duration     int              `json:"duration,string,omitempty"`
	Operator     string           `json:"operator,omitempty"`
	Priority     string           `json:"priority,omitempty"`
	Threshold    float64          `json:"threshold,string"`
	TimeFunction TimeFunctionType `json:"time_function,omitempty"`
}

ConditionTerm represents the terms of a New Relic alert condition.

type ConditionType added in v0.14.0

type ConditionType string

ConditionType specifies the condition type used when creating the alert condition.

type ConditionUserDefined added in v0.3.0

type ConditionUserDefined struct {
	Metric        string            `json:"metric,omitempty"`
	ValueFunction ValueFunctionType `json:"value_function,omitempty"`
}

ConditionUserDefined represents user defined metrics for the New Relic alert condition.

type Incident added in v0.3.0

type Incident struct {
	ID                 int                      `json:"id,omitempty"`
	OpenedAt           *serialization.EpochTime `json:"opened_at,omitempty"`
	ClosedAt           *serialization.EpochTime `json:"closed_at,omitempty"`
	IncidentPreference string                   `json:"incident_preference,omitempty"`
	Links              IncidentLink             `json:"links"`
}

Incident represents a New Relic alert incident.

type IncidentLink struct {
	Violations []int `json:"violations,omitempty"`
	PolicyID   int   `json:"policy_id"`
}

IncidentLink represents a link between a New Relic alert incident and its violations

type IncidentPreferenceType added in v0.14.0

type IncidentPreferenceType string

IncidentPreferenceType specifies rollup settings for alert policies.

type InfrastructureCondition

type InfrastructureCondition struct {
	Comparison          string                            `json:"comparison,omitempty"`
	CreatedAt           *serialization.EpochTime          `json:"created_at_epoch_millis,omitempty"`
	Critical            *InfrastructureConditionThreshold `json:"critical_threshold,omitempty"`
	Enabled             bool                              `json:"enabled"`
	Event               string                            `json:"event_type,omitempty"`
	ID                  int                               `json:"id,omitempty"`
	IntegrationProvider string                            `json:"integration_provider,omitempty"`
	Name                string                            `json:"name,omitempty"`
	PolicyID            int                               `json:"policy_id,omitempty"`
	ProcessWhere        string                            `json:"process_where_clause,omitempty"`
	RunbookURL          string                            `json:"runbook_url,omitempty"`
	Select              string                            `json:"select_value,omitempty"`
	Type                string                            `json:"type,omitempty"`
	UpdatedAt           *serialization.EpochTime          `json:"updated_at_epoch_millis,omitempty"`
	ViolationCloseTimer *int                              `json:"violation_close_timer,omitempty"`
	Warning             *InfrastructureConditionThreshold `json:"warning_threshold,omitempty"`
	Where               string                            `json:"where_clause,omitempty"`
}

InfrastructureCondition represents a New Relic Infrastructure alert condition.

type InfrastructureConditionThreshold

type InfrastructureConditionThreshold struct {
	Duration int     `json:"duration_minutes,omitempty"`
	Function string  `json:"time_function,omitempty"`
	Value    float64 `json:"value,omitempty"`
}

InfrastructureConditionThreshold represents an New Relic Infrastructure alert condition threshold.

type ListPoliciesParams added in v0.3.0

type ListPoliciesParams struct {
	Name string `url:"filter[name],omitempty"`
}

ListPoliciesParams represents a set of filters to be used when querying New Relic alert policies.

type MetricType added in v0.14.0

type MetricType string

MetricType specifies the metric type used when creating the alert condition.

type MultiLocationSyntheticsCondition added in v0.9.0

type MultiLocationSyntheticsCondition struct {
	ID                        int                                    `json:"id,omitempty"`
	Name                      string                                 `json:"name,omitempty"`
	Enabled                   bool                                   `json:"enabled"`
	RunbookURL                string                                 `json:"runbook_url,omitempty"`
	MonitorID                 string                                 `json:"monitor_id,omitempty"`
	Entities                  []string                               `json:"entities,omitempty"`
	Terms                     []MultiLocationSyntheticsConditionTerm `json:"terms,omitempty"`
	ViolationTimeLimitSeconds int                                    `json:"violation_time_limit_seconds,omitempty"`
}

MultiLocationSyntheticsCondition represents a location-based failure condition.

ViolationTimeLimitSeconds must be one of 3600, 7200, 14400, 28800, 43200, 86400.

type MultiLocationSyntheticsConditionTerm added in v0.9.0

type MultiLocationSyntheticsConditionTerm struct {
	Priority  string `json:"priority,omitempty"`
	Threshold int    `json:"threshold,omitempty"`
}

MultiLocationSyntheticsConditionTerm represents a single term for a location-based failure condition.

Priority must be "warning" or "critical". Threshold must be greater than zero.

type NrqlCondition

type NrqlCondition struct {
	Terms               []ConditionTerm `json:"terms,omitempty"`
	Nrql                NrqlQuery       `json:"nrql,omitempty"`
	Type                string          `json:"type,omitempty"`
	Name                string          `json:"name,omitempty"`
	RunbookURL          string          `json:"runbook_url,omitempty"`
	ValueFunction       string          `json:"value_function,omitempty"`
	ID                  int             `json:"id,omitempty"`
	ViolationCloseTimer int             `json:"violation_time_limit_seconds,omitempty"`
	ExpectedGroups      int             `json:"expected_groups,omitempty"`
	IgnoreOverlap       bool            `json:"ignore_overlap,omitempty"`
	Enabled             bool            `json:"enabled"`
}

NrqlCondition represents a New Relic NRQL Alert condition.

type NrqlQuery

type NrqlQuery struct {
	Query      string `json:"query,omitempty"`
	SinceValue string `json:"since_value,omitempty"`
}

NrqlQuery represents a NRQL query to use with a NRQL alert condition

type PluginsCondition

type PluginsCondition struct {
	ID                int             `json:"id,omitempty"`
	Name              string          `json:"name,omitempty"`
	Enabled           bool            `json:"enabled"`
	Entities          []string        `json:"entities,omitempty"`
	Metric            string          `json:"metric,omitempty"`
	MetricDescription string          `json:"metric_description,omitempty"`
	RunbookURL        string          `json:"runbook_url,omitempty"`
	Terms             []ConditionTerm `json:"terms,omitempty"`
	ValueFunction     string          `json:"value_function,omitempty"`
	Plugin            AlertPlugin     `json:"plugin,omitempty"`
}

PluginsCondition represents an alert condition for New Relic Plugins.

type Policy added in v0.3.0

type Policy struct {
	ID                 int                      `json:"id,omitempty"`
	IncidentPreference IncidentPreferenceType   `json:"incident_preference,omitempty"`
	Name               string                   `json:"name,omitempty"`
	CreatedAt          *serialization.EpochTime `json:"created_at,omitempty"`
	UpdatedAt          *serialization.EpochTime `json:"updated_at,omitempty"`
}

Policy represents a New Relic alert policy.

type PolicyChannels

type PolicyChannels struct {
	ID         int   `json:"id,omitempty"`
	ChannelIDs []int `json:"channel_ids,omitempty"`
}

PolicyChannels represents an association of alert channels to a specific alert policy.

type SyntheticsCondition

type SyntheticsCondition struct {
	ID         int    `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	Enabled    bool   `json:"enabled"`
	RunbookURL string `json:"runbook_url,omitempty"`
	MonitorID  string `json:"monitor_id,omitempty"`
}

SyntheticsCondition represents a New Relic Synthetics alert condition.

type TimeFunctionType added in v0.14.0

type TimeFunctionType string

TimeFunctionType specifies the time function to be used for alert condition terms.

type ValueFunctionType added in v0.14.0

type ValueFunctionType string

ValueFunctionType specifies the value function to be used for returning custom metric data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL