Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command channel metadata #261

Merged
merged 18 commits into from
Dec 15, 2020
Merged

Command channel metadata #261

merged 18 commits into from
Dec 15, 2020

Conversation

varas
Copy link
Contributor

@varas varas commented Dec 7, 2020

This adds metadata field support for the command channel.

metadata is expected to be a key-value pair (dict) which keys are in string format.

These metadata contents are forwarded to the instrumentation events, by prefixing metadata keys within the event with cmd_metadata..
IE:

cmd channel:

metadata: {"foo": "bar", "baz": 123}

becomes event fields:

"cmd_metadata.foo": "bar",
"cmd_metadata.baz": 123

@varas varas requested a review from a team December 7, 2020 17:41
@varas varas changed the base branch from master to feat_exit-code-event December 7, 2020 17:41
@varas varas changed the title feat cmd channel metadata Command channel metadata Dec 7, 2020
@coveralls
Copy link

coveralls commented Dec 7, 2020

Pull Request Test Coverage Report for Build 423814981

  • 3 of 11 (27.27%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 58.127%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/agent/cmdchannel/stopintegration/stopintegration.go 0 4 0.0%
pkg/integrations/track/tracker.go 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
internal/agent/event_sender.go 1 72.56%
Totals Coverage Status
Change from base Build 423806801: 0.05%
Covered Lines: 11412
Relevant Lines: 19633

💛 - Coveralls

@josemore josemore added this to Ready for review in CAOS: Our Daily Bread Dec 10, 2020
@@ -39,6 +40,12 @@ func (c *Command) Event(integrationName string, integrationArgs []string) protoc
"cmd_args_name": integrationName,
"cmd_args_args": fmt.Sprintf("%+v", integrationArgs),
}

for k, v := range metadata {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to have test for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good one, we are not testing instrumentation events

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added into latest commit

carlosroman
carlosroman previously approved these changes Dec 15, 2020
Copy link
Contributor

@carlosroman carlosroman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼

Base automatically changed from feat_exit-code-event to master December 15, 2020 17:42
@varas varas dismissed carlosroman’s stale review December 15, 2020 17:42

The base branch was changed.

@varas varas merged commit de6490d into master Dec 15, 2020
@varas varas deleted the feat_cmd-channel-metadata branch December 15, 2020 17:52
@josemore josemore moved this from Ready For Review to Ready For Release in CAOS: Our Daily Bread Dec 16, 2020
@varas varas moved this from Ready For Release to Done in CAOS: Our Daily Bread Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants