Skip to content

allow users to change the filter keys in signalfx#64

Open
lenhattan86 wants to merge 2 commits into
paypal:masterfrom
lenhattan86:dev
Open

allow users to change the filter keys in signalfx#64
lenhattan86 wants to merge 2 commits into
paypal:masterfrom
lenhattan86:dev

Conversation

@lenhattan86

@lenhattan86 lenhattan86 commented May 19, 2023

Copy link
Copy Markdown
Collaborator
  • allow users to change filter keys (for host & cluster name) in signalfx
  • use pointers instead of values for metrics clients.

TEST DONE:

  • verify metrics pulled to load-watcher in a dev cluster
  • unit tests

@lawwong1 lawwong1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

@wangchen615 wangchen615 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me.

@lenhattan86

Copy link
Copy Markdown
Collaborator Author

@lawwong1 can you approve the change after reviewing.

@misho-kr misho-kr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

First time looking at this code, I thought I will give my 2c :)

client http.Client
authToken string
signalFxAddress string
hostKey string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your editor has not replaced the tabs with spaces and these two lines appear misaligned

return nil, err
}
return metricsServerClient{
return &metricsServerClient{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What prompted this change?

  • The struct has only 2 attributes so passing it by value does not incur a lot of copying
  • A pointer has the disadvantage that the access to the attributes is indirect

It is not wrong but it has already been like this from the initial version, so why change it now?

}

func (s promClient) Name() string {
func (s *promClient) Name() string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same question about the need for this change. This struct is even smaller.

"creator": null,
"dimensions": {
"host": "test.dev.com",
"[hostKey]": "test.dev.com",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  1. I may be mistaken, but it seems to me the right key here is the value of hostKey which by default is host
  2. Why are the square brackets introduced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants