1--- 2last_modified_on: "2020-07-13" 3title: Monitoring 4description: How to monitor and observe Vector with logs, metrics, and more. 5--- 6 7import Jump from '@site/src/components/Jump'; 8import Tabs from '@theme/Tabs'; 9import TabItem from '@theme/TabItem'; 10 11This document will cover monitoring Vector. 12 13<!-- 14 THIS FILE IS AUTOGENERATED! 15 16 To make changes please edit the template located at: 17 18 website/docs/administration/monitoring.md.erb 19--> 20 21## Logs 22 23### Accessing 24 25<Tabs 26 block={false} 27 centered={true} 28 groupId="interfaces" 29 placeholder="How did you install Vector?" 30 select={true} 31 size={null} 32 values={[{"group":"Package managers","label":"DPKG","value":"dpkg"},{"group":"Platforms","label":"Docker CLI","value":"docker-cli"},{"group":"Platforms","label":"Docker Compose","value":"docker-compose"},{"group":"Package managers","label":"Homebrew","value":"homebrew"},{"group":"Package managers","label":"MSI","value":"msi"},{"group":"Package managers","label":"Nix","value":"nix"},{"group":"Package managers","label":"RPM","value":"rpm"},{"group":"Nones","label":"Vector CLI","value":"vector-cli"}]}> 33<TabItem value="dpkg"> 34 35The Vector DEB package installs Vector as a Systemd service. Logs can be 36accessed through the `journalctl` utility: 37 38```bash 39sudo journalctl -fu vector 40``` 41 42</TabItem> 43<TabItem value="docker-cli"> 44 45If you've started Vector through the `docker` CLI you can access Vector's logs 46via the `docker logs` command. First, find the Vector container ID: 47 48```bash 49docker ps | grep vector 50``` 51 52Copy Vector's container ID and use it to tail the logs: 53 54```bash 55docker logs -f <container-id> 56``` 57 58</TabItem> 59<TabItem value="docker-compose"> 60 61If you started Vector through Docker compose you can use the following command 62to access Vector's logs: 63 64```bash 65docker-compose logs -f vector 66``` 67 68Replace `vector` with the name of Vector's service if it is not called `vector`. 69 70</TabItem> 71<TabItem value="homebrew"> 72 73When Vector is started through Homebrew the logs are automatically routed to 74`/usr/local/var/log/vector.log`. You can tail them with the `tail` utility: 75 76```bash 77tail -f /usr/local/var/log/vector.log 78``` 79 80</TabItem> 81<TabItem value="msi"> 82 83The Vector MSI package does not install Vector into a proces manager. Therefore, 84Vector must be started by executing the Vector binary directly. Vector's logs 85are written to `STDOUT`. You are in charge of routing `STDOUT`, and this 86determines how you access Vector's logs. 87 88</TabItem> 89<TabItem value="nix"> 90 91The Vector Nix package does not install Vector into a proces manager. Therefore, 92Vector must be started by executing the Vector binary directly. Vector's logs 93are written to `STDOUT`. You are in charge of routing `STDOUT`, and this 94determines how you access Vector's logs. 95 96</TabItem> 97<TabItem value="rpm"> 98 99The Vector RPM package installs Vector as a Systemd service. Logs can be 100accessed through the `journalctl` utility: 101 102```bash 103sudo journalctl -fu vector 104``` 105 106</TabItem> 107<TabItem value="vector-cli"> 108 109If you are starting Vector directly from the Vector CLI then all logs will be 110written to `STDOUT`. You are in charge of routing `STDOUT`, and this determines 111how you access Vector's logs. 112 113</TabItem> 114</Tabs> 115 116### Levels 117 118By default, Vector logs on the `info` level, you can change the level through 119a variety of methods: 120 121| Method | Description | 122|:---------------------------------------------|:------------------------------------------------------------------------------------| 123| [`-v` flag][docs.process-management#flags] | Drops the log level to `debug`. | 124| [`-vv` flag][docs.process-management#flags] | Drops the log level to `trace`. | 125| [`-q` flag][docs.process-management#flags] | Raises the log level to `warn`. | 126| [`-qq` flag][docs.process-management#flags] | Raises the log level to `error`. | 127| [`-qqq` flag][docs.process-management#flags] | Turns logging off. | 128| `LOG=<level>` env var | Set the log level. Must be one of `trace`, `debug`, `info`, `warn`, `error`, `off`. | 129 130### Full Backtraces 131 132You can enable full error backtraces by setting the `RUST_BACKTRACE=full` env 133var. More on this in the [Troubleshooting guide][guides.advanced.troubleshooting]. 134 135### Rate Limiting 136 137Vector rate limits log events in the hot path. This is to your benefit as 138it allows you to get granular insight without the risk of saturating IO 139and disrupting the service. The tradeoff is that repetitive logs will not be 140logged. 141 142## Metrics 143 144Currently, Vector does not expose Metrics. [Issue #230][urls.issue_230] 145represents work to run internal Vector metrics through Vector's pipeline. 146Allowing you to define internal metrics as a [source][docs.sources] and 147then define one of many metrics [sinks][docs.sinks] to collect those metrics, 148just as you would metrics from any other source. 149 150## Troubleshooting 151 152Please refer to our troubleshooting guide: 153 154<Jump to="/docs/setup/guides/troubleshooting">Troubleshooting Guide</Jump> 155 156[docs.process-management#flags]: /docs/administration/process-management/#flags 157[docs.sinks]: /docs/reference/sinks/ 158[docs.sources]: /docs/reference/sources/ 159[guides.advanced.troubleshooting]: /guides/advanced/troubleshooting/ 160[urls.issue_230]: https://github.com/timberio/vector/issues/230 161