pagerduty.sendEvent() function

The pagerduty.sendEvent() function sends an event to PagerDuty.

*Function type: Output*

  1. import "pagerduty"
  2. pagerduty.sendEvent(
  3. pagerdutyURL: "https://events.pagerduty.com/v2/enqueue",
  4. routingKey: "ExampleRoutingKey",
  5. client: "ExampleClient",
  6. clientURL: "http://examplepagerdutyclient.com",
  7. dedupkey: "ExampleDedupKey",
  8. class: "cpu usage",
  9. group: "app-stack",
  10. severity: "ok",
  11. eventAction: "trigger",
  12. source: "monitoringtool:vendor:region",
  13. summary: "This is an example summary.",
  14. timestamp: "2016-07-17T08:42:58.315+0000"
  15. )

Parameters

pagerdutyURL

The URL of the PagerDuty endpoint. Defaults to https://events.pagerduty.com/v2/enqueue.

*Data type: String*

routingKey

The routing key generated from your PagerDuty integration.

*Data type: String*

client

The name of the client sending the alert.

*Data type: String*

clientURL

The URL of the client sending the alert.

*Data type: String*

dedupkey

A per-alert ID that acts as deduplication key and allows you to acknowledge or change the severity of previous messages. Supports a maximum of 255 characters.

When using pagerduty.endpoint() to send data to PagerDuty, the function uses the pagerduty.dedupKey() function to populate the dedupkey parameter.

*Data type: String*

class

The class or type of the event. Classes are user-defined. For example, ping failure or cpu load.

*Data type: String*

group

A logical grouping used by PagerDuty. Groups are user-defined. For example, app-stack.

*Data type: String*

severity

The severity of the event.

Valid values include:

  • critical
  • error
  • warning
  • info

*Data type: String*

eventAction

Event type to send to PagerDuty.

Valid values include:

  • trigger
  • resolve
  • acknowledge

*Data type: String*

source

The unique location of the affected system. For example, the hostname or fully qualified domain name (FQDN).

*Data type: String*

summary

A brief text summary of the event used as the summaries or titles of associated alerts. The maximum permitted length is 1024 characters.

*Data type: String*

timestamp

The time the detected event occurred in RFC3339nano format.

*Data type: String*