-
Notifications
You must be signed in to change notification settings - Fork 68
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
[5.0] Prometheus: Ensure valid unique_conn_node_id #1879
Conversation
Is the temporary connection id semi-permanent (eg it is not changing every 30 seconds after re-connect attempt)? If there are multiple temporary connections does each one get a unique name? |
c->unique_conn_node_id = fc::sha256::hash(c->p2p_address).str().substr(0, 7); | ||
} else if (!c->remote_endpoint_ip.empty()) { | ||
c->unique_conn_node_id = fc::sha256::hash(c->remote_endpoint_ip).str().substr(0, 7); | ||
} else { |
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.
Is c->connection_id
always not empty in this else
condition?
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.
Yes, It is assigned at connection object construction.
Yes. It is even permanent on re-start of nodeos. It will change when connection/handshake complete assuming a connection/handshake ever happens. |
@@ -181,7 +181,7 @@ def extractPrometheusMetric(connID: str, metric: str, text: str): | |||
errorLimit -= 1 | |||
continue | |||
Print('Throttled Node Start State') | |||
throttledNodePortMap = {port: id for id, port in connPorts if id != ''} | |||
throttledNodePortMap = {port: id for id, port in connPorts if port != '0'} |
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.
should 9877
be compared as above?
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.
This is 9877
so that is not needed.
Make sure a valid and unique connection id is provided to prometheus. If not connected, then use a temporary id until the connection is established and a handshake is received.
Resolves #1871