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

Instrument command API run requests #256

Merged
merged 15 commits into from
Dec 1, 2020
Merged

Conversation

varas
Copy link
Contributor

@varas varas commented Nov 27, 2020

Instrument command API run & stop integration requests notifying platform via events.

Fields for the event:

"eventType":     "InfrastructureEvent",
"category":      "notifications",
"summary",       "cmd-api"
"cmd_name",      // either "run_integration" or "stop_integration"  
"cmd_id",        
"cmd_hash",      
"cmd_args",      // contains data before being marshalled into `cmd_args_name` & `cmd_args_args`
"cmd_args_name", 
"cmd_args_args", 
"cmd_stop_hash", //  agent in-memory hash used to track integrations run via command-api to be stopped on later on stop-requests
"cmd_stop_mode", // only available on stop-requests containing either: `sigterm`, `sigkill` or `error`

The event  for "run_integration" does not contain the run status (basically running or error) as it happens asynchronously (while "stop_integration" happens synchronously)


This also fixes stop_integration handler command-name assignation and run-once condition.

@varas varas requested a review from a team November 27, 2020 10:35
@varas varas changed the base branch from master to fix_cmdapi-ack-using-hash November 27, 2020 10:35
@varas varas force-pushed the feat_instrument-run-requests branch 3 times, most recently from f38d483 to bbb30ca Compare November 27, 2020 10:50
@varas varas changed the title feat instrument run requests Instrument command API run requests Nov 27, 2020
@varas varas force-pushed the feat_instrument-run-requests branch from bbb30ca to 616c539 Compare November 27, 2020 10:55
@coveralls
Copy link

coveralls commented Nov 27, 2020

Pull Request Test Coverage Report for Build 393564209

  • 27 of 128 (21.09%) changed or added relevant lines in 10 files are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.2%) to 58.089%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/integrations/v4/integration/integration.go 2 4 50.0%
internal/integrations/v4/runner/runner.go 1 4 25.0%
pkg/integrations/v4/dm/emitter_no_register.go 0 3 0.0%
internal/agent/cmdchannel/runintegration/runintegration.go 15 24 62.5%
pkg/backend/commandapi/client.go 0 13 0.0%
pkg/integrations/v4/protocol/types.go 0 20 0.0%
internal/agent/cmdchannel/stopintegration/stopintegration.go 3 27 11.11%
cmd/newrelic-infra/newrelic-infra.go 0 27 0.0%
Files with Coverage Reduction New Missed Lines %
internal/agent/event_sender_vortex.go 1 73.21%
internal/agent/cmdchannel/stopintegration/stopintegration.go 2 30.0%
pkg/metrics/sampler/sampler_routine.go 2 94.74%
Totals Coverage Status
Change from base Build 393499370: -0.2%
Covered Lines: 11253
Relevant Lines: 19372

💛 - Coveralls

@josemore josemore added this to Ready for review in CAOS: Our Daily Bread Nov 30, 2020
carlosroman
carlosroman previously approved these changes Nov 30, 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 fix_cmdapi-ack-using-hash to master December 1, 2020 09:20
@varas varas dismissed carlosroman’s stale review December 1, 2020 09:20

The base branch was changed.

@varas varas force-pushed the feat_instrument-run-requests branch from 96552a8 to b834ccc Compare December 1, 2020 09:21
@varas varas force-pushed the feat_instrument-run-requests branch from 3a95e18 to d78f71e Compare December 1, 2020 09:44
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 👍

@varas varas merged commit 79cad20 into master Dec 1, 2020
@varas varas deleted the feat_instrument-run-requests branch December 1, 2020 14:31
@josemore josemore moved this from Ready for review to Ready For Release in CAOS: Our Daily Bread Dec 1, 2020
@josemore josemore moved this from Ready For Release to Done in CAOS: Our Daily Bread Dec 9, 2020
@josemore josemore moved this from Done to Ready For Release in CAOS: Our Daily Bread Dec 9, 2020
@josemore josemore moved this from Ready For Release to Done in CAOS: Our Daily Bread Dec 16, 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