aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-01-13 12:34:24 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-13 12:34:24 +0100
commitde4bc8abc45dd85518e1458f11bbe1713d5bbb20 (patch)
tree5ca55fc8e64987da98ffd78767d06eb77807817f
parentf8d21c8b375641f8a134cff88f5a5efaa8a17e38 (diff)
downloadtricot-de4bc8abc45dd85518e1458f11bbe1713d5bbb20.tar.gz
tricot-de4bc8abc45dd85518e1458f11bbe1713d5bbb20.zip
Add info about logs
-rw-r--r--README.md17
1 files changed, 13 insertions, 4 deletions
diff --git a/README.md b/README.md
index 0b758b7..9db077d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Tricot
+# Tricot
Tricot is a reverse-proxy for exposing your services via TLS that integrates well with Consul and Nomad.
@@ -13,7 +13,7 @@ Tricot does the following things:
- Load-balance incoming requests among different available backends, or redirect all requests to the best-available matching backend, depending on desired configuration
- Optionnally, compress data comming from the backend before forwarding it to the client
-### Configuring Tricot
+## Configuring Tricot
Tricot uses the following environment variables for its configuration (they can also be passed as command line arguments, see `--help`):
@@ -29,7 +29,7 @@ Tricot uses the following environment variables for its configuration (they can
[Here is an example of how to run Tricot as a Nomad service](https://git.deuxfleurs.fr/Deuxfleurs/nixcfg/src/branch/main/app/frontend/deploy/frontend-tricot.hcl) (in this example it also integrates with [Diplonat](https://git.deuxfleurs.fr/Deuxfleurs/diplonat)).
-### Adding and priorizing backends
+## Adding and priorizing backends
Backends are configured by adding tags of the following form to the services in Consul:
@@ -49,7 +49,7 @@ Any number of such rules can be combined freely.
[some](https://git.deuxfleurs.fr/Deuxfleurs/nixcfg/src/branch/main/app/im/deploy/im.hcl)
[examples](https://git.deuxfleurs.fr/Deuxfleurs/infrastructure/src/branch/main/app/jitsi/deploy/jitsi.hcl).
-### How Tricot matches backends
+## How Tricot matches backends
Tricot priorizes backend nodes in the following order:
@@ -58,3 +58,12 @@ Tricot priorizes backend nodes in the following order:
3. Select rule that redirects request to the same node Tricot is running on, except `tricot-site-lb` or `tricot-global-lb` is used
4. Select rule that redirects request to a node that is running in the same site (geographical region, datacenter, whatever) than the node Tricot is running on, based on the metadata key `site` in Consul's node information, if such information is available, except if `tricot-global-lb` is used
5. Round-robin selection of backend nodes
+
+## Knowing what Tricot is doing
+
+Logs are the privileged place to get information about what Tricot is doing. You can set the log level by changing the `RUST_LOG` environment variable. The following log levels are avaialble:
+
+- `RUST_LOG=tricot=warn`: Tricot will only show warning and errors, it should be quite quiet
+- `RUST_LOG=tricot=info`: Tricot will dump the proxy configuration (the set of rules it uses to match backends) each time it changes, and will show a line for each incoming request (but it won't indicate which backend the request was routed to). You will also get information about certificate obtention and renewal using Let's Encrypt.
+- `RUST_LOG=tricot=debug`: Tricot will show for each request the backend to which it is routed. It will also show all of its interactions with Consul
+- `RUST_LOG=tricot=trace`: Tricot will show details such as the request's headers for all request at all stages of proxying.