Project: Vector (Observability and Analysis / Observability)
File: 2022-10-04-0-25-0-upgrade-guide.md

date: "2022-10-08" title: "0.25 Upgrade Guide" description: "An upgrade guide that addresses breaking changes in 0.25.0" authors: ["fuchsnj", "bruceg"] release: "0.25.0" hideonrelease_notes: false badges: type: breaking change Vector's 0.25.0 release includes breaking changes: and deprecations: We cover them below to help you upgrade quickly: VRL's modulo operator (`%`) was deprecated in `0.24.0` and has now been removed. The `mod` function can be used instead. Before: ```coffee 5 % 2 == 1 ``` After: ```coffee mod(5, 2) == 1 ``` In 0.24.0, we that the `newreliclogs` sink had been deprecated, and that users should prefer to use the `new_relic` sink instead, which has support not only for logs, but also metrics and traces. Switching from `newreliclogs` to `new_relic` is not as simple as just changing the sink type field, but it only involves a few small changes which we'll cover below. First, you'll have to change the `type` from `newreliclogs` to `new_relic`. As well, you'll have to set a field, `api`, to specify that you're sending logs. The value of this field should `"logs"`. Lastly, you'll need to tweak the credentials used to specify your New Relic account credentials. With the `newreliclogs` sink, you had the option to specify either your [Insights insert key] (`license_key`). With the `new_relic` sink, you can no longer use an Insights insert key, and must use a license key. Additionally, the must also now be specified. All put together, here's an example of converting from a `newreliclogs` sink configuration over to the `new_relic` sink configuration: ```toml [sinks.newreliclogs] type = "newreliclogs" license_key = "xxxx" [sinks.new_relic] type = "new_relic" license_key = "xxxx" account_id = "yyyy" api = "logs" ``` The `internal_metrics` source now defaults to setting the host tag on emitted metrics. This behavior avoids issues when deploying multiple Vector instances publishing their metrics to the same sink without opting into this tag via `tags.host_key`. The default key for this is the configured `logschema.hostkey` (which defaults to `host`). This behavior can be opted out of by setting

= ""` on the `internalmetrics` source. The original v1 protocol of the `vector` source and sink was [marked as deprecated in version 0.20.0][deprecate-vector-v1]. This version removes support for the deprecated protocol and its configuration. The `version` field is still accepted in configurations, but only version numbered `2` is accepted. The `shutdowntimeoutsecs` config for the `vector` v2 source didn't actually do anything, so it was removed. Vector now defaults to sending requests to Loki as snappy-compressed protobuf, rather than JSON. The old behavior can be kept by setting the `compression` option to either `none` or `gzip`, with `none` being the previous default. Vector `0.25.0` has introduced a new metadata path syntax available in VRL which points directly to event metadata. This means the metadata functions are no longer necessary and will be removed in the future. | | before | after | |--||--| | get | getmetadatafield(.foo.bar) | %foo.bar | | set | setmetadatafield(.foo.bar, "value") | %foo.bar = "value" | | delete | removemetadatafield(.foo.bar) | del(%foo.bar) | Vector `0.25.0` has introduced distribution of events to multiple endpoints for Elasticsearch sink. In order to enable this distribution, a new `endpoints` setting has been introduced which configures one or more destinations to which to distribute the events. The existing `endpoint` setting is now deprecated and will be removed in a future version. Vector `0.9.0` introduced the version 2 API for the `lua` transform. This API has long been considered fully mature, obviating the need to maintain the older API. Additionally, the older API has no support for data types other than logs. The older version 1 API is now deprecated and will be removed in a future version. For example, the following partial configuration: ```toml [transform.example] type = "lua" version = 1 source = """ event["a"] = "some value" event["b"] = nil """ ``` would need to be converted to the following: ```toml [transform.example] type = "lua" version = 2 hooks.process = """ function (event, emit) event.log.a = "some value" event.log.b = nil emit(event) end """ ```