Skip to content

Commit 9d29563

Browse files
prontjszwedko
andauthored
chore(config, docs): Replace 'vector.toml' with 'vector.yaml' (#18388)
* chore(config, docs): Replace 'vector.toml' with 'vector.yaml' * keep both vector.toml and vector.yaml * remove vector.toml from asserts, still attempt to load it first and finally fallback to vector.yaml * update conf-files and docs as well * clippy fixes * Update src/cli.rs Co-authored-by: Jesse Szwedko <[email protected]> * Update src/config/cmd.rs Co-authored-by: Jesse Szwedko <[email protected]> * address Jesse's review points * add 'pront' to dictionary * small fixes * remove conf-files --------- Co-authored-by: Jesse Szwedko <[email protected]>
1 parent b3f76b5 commit 9d29563

File tree

26 files changed

+143
-46
lines changed

26 files changed

+143
-46
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ section = "admin"
5050
maintainer-scripts = "distribution/debian/scripts/"
5151
assets = [
5252
["target/release/vector", "/usr/bin/", "755"],
53-
["config/vector.toml", "/etc/vector/vector.toml", "644"],
53+
["config/vector.yaml", "/etc/vector/vector.yaml", "644"],
5454
["config/examples/*", "/etc/vector/examples/", "644"],
5555
["distribution/systemd/vector.service", "/lib/systemd/system/vector.service", "644"],
5656
["distribution/systemd/vector.default", "/etc/default/vector", "600"],

config/vector.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# __ __ __
2+
# \ \ / / / /
3+
# \ V / / /
4+
# \_/ \/
5+
#
6+
# V E C T O R
7+
# Configuration
8+
#
9+
# ------------------------------------------------------------------------------
10+
# Website: https://vector.dev
11+
# Docs: https://vector.dev/docs
12+
# Chat: https://chat.vector.dev
13+
# ------------------------------------------------------------------------------
14+
15+
# Change this to use a non-default directory for Vector data storage:
16+
# data_dir = "/var/lib/vector"
17+
18+
# Random Syslog-formatted logs
19+
sources:
20+
dummy_logs:
21+
type: "demo_logs"
22+
format: "syslog"
23+
interval: 1
24+
25+
# Parse Syslog logs
26+
# See the Vector Remap Language reference for more info: https://vrl.dev
27+
transforms:
28+
parse_logs:
29+
type: "remap"
30+
inputs: ["dummy_logs"]
31+
source: |
32+
. = parse_syslog!(string!(.message))
33+
34+
# Print parsed logs to stdout
35+
sinks:
36+
print:
37+
type: "console"
38+
inputs: ["parse_logs"]
39+
encoding:
40+
codec: "json"
41+
42+
# Vector's GraphQL API (disabled by default)
43+
# Uncomment to try it out with the `vector top` command or
44+
# in your browser at http://localhost:8686
45+
# api:
46+
# enabled: true
47+
# address: "127.0.0.1:8686"

distribution/docker/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ observability data with Vector.
3636
As shown above, you can pass a custom
3737
[Vector configuration file][docs.setup.configuration] via the `-c` flag. You'll want
3838
to do this since the
39-
[default `/etc/vector/vector.toml` configuration file][urls.default_configuration]
39+
[default `/etc/vector/vector.yaml` configuration file][urls.default_configuration]
4040
doesn't do anything.
4141

4242
## Deploying
@@ -128,7 +128,7 @@ Vector's Docker source files are located
128128
[docs.transforms]: https://vector.dev/docs/reference/transforms/
129129
[pages.index#correctness]: https://vector.dev/#correctness
130130
[pages.index#performance]: https://vector.dev/#performance
131-
[urls.default_configuration]: https://github.com/vectordotdev/vector/blob/master/config/vector.toml
131+
[urls.default_configuration]: https://github.com/vectordotdev/vector/blob/master/config/vector.yaml
132132
[urls.docker_alpine]: https://hub.docker.com/_/alpine
133133
[urls.docker_debian]: https://hub.docker.com/_/debian
134134
[urls.rust]: https://www.rust-lang.org/

distribution/docker/alpine/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FROM docker.io/alpine:3.18
1313
RUN apk --no-cache add ca-certificates tzdata
1414

1515
COPY --from=builder /vector/bin/* /usr/local/bin/
16-
COPY --from=builder /vector/config/vector.toml /etc/vector/vector.toml
16+
COPY --from=builder /vector/config/vector.yaml /etc/vector/vector.yaml
1717
COPY --from=builder /var/lib/vector /var/lib/vector
1818

1919
# Smoke test

distribution/docker/distroless-static/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN mkdir -p /var/lib/vector
1212
FROM gcr.io/distroless/static:latest
1313

1414
COPY --from=builder /vector/bin/* /usr/local/bin/
15-
COPY --from=builder /vector/config/vector.toml /etc/vector/vector.toml
15+
COPY --from=builder /vector/config/vector.yaml /etc/vector/vector.yaml
1616
COPY --from=builder /var/lib/vector /var/lib/vector
1717

1818
# Smoke test

distribution/init.d/vector

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# description: A lightweight and ultra-fast tool for building observability pipelines
66
# processname: vector
7-
# config: /etc/vector/vector.toml
7+
# config: /etc/vector/vector.yaml
88
# pidfile: /var/run/vector.pid
99

1010
### BEGIN INIT INFO

distribution/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ install_from_archive() {
224224
printf "%s Install succeeded! 🚀\n" "$_prompt"
225225
printf "%s To start Vector:\n" "$_prompt"
226226
printf "\n"
227-
printf "%s vector --config $prefix/config/vector.toml\n" "$_indent"
227+
printf "%s vector --config $prefix/config/vector.yaml\n" "$_indent"
228228
printf "\n"
229229
printf "%s More information at https://vector.dev/docs/\n" "$_prompt"
230230

distribution/rpm/vector.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mkdir -p %{buildroot}%{_datadir}/%{_name}
5656
mkdir -p %{buildroot}%{_unitdir}
5757

5858
cp -a %{_builddir}/bin/vector %{buildroot}%{_bindir}
59-
cp -a %{_builddir}/config/vector.toml %{buildroot}%{_sysconfdir}/%{_name}/vector.toml
59+
cp -a %{_builddir}/config/vector.yaml %{buildroot}%{_sysconfdir}/%{_name}/vector.yaml
6060
cp -a %{_builddir}/config/examples/. %{buildroot}%{_sysconfdir}/%{_name}/examples
6161
cp -a %{_builddir}/systemd/vector.service %{buildroot}%{_unitdir}/vector.service
6262
cp -a %{_builddir}/systemd/vector.default %{buildroot}%{_sysconfdir}/default/vector

src/cli.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ impl Opts {
6363
pub struct RootOpts {
6464
/// Read configuration from one or more files. Wildcard paths are supported.
6565
/// File format is detected from the file name.
66-
/// If zero files are specified the default config path
66+
/// If zero files are specified the deprecated default config path
6767
/// `/etc/vector/vector.toml` will be targeted.
68+
/// And if the aforementioned file does not exist,
69+
/// then `/etc/vector/vector.yaml` will be used.
6870
#[arg(
6971
id = "config",
7072
short,

src/config/cmd.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ pub struct Opts {
2020

2121
/// Read configuration from one or more files. Wildcard paths are supported.
2222
/// File format is detected from the file name.
23-
/// If zero files are specified the default config path
23+
/// If zero files are specified the deprecated default config path
2424
/// `/etc/vector/vector.toml` will be targeted.
25+
/// And if the aforementioned file does not exist,
26+
/// then `/etc/vector/vector.yaml` will be used.
2527
#[arg(
2628
id = "config",
2729
short,

src/config/loading/mod.rs

+29-11
Original file line numberDiff line numberDiff line change
@@ -305,22 +305,40 @@ where
305305
}
306306

307307
#[cfg(not(windows))]
308-
fn default_config_paths() -> Vec<ConfigPath> {
309-
vec![ConfigPath::File(
310-
"/etc/vector/vector.toml".into(),
311-
Some(Format::Toml),
312-
)]
308+
fn default_path() -> PathBuf {
309+
"/etc/vector/vector.toml".into()
313310
}
314311

315312
#[cfg(windows)]
316-
fn default_config_paths() -> Vec<ConfigPath> {
313+
fn default_path() -> PathBuf {
317314
let program_files =
318315
std::env::var("ProgramFiles").expect("%ProgramFiles% environment variable must be defined");
319-
let config_path = format!("{}\\Vector\\config\\vector.toml", program_files);
320-
vec![ConfigPath::File(
321-
PathBuf::from(config_path),
322-
Some(Format::Toml),
323-
)]
316+
format!("{}\\Vector\\config\\vector.toml", program_files).into()
317+
}
318+
319+
fn default_config_paths() -> Vec<ConfigPath> {
320+
#[cfg(not(windows))]
321+
let default_path = default_path();
322+
323+
#[cfg(windows)]
324+
let default_path = default_path();
325+
326+
let yaml_path = default_path.with_extension("yaml");
327+
if default_path.exists() {
328+
warn!("DEPRECATED Using the deprecated {:?} config path as the default config location. Vector is migrating \
329+
to YAML as the default config format. Future Vector versions will use {:?} as the default config location.",
330+
default_path,
331+
yaml_path);
332+
333+
vec![ConfigPath::File(default_path, Some(Format::Toml))]
334+
} else {
335+
warn!(
336+
"The {:?} config path does not exist. Vector will attempt to use new default {:?} instead.",
337+
default_path, yaml_path
338+
);
339+
340+
vec![ConfigPath::File(yaml_path, Some(Format::Yaml))]
341+
}
324342
}
325343

326344
#[cfg(all(

src/graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct Opts {
1111
/// Read configuration from one or more files. Wildcard paths are supported.
1212
/// File format is detected from the file name.
1313
/// If zero files are specified the default config path
14-
/// `/etc/vector/vector.toml` will be targeted.
14+
/// `/etc/vector/vector.yaml` will be targeted.
1515
#[arg(
1616
id = "config",
1717
short,

src/unit_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct Opts {
2323
paths_yaml: Vec<PathBuf>,
2424

2525
/// Any number of Vector config files to test. If none are specified the
26-
/// default config path `/etc/vector/vector.toml` will be targeted.
26+
/// default config path `/etc/vector/vector.yaml` will be targeted.
2727
#[arg(value_delimiter(','))]
2828
paths: Vec<PathBuf>,
2929

src/validate.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ pub struct Opts {
5454
/// Any number of Vector config files to validate.
5555
/// Format is detected from the file name.
5656
/// If none are specified the default config path `/etc/vector/vector.toml`
57-
/// will be targeted.
57+
/// will be targeted. And if the aforementioned file does not exist,
58+
// then `/etc/vector/vector.yaml` will be used.
5859
#[arg(env = "VECTOR_CONFIG", value_delimiter(','))]
5960
pub paths: Vec<PathBuf>,
6061

website/content/en/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ platform:
4545
configure:
4646
title: "Easy to configure"
4747
description: "A simple, composable format enables you to build flexible pipelines"
48-
filename: "/etc/vector/vector.toml"
48+
filename: "/etc/vector/vector.yaml"
4949
below: "Configuration examples are in [TOML](https://toml.io) but Vector also supports [YAML](https://yaml.org) and [JSON](https://json.org)"
5050
# Example configs are specified in cue/examples.cue
5151

website/content/en/docs/administration/management.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To manage the Vector executable directly, without a process manager:
2323
{{< tab title="Start" >}}
2424

2525
```bash
26-
vector --config /etc/vector/vector.toml
26+
vector --config /etc/vector/vector.yaml
2727

2828
# Or supply a JSON or YAML config file
2929
```
@@ -129,9 +129,9 @@ If you're running Vector on Windows (perhaps you installed it using [MSI]), you
129129

130130
```powershell
131131
C:\Program Files\Vector\bin\vector \
132-
--config C:\Program Files\Vector\config\vector.toml
132+
--config C:\Program Files\Vector\config\vector.yaml
133133
134-
# Or supply a JSON or YAML config file
134+
# Or supply a TOML or JSON config file
135135
```
136136

137137
{{< /tab >}}
@@ -147,7 +147,7 @@ If you're running Vector using [Docker], the command interface is the same acros
147147
```bash
148148
docker run \
149149
-d \
150-
-v ~/vector.toml:/etc/vector/vector.toml:ro \
150+
-v ~/vector.yaml:/etc/vector/vector.yaml:ro \
151151
-p 8686:8686 \
152152
timberio/vector:{{< version >}}-alpine
153153
```

website/content/en/docs/administration/validating.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Vector provides a subcommand, [`validate`][validate], that checks the validity o
88
Here's an example:
99

1010
```bash
11-
vector validate /etc/vector/vector.toml
11+
vector validate /etc/vector/vector.yaml
1212
```
1313

1414
You can also check multiple files:
@@ -52,7 +52,7 @@ configured topology:
5252
These environment checks can be disabled using the [`--no-environment`][no_environment] flag:
5353

5454
```bash
55-
vector validate --no-environment /etc/vector/vector.toml
55+
vector validate --no-environment /etc/vector/vector.yaml
5656
```
5757

5858
[components]: /components

website/content/en/docs/reference/configuration/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ vector --config /etc/vector/vector.yaml
213213
{{< tab title="TOML" >}}
214214

215215
```shell
216-
vector --config /etc/vector/vector.toml
216+
vector --config /etc/vector/vector.yaml
217217
```
218218

219219
{{< /tab >}}
@@ -295,7 +295,7 @@ data templating languages such as [ytt], [Jsonnet] and [Cue].
295295

296296
The location of your Vector configuration file depends on your installation
297297
method. For most Linux-based systems, the file can be found at
298-
`/etc/vector/vector.toml`.
298+
`/etc/vector/vector.yaml`.
299299

300300
### Multiple files
301301

website/content/en/docs/reference/configuration/unit-tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ You can execute tests within a [configuration](#configuring) file using Vector's
2828
[`test`][vector_test] subcommand:
2929

3030
```bash
31-
vector test /etc/vector/vector.toml
31+
vector test /etc/vector/vector.yaml
3232
```
3333

3434
You can also specify multiple configuration files to test:

website/content/en/docs/setup/installation/platforms/docker.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ EOF
5959
```shell
6060
docker run \
6161
-d \
62-
-v $PWD/vector.toml:/etc/vector/vector.toml:ro \
62+
-v $PWD/vector.yaml:/etc/vector/vector.yaml:ro \
6363
-p 8686:8686 \
6464
timberio/vector:{{< version >}}-debian
6565
```

website/content/en/guides/level-up/troubleshooting.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ If you see an exception in Vector's logs then we've clearly found the issue.
7575
Before you report a bug, please enable backtraces:
7676

7777
```bash
78-
RUST_BACKTRACE=full vector --config=/etc/vector/vector.toml
78+
RUST_BACKTRACE=full vector --config=/etc/vector/vector.yaml
7979
```
8080

8181
Backtraces are _critical_ for debugging errors. Once you have the backtrace
@@ -95,14 +95,14 @@ Vector rate limits logs in the hot path. As a result, dropping to the
9595
{{< tab title="Env Var" >}}
9696

9797
```shell
98-
VECTOR_LOG=debug vector --config=/etc/vector/vector.toml
98+
VECTOR_LOG=debug vector --config=/etc/vector/vector.yaml
9999
```
100100

101101
{{< /tab >}}
102102
{{< tab title="Flag" >}}
103103

104104
```bash
105-
vector --verbose --config=/etc/vector/vector.toml
105+
vector --verbose --config=/etc/vector/vector.yaml
106106
```
107107

108108
{{< /tab >}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
date: "2023-09-06"
3+
title: "0.33 Upgrade Guide"
4+
description: "An upgrade guide that addresses breaking changes in 0.33.0"
5+
authors: ["pront"]
6+
release: "0.33.0"
7+
hide_on_release_notes: false
8+
badges:
9+
type: breaking change
10+
---
11+
12+
Vector's 0.33.0 release includes **deprecations**:
13+
14+
1. [Default config location change](#default-config-location-change)
15+
16+
We cover them below to help you upgrade quickly:
17+
18+
## Upgrade guide
19+
20+
### Deprecations
21+
22+
#### Default config location change {#default-config-location-change}
23+
24+
The default config location `/etc/vector/vector.toml` which is used by Vector `0.32.0` is now deprecated. This location will still be used in `0.33.0`. The new default path is `/etc/vector/vector.yaml`, please migrate to this new default path or specify the config path explicitly.
25+
26+
Vector `0.33.0` will attempt to load `/etc/vector/vector.toml` first, and if it is not present, it will fallback to `/etc/vector/vector.yaml`. However, Vector release `0.34.0` will automatically load `/etc/vector/vector.yaml` only.

website/cue/reference/administration/interfaces/docker_cli.cue

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ administration: interfaces: docker_cli: {
3030
start: #"""
3131
docker run \
3232
-d \
33-
-v \#(paths.config):/etc/vector/vector.toml:ro \
33+
-v \#(paths.config):/etc/vector/vector.yaml:ro \
3434
-p \#(_api_port):\#(_api_port) \{flags}
3535
timberio/vector:{version}-{variant}
3636
"""#

0 commit comments

Comments
 (0)