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:
- Log tailing β Observing the last lines of logs (like
tail -f
) to detect anomalies in real-time. - 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β
- Log in to the N1netails UI.
- Click your profile icon in the top-right corner.
- Select Account Settings.
- Navigate to N1ne Token Manager β Create New Token.
- Generate token by setting Token Name, Organization (default n1netails), Expriration Date (Optional).
π§Ύ Request Headersβ
Header Name | Description | Required |
---|---|---|
N1ne-Token | Your unique alert API token | β Yes |
Content-Type | Must 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"
}
}
Field | Type | Description |
---|---|---|
title | string | Short title for the alert |
description | string | One-line summary of the issue |
details | string | Throwable stack trace or log data |
timestamp | ISO-8601 string | When the issue was detected (UTC recommended) |
level | string | Alert severity (INFO , SUCCESS , WARN , ERROR , CRITICAL ) |
type | string | Custom type/category for this alert |
metadata | object (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.