|
34 | 34 | 3. Add graphite-clickhouse `host:port` to graphite-web [CLUSTER_SERVERS](http://graphite.readthedocs.io/en/latest/config-local-settings.html#cluster-configuration)
|
35 | 35 |
|
36 | 36 | ## Configuration
|
37 |
| -Create `/etc/graphite-clickhouse/rollup.xml` with same content as for ClickHouse. Short sample: |
38 |
| -```xml |
39 |
| -<graphite_rollup> |
40 |
| - <default> |
41 |
| - <function>avg</function> |
42 |
| - <retention> |
43 |
| - <age>0</age> |
44 |
| - <precision>60</precision> |
45 |
| - </retention> |
46 |
| - <retention> |
47 |
| - <age>2592000</age> |
48 |
| - <precision>3600</precision> |
49 |
| - </retention> |
50 |
| - </default> |
51 |
| -</graphite_rollup> |
52 |
| -``` |
53 |
| - |
54 |
| -For complex ClickHouse queries you might need to increase default query_max_size. To do that add following line to `/etc/clickhouse-server/users.xml` for the user you are using: |
55 |
| -```xml |
56 |
| -<!-- Default is 262144 --> |
57 |
| -<max_query_size>10485760</max_query_size> |
58 |
| -``` |
59 |
| - |
60 |
| -Create `/etc/graphite-clickhouse/graphite-clickhouse.conf` |
61 |
| -```toml |
62 |
| -[common] |
63 |
| -listen = ":9090" |
64 |
| -# Listener to serve /debug/pprof requests. `-pprof` argument would override it |
65 |
| -pprof-listen = "" |
66 |
| -max-cpu = 1 |
67 |
| -# How frequently to call debug.FreeOSMemory() to return memory back to OS |
68 |
| -# Setting it to zero disables this functionality |
69 |
| -memory-return-interval = "0s" |
70 |
| -# Limit number of results from find query. Zero = unlimited |
71 |
| -max-metrics-in-find-answer = 0 |
72 |
| -# Limit numbers of queried metrics per target in /render requests. Zero or negative are unlimited |
73 |
| -max-metrics-per-target = 15000 |
74 |
| -# Daemon returns empty response if query matches any of regular expressions |
75 |
| -# target-blacklist = ["^not_found.*"] |
76 |
| -# If this > 0, then once an interval daemon will return the freed memory to the OS |
77 |
| -memory-return-interval = "0s" |
78 |
| - |
79 |
| -[clickhouse] |
80 |
| -# You can add user/password (http://user:password@localhost:8123) and any clickhouse options (GET-parameters) to url |
81 |
| -# It is recommended to create read-only user |
82 |
| -url = "http://localhost:8123" |
83 |
| -# Add extra prefix (directory in graphite) for all metrics |
84 |
| -extra-prefix = "" |
85 |
| - |
86 |
| -# Default table with points |
87 |
| -data-table = "graphite" |
88 |
| -data-timeout = "1m0s" |
89 |
| -# Rollup rules xml filename. Use `auto` magic word for select rollup rules from ClickHouse |
90 |
| -rollup-conf = "/etc/graphite-clickhouse/rollup.xml" |
91 |
| - |
92 |
| -# Table with series list (daily and full) |
93 |
| -# https://github.com/lomik/graphite-clickhouse/wiki/IndexTable |
94 |
| -index-table = "graphite_index" |
95 |
| -# Use daily data from index table. This is useful for installations with big count of short-lived series but can be slower in other cases |
96 |
| -index-use-daily = true |
97 |
| -# Allow use reverse queries with minimal depth |
98 |
| -# -1 - disable |
99 |
| -# 0 - disable if no wildcard at first level |
100 |
| -# 1 - allow for example a.b.c*.d and a.b*.c.d queries (default) |
101 |
| -# 2 - allow a.b*.c.d) to index table. |
102 |
| -# This is useful when reverse queries has bad perfomance |
103 |
| -index-reverse-depth = 1 |
104 |
| -# overwrite default index-use-reverse for metrics with prefix/suffix/regular_expression checks against target (not used when index-use-reverse = -1) |
105 |
| -#index-reverses = [ |
106 |
| -# { suffix = ".p99", reverse = 2 }, |
107 |
| -# { suffix = ".avg", reverse = 2 }, |
108 |
| -# { suffix = ".gc.gen1", reverse = 0 }, |
109 |
| -# { prefix = "Test.", suffix = ".cpu", reverse = 2 }, |
110 |
| -# { regex = "\\.gc\\.(heap|gen)[0-9]+$", reverse = 0 } |
111 |
| -#] |
112 |
| -index-reverses = [] |
113 |
| -index-timeout = "1m0s" |
114 |
| - |
115 |
| -# `tagged` table from carbon-clickhouse. Required for seriesByTag |
116 |
| -tagged-table = "" |
117 |
| -# For how long the daemon will query tags during autocomplete |
118 |
| -tagged-autocomplete-days = 7 |
119 |
| - |
120 |
| -# Old index tables. DEPRECATED |
121 |
| -tree-table = "graphite_tree" |
122 |
| -# Optional table with daily series list. |
123 |
| -# Useful for installations with big count of short-lived series |
124 |
| -date-tree-table = "" |
125 |
| -# Supported several schemas of date-tree-table: |
126 |
| -# 1 (default): table only with Path, Date, Level fields. Described here: https://habrahabr.ru/company/avito/blog/343928/ |
127 |
| -# 2: table with Path, Date, Level, Deleted, Version fields. Table type "series" in the carbon-clickhouse |
128 |
| -# 3: same as #2 but with reversed Path. Table type "series-reverse" in the carbon-clickhouse |
129 |
| -date-tree-table-version = 0 |
130 |
| -tree-timeout = "1m0s" |
131 |
| - |
132 |
| -connect-timeout = "1s" |
133 |
| - |
134 |
| -# Sets the maximum for maxDataPoints parameter. |
135 |
| -# If you use CH w/o https://github.com/ClickHouse/ClickHouse/pull/13947, you have to set it to 4096 |
136 |
| -max-data-points = 4096 |
137 |
| -# Use metrics aggregation on ClickHouse site. |
138 |
| -# This feature is very useful, read https://github.com/lomik/graphite-clickhouse/wiki/ClickHouse-aggregation-VS-graphite%E2%80%94clickhouse-aggregation |
139 |
| -internal-aggregation = false |
140 |
| - |
141 |
| -[prometheus] |
142 |
| -# The URL under which Prometheus is externally reachable (for example, if Prometheus is served via a reverse proxy). Used for |
143 |
| -# generating relative and absolute links back to Prometheus itself. If the URL has a path portion, it will be used to prefix all |
144 |
| -# HTTP endpoints served by Prometheus. If omitted, relevant URL components will be derived automatically. |
145 |
| -external-url = "" |
146 |
| -page-title = "Prometheus Time Series Collection and Processing Server" |
147 |
| - |
148 |
| -[carbonlink] |
149 |
| -server = "" |
150 |
| -threads-per-request = 10 |
151 |
| -connect-timeout = "50ms" |
152 |
| -query-timeout = "50ms" |
153 |
| -total-timeout = "500ms" |
154 |
| - |
155 |
| -# You can define multiple data tables (with points). |
156 |
| -# The first table that matches is used. |
157 |
| -# |
158 |
| -# # Sample, archived table with points older 30d |
159 |
| -# [[data-table]] |
160 |
| -# table = "graphite_archive" |
161 |
| -# min-age = "720h" |
162 |
| -# |
163 |
| -# # All available options |
164 |
| -# [[data-table]] |
165 |
| -# # clickhouse table name |
166 |
| -# table = "table_name" |
167 |
| -# # points in table are stored with reverse path |
168 |
| -# reverse = false |
169 |
| -# # Custom rollup.xml for table. |
170 |
| -# # Magic word `auto` can be used for load rules from ClickHouse |
171 |
| -# # With value `none` only rollup-default-precision and rollup-default-function will be used for rollup |
172 |
| -# rollup-conf = "" |
173 |
| -# # Which table to discover rollup-rules from. If not specified - will use what specified in "table" parameter. |
174 |
| -# # Useful when reading from distributed table, but the rollup parameters are on the shard tables. |
175 |
| -# # Can be in "database.table" form. |
176 |
| -# rollup-auto-table = "" |
177 |
| -# # Use unreversed metric name to discover rollup-rules. If not specified - use as is (reversed metric name). |
178 |
| -# # Use if unreversed rules is used. |
179 |
| -# # Ignored for non-reverse tables (unreversed metric names used always) |
180 |
| -# rollup-use-reverted = false |
181 |
| -# # Sets the default precision and function for rollup patterns which don't have age=0 retention defined. |
182 |
| -# # If age=0 retention is defined in the rollup config then it takes precedence. |
183 |
| -# # If left at the default value of 0 then no rollup is performed when the requested interval |
184 |
| -# # is not covered by any rollup rule. In this case the points will be served with 60 second precision. |
185 |
| -# rollup-default-precision = 60 |
186 |
| -# rollup-default-function = "avg" |
187 |
| -# # from >= now - {max-age} |
188 |
| -# max-age = "240h" |
189 |
| -# # until <= now - {min-age} |
190 |
| -# min-age = "240h" |
191 |
| -# # until - from <= {max-interval} |
192 |
| -# max-interval = "24h" |
193 |
| -# # until - from >= {min-interval} |
194 |
| -# min-interval = "24h" |
195 |
| -# # regexp.Match({target-match-any}, target[0]) || regexp.Match({target-match-any}, target[1]) || ... |
196 |
| -# target-match-any = "regexp" |
197 |
| -# # regexp.Match({target-match-all}, target[0]) && regexp.Match({target-match-all}, target[1]) && ... |
198 |
| -# target-match-all = "regexp" |
199 |
| - |
200 |
| -[debug] |
201 |
| -# The directory for debug info. If set, additional info may be saved there |
202 |
| -directory = "/var/log/graphite-clickhouse/debug" |
203 |
| -directory-perm = "0755" |
204 |
| -# File permissions for external data dumps. Enabled only if !=0, see X-Gch-Debug-External-Data header |
205 |
| -# Format is octal, e.g. 0640 |
206 |
| -external-data-perm = "0644" |
207 |
| - |
208 |
| -[[logging]] |
209 |
| -logger = "" |
210 |
| -file = "/var/log/graphite-clickhouse/graphite-clickhouse.log" |
211 |
| -level = "info" |
212 |
| -encoding = "mixed" |
213 |
| -encoding-time = "iso8601" |
214 |
| -encoding-duration = "seconds" |
215 |
| -``` |
| 37 | +See [configuration documentation](./doc/config.md). |
216 | 38 |
|
217 | 39 | ### Special headers processing
|
218 | 40 |
|
|
0 commit comments