Skip to content

Data sources ​

A data source is an external endpoint that Lumberjack fetches on an interval, for screen widgets to show: a number from a JSON API, a Prometheus metric, or the events of a calendar.

Where to find them ​

Data sources belong to a project. Team owners and admins open them from the project's settings menu, under Data sources. Members see Data sources in the sidebar and can read the list, but not change it. A widget on any screen of the team can use the data sources of every project in the team.

Adding a data source ​

  1. Click Add data source and fill in the form:

    FieldWhat to enter
    NameA name to pick it by in widgets.
    URLAn http or https address that Lumberjack sends a GET request to. It must be public.
    FormatJSON, Prometheus or iCalendar (.ics). See Formats.
    IntervalHow often to fetch it, in minutes. At least 1.
    TimeoutHow long to wait for an answer, in seconds. At most 15.
    Request headersOptional headers sent with each request, such as Authorization: Bearer ….
  2. Click Add. The source is fetched within a minute.

Put credentials in a header, not in the URL. A URL with a user name or password is rejected.

Request headers ​

Header values are stored encrypted and never shown again. When editing a source, leave a value empty to keep it.

Headers are sent only to the server in the URL, not after a redirect to another server. When you edit the URL to point at another server, give each header its value again.

WARNING

Header values are encrypted with APP_KEY. When APP_KEY changes, a source with headers fails with "Its header values cannot be decrypted". Save its header values again.

Formats ​

  • JSON: any JSON answer. A widget picks a value from it with a JSONPath, such as $.data.total.
  • Prometheus: the Prometheus text format, as served on /metrics. A widget picks a metric with a selector, such as http_requests_total{status="500"}. Counters are shown per minute.
  • iCalendar (.ics): a calendar feed, for a list of events or a countdown. Use the calendar's secret address in iCal format from Google, Outlook or iCloud. A webcal:// address works too.

The list ​

Each source shows:

  • its name, format and URL. Values in the URL's query are hidden as ***, and for a calendar the path too.
  • the names of its headers;
  • Latest response: the start of the last answer;
  • its Status: Pending before the first fetch, then OK or Failed;
  • the Last fetch, and for a failed source the error and when it was Last OK;
  • its Interval.

Team owners and admins can Fetch now, Edit and Delete a source. Widgets that show a deleted source go empty.

When a fetch fails ​

A failed fetch marks the source Failed and shows why:

ErrorWhat to do
The server answered HTTP 401 (or another status)Check the URL and the headers.
The response is larger than 1024 KB (4096 KB for iCalendar)Point the URL at a smaller answer.
The response is not valid JSONCheck the URL, or pick another format.
The response has no Prometheus samplesUse the text format, lines like name{label="value"} 1.
The response is not an iCalendar feedUse an address that answers with text starting BEGIN:VCALENDAR.
Its header values cannot be decryptedSave the header values again.
A connection error or timeoutCheck that the server is reachable and answers within the timeout.

Widgets keep showing the last good answer.

Private addresses ​

Like health checks, a data source must reach a public address. A URL that resolves to a private, loopback or otherwise reserved address is rejected, also after a redirect. To fetch from internal services, set:

dotenv
LUMBERJACK_HEALTH_ALLOW_PRIVATE=true

Using a data source in a widget ​

In the screen designer, pick the widget, then the source under Data source:

  • A stat, gauge, chart or list reads a JSON source with a JSONPath, or a Prometheus source with a Selector. See External JSON.
  • A list with Calendar events, or a countdown, reads an iCalendar source. See Calendars and Countdown.

Charts read the source's history: each answer up to 64 KB is kept, 30 days by default. See retention, under Data source history.

Limits ​

WhatLimit
Name150 characters
URL2000 characters
Interval1 to 1440 minutes
Timeout1 to 15 seconds
Request headers20
Answer size1 MB, 4 MB for an iCalendar feed
Answer kept for charts64 KB. Larger answers are only used as latest
Redirects3
Fetch now10 a minute