Commit Graph

38 Commits

Author SHA1 Message Date
Vincent Bernat
88b27a83e6 console: fix use of aliased columns in dimensions
By default, `SELECT *` does not select ALIAS columns. Add the
appropriate settings to modify this.

Fix #541
2023-03-03 08:27:39 +01:00
Vincent Bernat
63267f0f5b console: enable SrcAddr/DstAddr truncation to a fixed length 2023-02-22 20:55:21 +01:00
Vincent Bernat
e4c3a6b723 console: move /sankey and /graph to /graph/sankey and /graph/line
Also rename stuff to GraphSankey and GraphLine for consistency.
2023-02-22 20:54:58 +01:00
Vincent Bernat
a912da7fa1 build: use gofumpt
Undecided if we need to use it. I think it's nice.
2023-02-11 10:03:45 +01:00
Vincent Bernat
9bc7f44f0a console/graph: also invert unit direction on bidirectional 2023-02-09 23:27:03 +01:00
Vincent Bernat
c6a9319b57 common/schema: turns into a component
This is a first step to make it accept configuration. Most of the
changes are quite trivial, but I also ran into some difficulties with
query columns and filters. They need the schema for parsing, but parsing
happens before dependencies are instantiated (and even if it was not the
case, parsing is stateless). Therefore, I have added a `Validate()`
method that must be called after instantiation. Various bits `panic()`
if not validated to ensure we catch all cases.

The alternative to make the component manages a global state would have
been simpler but it would break once we add the ability to add or
disable columns.
2023-01-18 12:22:10 +01:00
Vincent Bernat
727807b937 common/schema: use a symbol to identify columns 2023-01-17 20:53:00 +01:00
Vincent Bernat
a30024cfa1 console: use common/schema for dimensions
This is a bit less type-safe. We could keep type safety by redefining
all the consts in `query_consts.go` in `common/schema`, but this is
pointless as the goal is to have arbitrary dimensions at some point.
2023-01-03 18:40:19 +01:00
Vincent Bernat
672d632a5a console: use INTERPOLATE to fill values when no value present
This dump the requirement on ClickHouse to 22.4. Use 22.8 LTS. This
should also fix a memory leak (not yet fixed in 22.3).
2022-09-08 15:43:27 +02:00
Vincent Bernat
3e3bcbdada http: use a method to get local address
And limit its export to testing.
2022-08-21 08:20:14 +02:00
Vincent Bernat
454a3eb9d3 console: add "previous period" mode
This displays a line for the previous period on stacked graphs.
Previous period depends on the current period. It could be hour, day,
week, month, or year.
2022-08-09 21:40:06 +02:00
Vincent Bernat
8e755ae0e1 console: ensure we fill missing values including the last one
BETWEEN is inclusive, while FILL excludes the upper bound. This may
trigger a subtle bug where sometimes, one axis has one value the other
does not have.
2022-08-09 19:16:16 +02:00
Vincent Bernat
67703cc61e console: use templates to build SQL query
This is needed if we want to be able to mix use of several tables
inside a single query (for example, flows_1m0s for a part of the query
and flows_5m0s for another part to overlay historical data).

Also, the way we handle time buckets is now cleaner. The previous way
had two stages of rounding and was incorrect. We were discarding the
first and last value for this reason. The new way only has one stage
of rounding and is correct. It tries hard to align the buckets at the
specified start time. We don't need to discard these values anymore.
We still discard the last one because it could be incomplete (when end
is "now").
2022-08-09 11:45:40 +02:00
Vincent Bernat
b745cfd356 console: fix test about reverse filter direction 2022-08-08 09:42:27 +02:00
Vincent Bernat
50614cef5b console: add a bidirectional mode for graphs
It allows one to also display flows in the opposite direction.
2022-08-07 23:15:18 +02:00
Vincent Bernat
1aa260bae2 console/filter: let parser tells us if we need the main table or not
This is more robust this way. We also introduce the ability to reverse
the direction of a filter.
2022-08-04 18:54:41 +02:00
Vincent Bernat
fad0c5db16 console: simplify SQL request by computing target resolution in Go 2022-07-26 23:51:32 +02:00
Vincent Bernat
f5e2e85d0d console: fix a possible divide by 0 error
This is not the only problem we have.
2022-07-09 08:42:42 +02:00
Vincent Bernat
418bf5176e console: exclude 0 from minimum value 2022-07-08 15:36:12 +02:00
Vincent Bernat
412bb1f535 console: fill missing values with 0 for timeseries graphs 2022-07-08 09:43:09 +02:00
Vincent Bernat
8be1bca4fd license: AGPL-3.0-only
```
git ls-files \*.js \*.go \
  | xargs sed -i '1i // SPDX-FileCopyrightText: 2022 Free Mobile\n// SPDX-License-Identifier: AGPL-3.0-only\n'
git ls-files \*.vue \
  | xargs sed -i '1i <!-- SPDX-FileCopyrightText: 2022 Free Mobile -->\n<!-- SPDX-License-Identifier: AGPL-3.0-only -->\n'
```
2022-06-29 11:42:28 +02:00
Vincent Bernat
bf0c474726 console: implement "filter/saved" endpoints 2022-06-13 09:50:43 +02:00
Vincent Bernat
b65d78ab1b console: turn authentication into a proper component 2022-06-09 19:55:57 +02:00
Vincent Bernat
a1ff21eb09 console: ability to display L2 bps in addition to L3 bps 2022-06-03 11:47:38 +02:00
Vincent Bernat
f5252ce077 console: rework a bit user management
Notably, HTTP headers are configurable and a provider is used for the
frontend side.
2022-05-31 17:03:00 +02:00
Vincent Bernat
2d4f5214bd tests: handle JSON in TestHTTPEndpoints 2022-05-26 10:40:55 +02:00
Vincent Bernat
be444652f0 console: ability to get values in pps instead of bps 2022-05-24 20:34:23 +02:00
Vincent Bernat
eb75dc40ac console: add 95th percentile 2022-05-24 19:46:41 +02:00
Vincent Bernat
375a0fe88f console: split graph.go into query.go and graph.go
We will introduce more query types.
2022-05-21 19:53:08 +02:00
Vincent Bernat
c23e5c1687 console/frontend: use static generated content for fields
This is more reliable and efficient but it also remove a bug with
equality comparison failing and thus inability to remove entries.
Also, sorted exactly as we want.
2022-05-18 08:49:03 +02:00
Vincent Bernat
44ab2c380c console: use a parser to parse filter
An AST is not that useful for us. We just need to validate and
transform to proper SQL a filter string. Since it is SQL-like, this is
not hard to do.
2022-05-16 18:29:46 +02:00
Vincent Bernat
34f153d9cd console: dynamically fetch available dimensions 2022-05-16 10:19:53 +02:00
Vincent Bernat
eefd7088b9 console: remove /fields endpoint as we don't use it 2022-05-15 15:24:50 +02:00
Vincent Bernat
04d818e00f console/frontend: add a selector for dimensions 2022-05-15 15:19:55 +02:00
Vincent Bernat
eeb6da5730 console: rename max-series to limit 2022-05-12 14:27:18 +02:00
Vincent Bernat
31aca4c73b console: ensure "Other" is last when returning data 2022-05-12 14:27:18 +02:00
Vincent Bernat
d2cc5f1953 console: ensure we don't return more than max-series
We weren't matching only the top series, but any combination of
columns matching the top series. Fix that.
2022-05-12 14:27:18 +02:00
Vincent Bernat
2319262340 console: add visualize tab
Currently, there is no controls available.
2022-05-12 14:27:18 +02:00