Skip to content

Commit 20404f8

Browse files
committed
docs(victoriametrics sink): add component documentation
Add the component reference, generated configuration docs, example configurations, website page, and changelog fragment for the `victoriametrics` sink.
1 parent fab2f84 commit 20404f8

8 files changed

Lines changed: 568 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Added a new `victoriametrics` sink that delivers metrics using the VictoriaMetrics remote write protocol (zstd-compressed remote write).
2+
3+
The sink encodes distributions as VictoriaMetrics `vmrange` histograms and accumulates incremental distributions in bounded memory. It supports single-node VictoriaMetrics, cluster tenants in the `vminsert` URL path or in labels, and per-event `vmauth` credentials through the `victoriametrics_token` event secret.
4+
5+
authors: missedone
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: VictoriaMetrics
3+
description: Deliver metric data to [VictoriaMetrics](https://victoriametrics.com) using the VictoriaMetrics remote write protocol
4+
component_kind: sink
5+
layout: component
6+
tags: ["victoriametrics", "remote write", "vmagent", "component", "sink", "metrics"]
7+
---
8+
9+
{{/*
10+
This doc is generated using:
11+
12+
1. The template in layouts/docs/component.html
13+
2. The relevant CUE data in cue/reference/components/...
14+
*/}}
Lines changed: 326 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,326 @@
1+
package metadata
2+
3+
generated: components: sinks: victoriametrics: configuration: {
4+
acknowledgements: {
5+
description: """
6+
Controls how acknowledgements are handled for this sink.
7+
8+
See [End-to-end Acknowledgements][e2e_acks] for more information on how event acknowledgement is handled.
9+
10+
[e2e_acks]: https://vector.dev/docs/architecture/end-to-end-acknowledgements/
11+
"""
12+
required: false
13+
type: _schemaDefinitions["vector_core::config::AcknowledgementsConfig"]
14+
}
15+
auth: {
16+
description: """
17+
HTTP authentication.
18+
19+
An event secret named `victoriametrics_token` overrides this setting for that event: the
20+
secret is sent as a bearer token. Use `set_secret` in VRL to choose a `vmauth` credential
21+
per event.
22+
"""
23+
required: false
24+
type: _schemaDefinitions["core::option::Option<vector::http::Auth>"]
25+
}
26+
batch: {
27+
description: "Event batching behavior."
28+
required: false
29+
type: object: options: {
30+
max_bytes: {
31+
description: """
32+
The maximum size of a batch that is processed by a sink.
33+
34+
This is based on the uncompressed size of the batched events, before they are
35+
serialized or compressed.
36+
"""
37+
required: false
38+
type: uint: {
39+
default: 8388608
40+
unit: "bytes"
41+
}
42+
}
43+
max_events: {
44+
description: "The maximum size of a batch before it is flushed."
45+
required: false
46+
type: uint: {
47+
default: 10000
48+
unit: "events"
49+
}
50+
}
51+
timeout_secs: {
52+
description: "The maximum age of a batch before it is flushed."
53+
required: false
54+
type: float: {
55+
default: 1.0
56+
unit: "seconds"
57+
}
58+
}
59+
}
60+
}
61+
compression_level: {
62+
description: """
63+
The zstd compression level.
64+
65+
Higher levels reduce network traffic at the cost of CPU usage. Negative levels reduce CPU
66+
usage at the cost of network traffic, like `-remoteWrite.vmProtoCompressLevel` in `vmagent`.
67+
If unset, the zstd default level (3) is used.
68+
"""
69+
required: false
70+
type: int: examples: [3, -3]
71+
}
72+
dangerously_allow_unconfined_template_resolution: {
73+
description: """
74+
Disable all template confinement checks for this sink.
75+
76+
**DANGEROUS — disables a security control.**
77+
78+
Bypasses both startup validation and runtime confinement for every
79+
templated field on this sink. When enabled, a log producer that
80+
controls any field used in a template can write to arbitrary keys,
81+
paths, or routing destinations. This flag is a full opt-out: it
82+
disables confinement even for templates that have a usable static
83+
prefix.
84+
"""
85+
required: false
86+
type: bool: default: false
87+
}
88+
default_namespace: {
89+
description: """
90+
The default namespace for any metrics sent.
91+
92+
This namespace is only used if a metric has no existing namespace. When a namespace is
93+
present, it is used as a prefix to the metric name, and separated with an underscore (`_`).
94+
"""
95+
required: false
96+
type: string: examples: ["service"]
97+
}
98+
endpoint: {
99+
description: """
100+
The base URL of VictoriaMetrics.
101+
102+
This is the URL of single-node VictoriaMetrics, `vminsert`, or `vmauth`. The sink appends
103+
the write path, which depends on `tenant.mode`.
104+
"""
105+
required: true
106+
type: string: examples: ["http://localhost:8428", "http://vminsert:8480", "http://vmauth:8427"]
107+
}
108+
expire_metrics_secs: {
109+
description: """
110+
The amount of time, in seconds, that incremental metrics persist in the internal metrics
111+
cache after having not been updated before they expire and are removed.
112+
113+
If unset, sending unique incremental metrics to this sink causes indefinite memory growth.
114+
"""
115+
required: false
116+
type: float: examples: [
117+
300.0
118+
]
119+
}
120+
request: {
121+
description: "Outbound HTTP request settings."
122+
required: false
123+
type: object: options: {
124+
adaptive_concurrency: {
125+
description: """
126+
Configuration of adaptive concurrency parameters.
127+
128+
These parameters typically do not require changes from the default, and incorrect values can lead to meta-stable or
129+
unstable performance and sink behavior. Proceed with caution.
130+
"""
131+
required: false
132+
type: _schemaDefinitions["vector::sinks::util::adaptive_concurrency::AdaptiveConcurrencySettings"]
133+
}
134+
concurrency: {
135+
description: """
136+
Configuration for outbound request concurrency.
137+
138+
This can be set either to one of the below enum values or to a positive integer, which denotes
139+
a fixed concurrency limit.
140+
"""
141+
required: false
142+
type: {
143+
string: {
144+
default: "adaptive"
145+
enum: {
146+
adaptive: """
147+
Concurrency is managed by Vector's [Adaptive Request Concurrency][arc] feature.
148+
149+
[arc]: https://vector.dev/docs/architecture/arc/
150+
"""
151+
none: """
152+
A fixed concurrency of 1.
153+
154+
Only one request can be outstanding at any given time.
155+
"""
156+
}
157+
}
158+
uint: {}
159+
}
160+
}
161+
headers: {
162+
description: """
163+
Additional HTTP headers to add to every HTTP request.
164+
165+
Values are applied verbatim; template expansion is not supported.
166+
"""
167+
required: false
168+
type: object: {
169+
examples: [{
170+
"X-My-Custom-Header": "A-Value"
171+
}]
172+
options: "*": {
173+
description: "An HTTP request header and its static value."
174+
required: true
175+
type: string: {}
176+
}
177+
}
178+
}
179+
rate_limit_duration_secs: {
180+
description: "The time window used for the `rate_limit_num` option."
181+
required: false
182+
type: uint: {
183+
default: 1
184+
unit: "seconds"
185+
}
186+
}
187+
rate_limit_num: {
188+
description: "The maximum number of requests allowed within the `rate_limit_duration_secs` time window."
189+
required: false
190+
type: uint: {
191+
default: 9223372036854775807
192+
unit: "requests"
193+
}
194+
}
195+
retry_attempts: {
196+
description: "The maximum number of retries to make for failed requests."
197+
required: false
198+
type: uint: {
199+
default: 9223372036854775807
200+
unit: "retries"
201+
}
202+
}
203+
retry_initial_backoff_secs: {
204+
description: """
205+
The amount of time to wait before attempting the first retry for a failed request.
206+
207+
After the first retry has failed, the Fibonacci sequence is used to select future backoffs.
208+
"""
209+
required: false
210+
type: uint: {
211+
default: 1
212+
unit: "seconds"
213+
}
214+
}
215+
retry_jitter_mode: {
216+
description: "The jitter mode to use for retry backoff behavior."
217+
required: false
218+
type: string: {
219+
default: "Full"
220+
enum: {
221+
Full: """
222+
Full jitter.
223+
224+
The random delay is anywhere from 0 up to the maximum current delay calculated by the backoff
225+
strategy.
226+
227+
Incorporating full jitter into your backoff strategy can greatly reduce the likelihood
228+
of creating accidental denial of service (DoS) conditions against your own systems when
229+
many clients are recovering from a failure state.
230+
"""
231+
None: "No jitter."
232+
}
233+
}
234+
}
235+
retry_max_duration_secs: {
236+
description: "The maximum amount of time to wait between retries."
237+
required: false
238+
type: uint: {
239+
default: 30
240+
unit: "seconds"
241+
}
242+
}
243+
timeout_secs: {
244+
description: """
245+
The time a request can take before being aborted.
246+
247+
Datadog highly recommends that you do not lower this value below the service's internal timeout, as this could
248+
create orphaned requests, pile on retries, and result in duplicate data downstream.
249+
"""
250+
required: false
251+
type: uint: {
252+
default: 60
253+
unit: "seconds"
254+
}
255+
}
256+
}
257+
}
258+
retry_strategy: {
259+
description: """
260+
The retry strategy for failed requests.
261+
262+
For this sink, `default` matches `vmagent`: requests rejected with 400, 409, or 415 are
263+
dropped, and every other failed request is retried, including 401 and 403, which `vmauth`
264+
returns while credentials are rotated.
265+
"""
266+
required: false
267+
type: _schemaDefinitions["derived::vector::sinks::util::http::RetryStrategy::64fe77681a1c274eed24cca6"]
268+
}
269+
send_metadata: {
270+
description: """
271+
Whether to send metric type metadata.
272+
273+
VictoriaMetrics stores metadata when `-enableMetadata` is set, which is the default. As in
274+
`vmagent`, metadata is sent by default.
275+
"""
276+
required: false
277+
type: bool: default: true
278+
}
279+
tenant: {
280+
description: "How the VictoriaMetrics tenant is chosen."
281+
required: false
282+
type: object: options: {
283+
id: {
284+
description: """
285+
The tenant, as `accountID` or `accountID:projectID`.
286+
287+
Required when `mode` is `path` or `labels`. Events whose rendered tenant is not a valid
288+
VictoriaMetrics tenant are rejected.
289+
"""
290+
required: false
291+
type: string: {
292+
examples: ["42", "42:{{ tags.project_id }}"]
293+
syntax: "template"
294+
}
295+
}
296+
mode: {
297+
description: "Where the tenant is sent."
298+
required: false
299+
type: string: {
300+
default: "none"
301+
enum: {
302+
labels: """
303+
The tenant is sent in the `vm_account_id` and `vm_project_id` labels. Writes to
304+
`/insert/multitenant/prometheus/api/v1/write` on `vminsert`.
305+
"""
306+
none: """
307+
No tenant. Writes to `/api/v1/write`.
308+
309+
Use this for single-node VictoriaMetrics, and for `vmauth`, which chooses the tenant from
310+
the credential.
311+
"""
312+
path: """
313+
The tenant is part of the URL path. Writes to
314+
`/insert/<tenant>/prometheus/api/v1/write` on `vminsert`.
315+
"""
316+
}
317+
}
318+
}
319+
}
320+
}
321+
tls: {
322+
description: "TLS configuration."
323+
required: false
324+
type: _schemaDefinitions["core::option::Option<vector_core::tls::settings::TlsConfig>"]
325+
}
326+
}

0 commit comments

Comments
 (0)