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

Add getting server id from /varz for the server #91

Merged
merged 2 commits into from
Jul 15, 2019
Merged

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Jul 12, 2019

This makes now the default to use the generated server id from the server instead of the endpoint that is specified via the command line.

# HELP nats_connz_limit limit
# TYPE nats_connz_limit gauge
nats_connz_limit{server_id="NB2MKHILGR5SVPLCBBQCTLK2D7PBOE6XDKP3EHXHHZ7M33JBEC4WHFCN"} 1024
# HELP nats_connz_num_connections num_connections
# TYPE nats_connz_num_connections gauge
nats_connz_num_connections{server_id="NB2MKHILGR5SVPLCBBQCTLK2D7PBOE6XDKP3EHXHHZ7M33JBEC4WHFCN"} 0

In order to revert to previous behavior can specify the following:

  -use_old_server_id
    	Disables using ServerID from /varz

Signed-off-by: Waldemar Quevedo wally@synadia.com

@@ -118,6 +118,7 @@ func main() {
flag.StringVar(&opts.HTTPUser, "http_user", "", "Enable basic auth and set user name for HTTP scrapes.")
flag.StringVar(&opts.HTTPPassword, "http_pass", "", "Set the password for HTTP scrapes. NATS bcrypt supported.")
flag.StringVar(&opts.Prefix, "prefix", "", "Set the prefix for all the metrics.")
flag.BoolVar(&opts.UseOldServerID, "use_old_server_id", false, "Disables using ServerID from /varz")
Copy link
Member

Choose a reason for hiding this comment

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

This could break existing dashboards and filters. Would it be better to go the opposite direction and have a flag that says "use_internal_server_id" - or something like that?

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
@coveralls
Copy link

coveralls commented Jul 12, 2019

Coverage Status

Coverage decreased (-1.8%) to 88.259% when pulling 9af0a92 on server-id into 43acc39 on master.

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
Copy link
Member

@ColinSullivan1 ColinSullivan1 left a comment

Choose a reason for hiding this comment

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

LGTM.

@wallyqs wallyqs merged commit b10b10e into master Jul 15, 2019
@wallyqs wallyqs deleted the server-id branch July 15, 2019 21:56
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.

None yet

3 participants