Created
April 13, 2022 13:04
-
-
Save tobz/74de9bf2d3334c20a85347b61f31fe0c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A period of time. | |
#[derive(Clone, Serialize, Deserialize)] | |
pub struct SpecialDuration(u64); | |
/// Controls the batching behavior of events. | |
#[derive(Clone)] | |
#[configurable_component] | |
pub struct BatchConfig { | |
/// The maximum number of events in a batch before it is flushed. | |
max_events: Option<u64>, | |
/// The maximum number of bytes in a batch before it is flushed. | |
max_bytes: Option<u64>, | |
/// The maximum amount of time a batch can exist before it is flushed. | |
timeout: Option<SpecialDuration>, | |
} | |
/// A sink for sending events to the `simple` service. | |
#[derive(Clone)] | |
#[configurable_component] | |
pub struct SimpleSinkConfig { | |
/// The endpoint to send events to. | |
endpoint: String, | |
batch: BatchConfig, | |
/// The tags to apply to each event. | |
tags: HashMap<String, String>, | |
} | |
/// Collection of various sinks available in Vector. | |
#[derive(Clone)] | |
#[configurable_component] | |
pub enum SinkConfig { | |
/// Simple sink. | |
Simple(SimpleSinkConfig), | |
} | |
/// Global options for configuring Vector. | |
#[derive(Clone)] | |
#[configurable_component] | |
pub struct GlobalOptions { | |
/// The data directory where Vector will store state. | |
data_dir: Option<String>, | |
} | |
/// The overall configuration for Vector. | |
#[derive(Clone)] | |
#[configurable_component] | |
pub struct VectorConfig { | |
global: GlobalOptions, | |
/// Any configured sinks. | |
sinks: Vec<SinkConfig>, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$ref": "#/definitions/VectorConfig", | |
"definitions": { | |
"GlobalOptions": { | |
"description": "Global options for configuring Vector.", | |
"type": "object", | |
"properties": { | |
"data_dir": { | |
"description": "The data directory where Vector will store state.", | |
"type": [ | |
"string", | |
"null" | |
] | |
} | |
} | |
}, | |
"BatchConfig": { | |
"description": "Controls the batching behavior of events.", | |
"type": "object", | |
"properties": { | |
"max_events": { | |
"description": "The maximum number of events in a batch before it is flushed.", | |
"type": [ | |
"number", | |
"null" | |
], | |
"maximum": 9007199254740992.0, | |
"minimum": 0.0 | |
}, | |
"max_bytes": { | |
"description": "The maximum number of bytes in a batch before it is flushed.", | |
"type": [ | |
"number", | |
"null" | |
], | |
"maximum": 9007199254740992.0, | |
"minimum": 0.0 | |
}, | |
"timeout": { | |
"description": "The maximum amount of time a batch can exist before it is flushed.", | |
"type": [ | |
"number", | |
"null" | |
], | |
"maximum": 9007199254740992.0, | |
"minimum": 0.0 | |
} | |
} | |
}, | |
"SimpleSinkConfig": { | |
"description": "A sink for sending events to the `simple` service.", | |
"type": "object", | |
"required": [ | |
"batch", | |
"endpoint", | |
"tags" | |
], | |
"properties": { | |
"endpoint": { | |
"description": "The endpoint to send events to.", | |
"type": "string" | |
}, | |
"batch": { | |
"$ref": "#/definitions/BatchConfig" | |
}, | |
"tags": { | |
"description": "The tags to apply to each event.", | |
"type": "object", | |
"additionalProperties": { | |
"description": "The tags to apply to each event.", | |
"type": "string" | |
} | |
} | |
} | |
}, | |
"SinkConfig": { | |
"description": "Any configured sinks.", | |
"oneOf": [ | |
{ | |
"$ref": "#/definitions/SimpleSinkConfig" | |
} | |
] | |
}, | |
"VectorConfig": { | |
"description": "The overall configuration for Vector.", | |
"type": "object", | |
"required": [ | |
"global", | |
"sinks" | |
], | |
"properties": { | |
"global": { | |
"$ref": "#/definitions/GlobalOptions" | |
}, | |
"sinks": { | |
"description": "Any configured sinks.", | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/SinkConfig" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment