Skip to main content

Post Tail Alerts to N1netails

In the context of N1netails, a tail alert refers to a lightweight, structured notification triggered by a client system (such as a service, application, or script) to report an event, issue, or anomaly. These alerts are designed to be easy to emit, fast to process, and rich in metadata β€” making them ideal for real-time monitoring, embedded systems, or edge environments.

🦊 Why β€œTail”?​

The term "tail" in n1netails plays on two ideas:

  1. Log tailing – Observing the last lines of logs (like tail -f) to detect anomalies in real-time.
  2. Fox tails (kitsune/ninetails) – Thematically tied to the project’s branding, each "tail" represents a meaningful signal from your system.

A tail alert is essentially your system saying:

"Something noteworthy just happened β€” here's what it is, and here’s the relevant context."


πŸ“‘ API Endpoint​

POST /ninetails/alert​

Sends a new alert to the N1netails API using a valid N1ne-Token.

πŸ” How to Get Your N1ne Token​

  1. Log in to the N1netails UI.
  2. Click your profile icon in the top-right corner.
  3. Select Account Settings.
  4. Navigate to N1ne Token Manager β†’ Create New Token.
  5. Generate token by setting Token Name, Organization (default n1netails), Expriration Date (Optional).
  6. Save token value as it will not be available later.

🧾 Request Headers​

Header NameDescriptionRequired
N1ne-TokenYour unique alert API tokenβœ… Yes
Content-TypeMust be application/jsonβœ… Yes

🧬 Request Body​

{
"title": "Tail Title",
"description": "Tail Description",
"details": "Tail details (place stack trace/logs here)",
"timestamp": "2025-07-02T20:00:00Z",
"level": "ERROR",
"type": "SYSTEM_ALERT",
"metadata": {
"region": "us-east-1",
"cluster": "db-primary",
"environment": "production"
}
}
FieldTypeDescription
titlestringShort title for the alert
descriptionstringOne-line summary of the issue
detailsstringThrowable stack trace or log data
timestampISO-8601 stringWhen the issue was detected (UTC recommended)
levelstringAlert severity (INFO, SUCCESS, WARN, ERROR, CRITICAL)
typestringCustom type/category for this alert
metadataobject (map)Additional key-value context for investigation

βœ… Example curl Request​

if you have n1netails running on your localhost you can replace https://app.n1netails.com/ninetails/alert with your local instance useually located at http://localhost:9901/ninetails/alert

curl -X POST https://app.n1netails.com/ninetails/alert \
-H "Content-Type: application/json" \
-H "N1ne-Token: YOUR_TOKEN_HERE" \
-d '{
"title": "Database Alert",
"description": "High latency observed",
"details": "The read queries in the US-East cluster have been above 2s for over 5 minutes.",
"timestamp": "2025-07-02T20:00:00Z",
"level": "ERROR",
"type": "SYSTEM_ALERT",
"metadata": {
"region": "us-east-1",
"cluster": "db-primary",
"environment": "production"
}
}'

Replace YOUR_TOKEN_HERE with your actual token.


🧠 Notes​

  • This endpoint returns 204 No Content on success.
  • Unauthorized requests return 401 Unauthorized and are logged internally.
  • Ensure the timestamp uses the UTC ISO-8601 format.