Monitoring

Logs monitor

Send your application logs to Uptiva and alert on errors, a message, or silence.

What it checks

Your application sends logs to Uptiva. A Logs monitor counts the logs of one service in a time window and alerts when matching logs reach a number you set, or when no matching logs arrive. It is evaluated every minute.

Before you start

  • Plan. Logs need the Business plan. They are not on Free or Pro. Without it the Logs tile shows Not on your plan and sending logs is refused.
  • Daily quota. The plan sets how many megabytes you may send per day. The Business default is 200 MB per day; Uptiva can change it for your account. The API page shows today's usage.
  • Privacy. See the privacy notes at the end of this page.

Step 1: create a log token

  1. Open /app and go to API in the menu.
  2. In the Log sources card enter a Token name (for example production) and click Create log token.
  3. Copy the token now. It starts with upl_ and is shown only once. Treat it like a password: keep it in your secret store, not in code.
  4. You can have up to 5 tokens, one per application or environment. Revoke a token from the same card; anything still using it is then refused.

Step 2: send logs

Send a POST request with JSON to https://uptiva.linuxmaster.cloud/api/ingest/logs. Put the token in the Authorization: Bearer header (the header X-Uptiva-Token also works). A successful request answers 202 with {"accepted": 1}.

curl

Example
curl -fsS -X POST https://uptiva.linuxmaster.cloud/api/ingest/logs \
  -H "Authorization: Bearer upl_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"logs":[{"message":"payment failed","level":"error","attributes":{"order":"o-1"}}],"service":"checkout"}'

JavaScript

Example
await fetch("https://uptiva.linuxmaster.cloud/api/ingest/logs", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.UPTIVA_LOG_TOKEN,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    service: "checkout",
    logs: [{ message: "payment failed", level: "error", attributes: { order: "o-1" } }],
  }),
});

Python

Example
import os, requests

requests.post(
    "https://uptiva.linuxmaster.cloud/api/ingest/logs",
    headers={"Authorization": "Bearer " + os.environ["UPTIVA_LOG_TOKEN"]},
    json={
        "service": "checkout",
        "logs": [{"message": "payment failed", "level": "error", "attributes": {"order": "o-1"}}],
    },
    timeout=10,
)

Fields

FieldMeaning
serviceName of the application, for example checkout. Letters, digits, dots, dashes and underscores. A service is created the first time you use a new name. You can have up to 10 services. If you send none, the logs go to a service called default.
logs[].messageThe log line. Up to 8 KiB; longer text is cut.
logs[].leveltrace, debug, info, warn, error or fatal. Also accepted: warning, information, err, critical. A missing level means info.
logs[].attributesExtra key/value details, for example {"order": "o-1"}. Up to 20 per log; keys up to 64 characters, values cut at 512.
logs[].timeOptional ISO time or epoch milliseconds. Times older than 7 days or more than 5 minutes ahead are replaced by now.

OpenTelemetry

An OpenTelemetry collector or SDK can send OTLP/HTTP with a JSON body to https://uptiva.linuxmaster.cloud/api/ingest/otlp/v1/logs. Protobuf is not supported. Gzip-compressed bodies (Content-Encoding: gzip) are accepted. With the standard environment variables:

Example
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://uptiva.linuxmaster.cloud/api/ingest/otlp/v1/logs
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/json
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20upl_YOUR_TOKEN
OTEL_SERVICE_NAME=checkout

Limits and responses

LimitValue
Request size256 KiB (also after unzipping)
Logs per request500
Message8 KiB
Attributes20 per log
Requests120 per minute per token
Services10
Tokens5
Daily quotaSet by your plan (Business default: 200 MB per day). Counted by request size, resets at midnight UTC.
RetentionLogs are kept for 7 days

StatusMeaning
202Accepted. Logs appear within a few seconds.
401The token is missing, wrong or revoked.
403Your plan does not include logs.
413Too large: over 256 KiB, or more than 500 logs in one request.
415Content-Encoding is not gzip.
422The body is not valid, is protobuf, or you reached the 10-service limit.
429Too many requests (120 per minute per token) or the daily quota is used up. Wait for the Retry-After time. A refused request is not counted.

Logs are passed on in the background. If Uptiva is restarted or overloaded, logs still waiting can be lost, so do not use logs as your only record of something important.

Step 3: create the monitor

  1. Open /app and click New monitor.
  2. Under What to monitor choose Logs. Enter a Name.
  3. Under Logs to watch choose the Service. Pick one that has received logs, or choose New service and type the name you will send.
  4. Look at the last: 1 minute, 5 minutes, 15 minutes, 30 minutes or 1 hour. The window is re-checked every minute.
  5. Levels to count: Trace, Debug, Info, Warning, Error, Fatal. Leave all off to count every level.
  6. Text the log must contain (optional): plain text, not case sensitive, for example payment failed. It is not a pattern.
  7. Alert when: Matching logs reach a number and set Number of logs (1 alerts on the first matching log), or No matching logs arrive.
  8. Under Alerts choose where alerts go. Click Create monitor.

Two examples

  • Error spike. Service checkout, levels Error and Fatal, window 5 minutes, alert when matching logs reach 5.
  • App went silent. Service worker, all levels, window 15 minutes, alert when No matching logs arrive.

Check interval

There is no interval to choose. A Logs monitor is evaluated every minute. Windows overlap, so after a burst the count stays high for up to one window and the recovery comes that much later.

What the monitor page shows

  • Logs card: what the monitor alerts on, Matching logs in the current window, Last log received and Last counted.
  • Send logs card: the address, a curl example and the OpenTelemetry settings.
  • Log token card to create or revoke tokens, with today's usage.

Alerts

Alerts work like for any other monitor: the monitor goes down when the condition is met and recovers when it is not. Alert after counts consecutive one-minute evaluations. Channels, quiet hours, reminders and escalation are described in Alerts.

Privacy

  • Do not send passwords, tokens, card numbers or personal data in logs. Remove or mask them before sending.
  • Logs are kept for 7 days.
  • Logs are stored by Uptiva and the operator of Uptiva can access stored logs.
  • Other customers cannot see your logs: a monitor only reads the logs of its owner's own services.

Troubleshooting

ProblemWhat to check
401 Invalid log tokenThe token is wrong, has a typo or was revoked. Create a new one on the API page.
403 Your plan does not include logsLogs need the Business plan.
429 Daily log quota reachedYou used the day's quota. It resets at midnight UTC. Send fewer or shorter logs, or ask for a higher quota.
429 Too many requestsMore than 120 requests per minute with one token. Send logs in batches (up to 500 per request).
Monitor is Offline in No matching logs arrive modeZero matching logs counts as none received. This also happens when the service has never received logs, or the service name differs: it must be spelled as in the monitor.
Count stays 0Check the service name, the levels and the search text. Logs appear within a few seconds; the count refreshes every minute.
The Logs tile is greyed outYour plan does not include logs.