-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components): add additional config for graph output command (#21194
) * feat(components): add additional config for graph output command This adds additional `graph` config to all components which enables adding any `node_attributes` to the generated graph. Closes: #21043 * Add changelog entry * Add command note to the changelog Co-authored-by: Jesse Szwedko <[email protected]> * Fix `dot_graph` docs capitalization Co-authored-by: Jesse Szwedko <[email protected]> * Fix clippy warnings * Fix clippy warnings * Add example for graph config * Update changelog.d/21194_dot_graph_attributes.feature.md Co-authored-by: Sandra (neko) <[email protected]> * Update proxy config docs --------- Co-authored-by: Jesse Szwedko <[email protected]> Co-authored-by: Sandra (neko) <[email protected]>
- Loading branch information
1 parent
e71016c
commit f5b9265
Showing
12 changed files
with
240 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Adds support for additional graph configuration on each component so that users can add arbitrary graphviz node attributes when generating a graph via `vector graph`. | ||
|
||
authors: esensar |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use std::collections::HashMap; | ||
|
||
use vector_lib::configurable::configurable_component; | ||
|
||
/// Extra graph configuration | ||
/// | ||
/// Configure output for component when generated with graph command | ||
#[configurable_component] | ||
#[configurable(metadata(docs::advanced))] | ||
#[derive(Clone, Debug, Default, Eq, PartialEq)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct GraphConfig { | ||
/// Node attributes to add to this component's node in resulting graph | ||
/// | ||
/// They are added to the node as provided | ||
#[configurable(metadata( | ||
docs::additional_props_description = "A single graph node attribute in graphviz DOT language.", | ||
docs::examples = "example_graph_options()" | ||
))] | ||
pub node_attributes: HashMap<String, String>, | ||
} | ||
|
||
fn example_graph_options() -> HashMap<String, String> { | ||
HashMap::<_, _>::from_iter([ | ||
("name".to_string(), "Example Node".to_string()), | ||
("color".to_string(), "red".to_string()), | ||
("width".to_string(), "5.0".to_string()), | ||
]) | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.