-
Notifications
You must be signed in to change notification settings - Fork 25
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
refactor: use v2/metrics for cli honeycomb events #1522
Conversation
8024f19
to
93614ca
Compare
Signed-off-by: Darren Murray <darren.murray@lacework.net>
1d667d6
to
7150735
Compare
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
cli/cmd/cache.go
Outdated
@@ -132,7 +132,7 @@ func (c *cliState) EraseCachedToken() error { | |||
} | |||
|
|||
func (c *cliState) ReadCachedToken() { | |||
if c.noCache { | |||
if c.noCache || c.Cache == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel you catch some issues plugin this in, I am now against these additions but I want to understand why we need to check for the cache here and also, initialize the api somewhere else that is not the root.go
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prior to this we could send Honeycomb events without the client being initialized.
In the persistent prerun we always sent a Honeycomb event, say for example lacework help
.
We then got an event in honeycomb with the cmd,version but no account/subaccount or any client data.
Now we cannot do that. We need Lacework auth to send a honeycomb event. This also means those honeycomb events with no client data will not be sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for cache being nil is for some of the help tests that were failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed initing the client in sendhoneycomb event. If there is no client we just return.
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Summary
Refactor honeycomb prod events sent by CLI to use
v2/metrics
instead of direct to honeycomb.-dev
events have already been using thev2/metrics
since v1.44.0 seelacework-cli-dev
dataset.How did you test this change?
Issue
https://lacework.atlassian.net/browse/GROW-2705