vector/config/
dot_graph.rs

1use std::collections::HashMap;
2
3use vector_lib::configurable::configurable_component;
4
5/// Extra graph configuration
6///
7/// Configure output for component when generated with graph command
8#[configurable_component]
9#[configurable(metadata(docs::advanced))]
10#[derive(Clone, Debug, Default, Eq, PartialEq)]
11#[serde(deny_unknown_fields)]
12pub struct GraphConfig {
13    /// Node attributes to add to this component's node in resulting graph
14    ///
15    /// They are added to the node as provided
16    #[configurable(metadata(
17        docs::additional_props_description = "A single graph node attribute in graphviz DOT language.",
18        docs::examples = "example_graph_options()"
19    ))]
20    pub node_attributes: HashMap<String, String>,
21}
22
23fn example_graph_options() -> HashMap<String, String> {
24    HashMap::<_, _>::from_iter([
25        ("name".to_string(), "Example Node".to_string()),
26        ("color".to_string(), "red".to_string()),
27        ("width".to_string(), "5.0".to_string()),
28    ])
29}