Skip to content
Anton Zelenin edited this page Apr 26, 2022 · 3 revisions

Source file config

Property Type Description
type String Specify source type. Value - thanos
name String Unique source name - also the config file name
config Object Source configuration

All properties are required

config object properties:

Property Type Required Description
url String yes Thanos query URL, e.g. https://thanos:8080
username String no username
password String no password
verify_ssl Boolean no whether to verify SSL certificate when connecting via HTTPS, default: true
query_timeout Integer no VictoriaMetrics query timeout in seconds, 15 by default

Example

[
  {
  "name": "test_thanos",
  "type": "thanos",
  "config": {
    "url": "http://thanos:8080",
    "username": "",
    "password": ""
  }
}
]
> agent source create -f filename.json

Pipeline config

Example of a query: {__name__=~"log.*"}[10s] - this query will return all metrics which names start with log and are in the range of 10 seconds before the specified timestamp (the timestamp is passed as a part of a query request sent to Thanos). Query docs

Pipeline File config

Properties list

Property Required Property name in config file Value type in config file Description
Source yes source String Source config name
Pipeline ID yes pipeline_id String Unique pipeline identifier (use human-readable name so you could easily use it further)
Query yes query String Query to export data from Thanos, query may contain any PromQL selector
Aggregated metric name no aggregated_metric_name String The name that will be applied to query results that aggregate multiple metrics (for example increase() or rate() functions)
Collect since yes days_to_backfill Integer Collect data starting N days ago
Query interval yes interval Integer Query data every N seconds
Delay no delay Integer Collect data with a specified delay, e.g. the pipeline will retrieve data until now -(minus) delay, it will not fetch the latest data immediately, unit - minutes
Static dimensions no properties Object with key-value pairs Dimensions with static values to pass to Anodot.
Tags no tags Object with key-value pairs Tags

Examples

Simple:

[{
  "query": "match[]={__name__!=\"\"}",
  "days_to_backfill": 3,
  "interval": 10,
  "pipeline_id": "test_thanos",
  "source": "test_thanos"
}]

Advanced:

[{
  "query": "match[]={__name__!=\"\"}",
  "days_to_backfill": 3,
  "interval": 10,
  "pipeline_id": "test_thanos",
  "source": "test_thanos",
  "aggregated_metric_name": "my_metric",
  "delay": 10,
  "properties": { "version": "1" },
  "tags": { "env": "prod" }
}]
> agent pipeline create -f filename.json
Clone this wiki locally