forked from veepee-oss/influxdb-relay
-
Notifications
You must be signed in to change notification settings - Fork 26
/
prom-multitenant.influxdb-srelay.conf
85 lines (68 loc) · 2.29 KB
/
prom-multitenant.influxdb-srelay.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
###############################
##
## InfluxDB Single instances Config
##
###############################
# InfluxDB Backend InfluxDB01
[[influxdb]]
name = "influxdb01"
location = "http://127.0.0.1:8086/"
timeout = "10s"
# InfluxDB Backend InfluxDB02
[[influxdb]]
name = "influxdb02"
location = "http://127.0.0.1:8087/"
timeout = "10s"
#################################
##
## InfluxDB Cluster Configs as a set
## of influxdb Single Instances
##
#################################
# Cluster for Container As A Service Metrics
[[influxcluster]]
name = "cluster_k8s"
members = ["influxdb01","influxdb02"]
log-file = "cluster_k8s.log"
log-level = "debug"
type = "HA"
# HTTP Server
[[http]]
name = "http-k8s-multitenancy"
bind-addr = "0.0.0.0:9096"
log-file = "http_relay_9096.log"
log-level = "debug"
access-log = "access.log"
## Define endpoints base config
## endpoints can have read and write properties
## Example: /query endpoint
## There are 2 routes that must do a read query against a cluster
## It expects that each HTTP request tries each route. If it fits the filter it will be enrouted
## All requests that doesn't pass through the filter tries the next route
[[http.endpoint]]
uri=["/api/v1/prom/write"]
source_format="prom-write"
type = "WR"
## WRITE request - k8s_METRICS
[[http.endpoint.route]]
name="k8s_metrics"
level="data" ## Only for Rules , filter should be processed at HTTP level (route will apply on all data)
## Filter only k8s METRICS and let pass to the following config
[[http.endpoint.route.filter]]
name="pass_k8s_metrics"
key="db"
match=".*"
## Change database based on tag
[[http.endpoint.route.rule]]
name="to_namespace_metrics"
#transformation for
action="route_db_from_data"
key="tag"
key_aux="namespace"
match="(.*)"
# value will set the db name for points matching tag namespace exist and match `match`
# IMPORTANT: this rule only routes points if database name doesn't exist it won't create it!
value="$1"
# value_on_unmatch will set the db for those points that doesn't have tag namespace or it doesn't match
value_on_unmatch="other_db"
to_cluster="cluster_k8s"