Skip to content

Activity & Telemetry

tunlx records what's happening across every proxy in real time. The Activity & Telemetry modal in the dashboard is the live view; the same data is available over HTTP for scripting and dashboards.

Activity and telemetry

What you can see

Bandwidth Per-proxy totals, current bytes-per-second, and short-interval deltas. Counters flush at 64KB so even low-bandwidth streams report quickly.

User activity log The last 200 events that match your configured audit policies — Xtream API calls, playlist fetches, and stream playback.

Non-proxy logs Live tail of EPG, MediaFlow bridge, Xtream helpers, and background workers — handy when stream issues don't show up on the proxy itself.

Outbound IP probe VPN-aware and non-VPN-aware checks shown side-by-side so you can see what each route mode actually resolves to.

User activity policies

Policies tell tunlx which calls to record. They keep the log focused instead of drowning in routine traffic.

{
  "verboseUserActivityLogging": true,
  "userActivityPolicies": [
    {
      "proxy": "exampleProxy1",
      "username": "*",
      "actions": ["player_api:account", "stream:live"]
    },
    {
      "proxy": "favorites",
      "proxyType": "composite",
      "username": "suspicious_user",
      "actions": ["*"]
    }
  ]
}
Field Notes
proxy Name of the proxy / composite / Xtream service.
proxyType Optional disambiguation when names collide across types.
username Xtream username to track; case-insensitive. * matches all users.
actions List of action selectors (see below).

Action selectors

Selector Matches
* Any API call covered by the policy framework
player_api Any player_api.php action (wildcard for player_api:*)
player_api:account Account / login checks
player_api:default Player API calls with no action parameter
player_api:get_live_streams Live stream list
player_api:get_vod_streams VOD stream list
player_api:get_series Series list
player_api:get_live_categories Live categories
player_api:get_vod_categories VOD categories
player_api:get_series_categories Series categories
player_api:get_short_epg Short EPG
player_api:get_simple_data_table Full EPG table
player_api:other Any other player API action
playlist:get get.php playlist requests
stream:live Live stream playback
stream:vod VOD playback
stream:series Series episode playback

No stream wildcard

player_api covers all player_api:* actions, but there is no stream wildcard. To capture all playback, list stream:live, stream:vod, and stream:series individually.

playlist:get, not get.php

Use playlist:get (or playlist) — get.php is normalized internally and won't match if you configure it literally.

Toggle logging at runtime

The Activity & Telemetry modal has two switches:

  • Non-proxy logs — flips verboseNonProxyLogging. Affects EPG, MediaFlow bridge, and other background workers.
  • User activity logs — flips verboseUserActivityLogging. Without this flag, even matching policies don't record events. It also turns verbose logging on or off for every proxy, which the dialog says under the switch.

Both persist back to config.json. A capture rule saved while the user activity switch is off is kept, and the dialog tells you nothing shows until the switch is on.

The viewers list

With logging on and a capture rule that matches the stream requests, the dialog lists everyone watching right now: the proxy, the viewer and the address they connect from, the stream, the route, when it started and when it was last seen.

  • The filter above the list is the same filter as the Search box in the dialog's filters; typing in either shows in both.
  • Refresh asks the server straight away. The dialog also asks every five seconds while it is open, and not at all while it is closed.
  • Export CSV saves the rows on screen, after your filters, and the line beside it counts the same rows ("2 viewers • 2 streams"). A cell that starts with =, +, - or @ is saved with a leading ' so a spreadsheet shows it as text instead of running it.

With logging off the list says so and offers a button that turns it on. With it on and nobody watching it says "Nobody is watching right now."

Host metrics

The /metrics endpoint returns host-level stats — CPU, memory, and network-interface counters:

{
  "cpu": 12.4,
  "memory": {
    "total": 16690954240,
    "available": 9345986560,
    "used": 6987325440,
    "usedPercent": 41.9
  },
  "networkIO": [
    { "name": "eth0", "bytesSent": 48239448212, "bytesRecv": 1592384901733 }
  ]
}

Additional fields from the underlying gopsutil structs are included verbatim. The endpoint is deliberately unauthenticated — the container health check depends on it — so keep the dashboard port off the public internet. Per-proxy bandwidth and stream counters appear on the dashboard's proxy cards and in this modal, not on /metrics.

When to enable verbose user activity logging

Good cases:

  • Onboarding a new user — confirm their client is actually logging in and pulling playlists.
  • Diagnosing one specific user's complaint — set a policy scoped to their username with actions: ["*"].
  • Audit trails for resold panels — log stream:* so you can prove what played and when.

Bad cases:

  • Always-on, wildcard everything. The log only keeps the last 200 events; broad filters mean you'll miss the one you actually wanted.