master
md 89 lines 2.04 KB
Rendered Raw
1 # Traefik collector
2
3 Uses the `health` API to provide statistics.
4
5 It produces:
6
7 1. **Responses** by statuses
8
9 - success (1xx, 2xx, 304)
10 - error (5xx)
11 - redirect (3xx except 304)
12 - bad (4xx)
13 - other (all other responses)
14
15 2. **Responses** by codes
16
17 - 2xx (successful)
18 - 5xx (internal server errors)
19 - 3xx (redirect)
20 - 4xx (bad)
21 - 1xx (informational)
22 - other (non-standart responses)
23
24 3. **Detailed Response Codes** requests/s (number of responses for each response code family individually)
25
26 4. **Requests**/s
27
28 - request statistics
29
30 5. **Total response time**
31
32 - sum of all response time
33
34 6. **Average response time**
35
36 7. **Average response time per iteration**
37
38 8. **Uptime**
39
40 - Traefik server uptime
41
42 ## Configuration
43
44 Edit the `python.d/traefik.conf` configuration file using `edit-config` from the
45 Netdata [config directory](/docs/netdata-agent/configuration/README.md), which is typically
46 at `/etc/netdata`.
47
48 ```bash
49 cd /etc/netdata # Replace this path with your Netdata config directory, if different
50 sudo ./edit-config python.d/traefik.conf
51 ```
52
53 Needs only `url` to server's `health`
54
55 Here is an example for local server:
56
57 ```yaml
58 update_every: 1
59 priority: 60000
60
61 local:
62 url: 'http://localhost:8080/health'
63 ```
64
65 Without configuration, module attempts to connect to `http://localhost:8080/health`.
66
67
68
69
70 ### Troubleshooting
71
72 To troubleshoot issues with the `traefik` module, run the `python.d.plugin` with the debug option enabled. The
73 output will give you the output of the data collection job or error messages on why the collector isn't working.
74
75 First, navigate to your plugins directory, usually they are located under `/usr/libexec/netdata/plugins.d/`. If that's
76 not the case on your system, open `netdata.conf` and look for the setting `plugins directory`. Once you're in the
77 plugin's directory, switch to the `netdata` user.
78
79 ```bash
80 cd /usr/libexec/netdata/plugins.d/
81 sudo su -s /bin/bash netdata
82 ```
83
84 Now you can manually run the `traefik` module in debug mode:
85
86 ```bash
87 ./python.d.plugin traefik debug trace
88 ```
89