Expand description
Post incidents to the Oppex incident API.
POST https://api.oppex.ai/api/v1/incident/postCreate one IncidentClient per application, share it across threads, and
let it drop (or call IncidentClient::close) during shutdown.
use oppex_sdk::{IncidentClient, IncidentRequest, Severity};
let client = IncidentClient::builder()
.api_key("api-key")
.service_key("service-key")
.build()?;
let request = IncidentRequest::builder()
.title("Checkout latency breached the SLO")
.source("checkout-api")
.severity(Severity::High)
.build()?;
let response = client.post(&request)?;
println!("created {:?}", response.incident_id());The service key is optional. A client built with only an API key posts with
IncidentClient::post_with_service_routing, which omits serviceKey from
the payload so the API resolves the target service itself.
Structs§
- Incident
Client - Posts incidents to Oppex.
- Incident
Client Builder - Builds a reusable
IncidentClient. - Incident
Request - A validated, immutable incident submission.
- Incident
Request Builder - Builds a validated
IncidentRequest. - Incident
Response - The result of a delivered incident.
Enums§
- Incident
Error - Every failure this SDK reports.
- Severity
- Oppex incident severity, on a scale from 1 (lowest) to 5 (highest).
Constants§
- DEFAULT_
ENDPOINT - The Oppex incident endpoint every client posts to.
- NO_
STATUS_ CODE - The status code reported when a delivery failed before any HTTP status line was received.
- VERSION
- The SDK version, as
MAJOR.MINOR.PATCH. Read from the crate’s own manifest, so it cannot drift from the published version.