HaemmerElectronics.SeppPenner.PagerDutyClient
PagerDutyClient is a library to send alarms to PagerDuty. Use the API at https://developer.pagerduty.com/docs/events-api-v2/trigger-events/.
Install
| Product | Versions |
|---|---|
| .NET |
README
PagerDutyClient
PagerDutyClient is a library to send alarms to PagerDuty. Use the API at https://developer.pagerduty.com/docs/events-api-v2/trigger-events/.
Available for
- Net 8.0
- Net 10.0
Net Core and Net latest and LTS versions
Basic usage
Sending an alarm goes through the events API. It needs no API token, the routing key of the integration identifies the caller.
using PagerDutyClient;
using PagerDutyClient.Enumeration;
var logger = Log.ForContext<SomeContext>();
var pagerDutyClient = new PagerDutyClientV2(logger);
await pagerDutyClient.TriggerAlert(
"78e9279b9fa84b7b8e9f1ec7b9b85fef",
Severity.Critical,
"MyService",
"Some error.");
AcknowledgeAlert and ResolveAlert take the same arguments plus the deduplication key of the
alert that is being acknowledged or resolved.
Reading incidents and acknowledging or resolving them goes through the REST API, which needs an API token. That client has the same name as its namespace, so it needs a using alias or its full name.
using PagerDutyClient.Enumeration;
using RestClient = PagerDutyClient.PagerDutyClient;
var logger = Log.ForContext<SomeContext>();
var pagerDutyClient = new RestClient(logger, "y_NbAkKc66ryYTWUXYEu");
var incidents = await pagerDutyClient.GetIncidentsForService("PIJ90N7");
await pagerDutyClient.AcknowledgeAlert("PT4KHLK", "[email protected]");
The project can be found on nuget.
Install
dotnet add package HaemmerElectronics.SeppPenner.PagerDutyClient
Change history
See the Changelog.
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.