Skip to main content
Timeseries is configured through CLI arguments and a Prometheus-compatible YAML configuration file. The CLI arguments control server startup, while the YAML file defines scrape targets, storage backends, and operational parameters.

CLI Arguments

Pass these flags when starting the opendata-timeseries binary.
FlagEnvironment VariableDefaultDescription
-c, --configPROMETHEUS_CONFIG_FILEnonePath to the prometheus.yaml configuration file
-p, --portOPEN_TSDB_PORT9090Port to listen on
./opendata-timeseries --config prometheus.yaml --port 9090

Configuration File

The configuration file follows the Prometheus YAML format with additional sections for storage. The generic placeholders used in this reference are:
  • <string>: a regular string
  • <int>: an integer value
  • <duration>: a duration matching [0-9]+(ms|s|m|h|d) (e.g. 30s, 1m, 2h)
A value enclosed in [ ] is optional. The default value is shown after | default =.
# Default settings applied to all scrape jobs.
global:
  # How often to scrape targets.
  [ scrape_interval: <duration> | default = 15s ]

# List of scrape job configurations.
scrape_configs:
  [ - <scrape_config> ... ]

# Storage backend configuration (required).
storage:
  <storage_config>

# How often (in seconds) to flush data from memory to durable storage.
[ flush_interval_secs: <int> | default = 5 ]

<scrape_config>

Each scrape config defines a set of targets and the parameters for scraping them.
# Name for this scrape job. Added as the `job` label on all scraped metrics.
job_name: <string>

# Override the global scrape interval for this job.
[ scrape_interval: <duration> | default = <global.scrape_interval> ]

# List of static target groups to scrape.
static_configs:
  [ - <static_config> ... ]

<static_config>

A static config defines a list of targets and a common set of labels to apply.
# Endpoints to scrape in host:port format.
targets:
  [ - <string> ... ]

# Labels to attach to all metrics scraped from these targets.
labels:
  [ <string>: <string> ... ]

<storage_config>

Storage is tagged by type.
# The storage backend type.
type: <string> # One of: InMemory, SlateDb
Stores data in memory only. Data is lost on restart. Useful for testing and development. No additional fields are required.
storage:
  type: InMemory

<object_store_config>

The object store is tagged by type.
object_store:
  type: Local
  # Directory path for local storage.
  path: <string>

Examples

prometheus.yaml
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: "my-app"
    static_configs:
      - targets: ["localhost:9090"]

storage:
  type: SlateDb
  path: data
  object_store:
    type: Local
    path: ./data

flush_interval_secs: 5