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

allow users to change the filter keys in signalfx #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lenhattan86
Copy link
Collaborator

@lenhattan86 lenhattan86 commented May 19, 2023

  • 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

Copy link
Contributor

@lawwong1 lawwong1 left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Collaborator

@wangchen615 wangchen615 left a comment

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
Collaborator Author

@lawwong1 can you approve the change after reviewing.

Copy link

@misho-kr misho-kr left a comment

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 :)

@@ -56,7 +56,9 @@ type signalFxClient struct {
client http.Client
authToken string
signalFxAddress string
hostKey string
Copy link

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

@@ -75,16 +75,16 @@ func NewMetricsServerClient() (watcher.MetricsProviderClient, error) {
if err != nil {
return nil, err
}
return metricsServerClient{
return &metricsServerClient{
Copy link

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

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.

@@ -346,7 +369,7 @@ Sample metaData payload:
"created": 1614534848000,
"creator": null,
"dimensions": {
"host": "test.dev.com",
"[hostKey]": "test.dev.com",
Copy link

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