Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Add klaytn binary version information into Prometheus metric #1387

Closed
odg0318 opened this issue May 19, 2022 · 3 comments
Closed

Add klaytn binary version information into Prometheus metric #1387

odg0318 opened this issue May 19, 2022 · 3 comments
Assignees

Comments

@odg0318
Copy link
Contributor

odg0318 commented May 19, 2022

Is your request related to a problem? Please describe.

To check the klaytn binary version, I must connect to the instance shell and execute the binary like below.

$  kcn version
Klaytn v1.8.3

I want to check the binary version through Prometheus metrics.

Describe the solution you'd like

I suggest a new metric showing version information by Prometheus label.

klaytn_node_version{version="1.8.3"} 1

Metric name is klaytn_node_version and value is constantly 1.

The version information can be referred in the following code.
https://github.com/klaytn/klaytn/blob/dev/params/version.go#L33

Describe alternatives you've considered

N/A

Additional context

N/A

@kjhman21
Copy link
Collaborator

kjhman21 commented May 20, 2022

@aidan-kwon Could you please take a look at this?

@aidan-kwon
Copy link
Member

@odg0318 Thank you for the suggestion.
Actually, I am sure grafana can show labels of multiple nodes. If you know about this, please give us the link for the documents.

I think we can achieve the goal with another way.
How about setting VersionMajor * 10000 + VersionMinor * 100 + VersionPatch for the value of the version metric ?
Or we can make multiple metrics for each VersionMajor, VersionMinor, VersionPatch.

@odg0318
Copy link
Contributor Author

odg0318 commented May 22, 2022

@aidan-kwon Using label in prometheus for version is very common way. I think using label is better way. Let me share some examples from other project. node_exporter is very popular project for monitoring node status.

Three metrics are used for version with value 1.

  • go_info
  • node_exporter_build_info
  • node_os_info

The labels in Prometheus can be shown in Grafana table type.

example: node_exporter

 HELP go_info Information about the Go environment.
# TYPE go_info gauge
go_info{version="go1.17.3"} 1

# HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which node_exporter was built.
# TYPE node_exporter_build_info gauge
node_exporter_build_info{branch="HEAD",goversion="go1.17.3",revision="a2321e7b940ddcff26873612bccdf7cd4c42b6b6",version="1.3.1"} 1

# HELP node_os_info A metric with a constant '1' value labeled by build_id, id, id_like, image_id, image_version, name, pretty_name, variant, variant_id, version, version_codename, version_id.# TYPE node_os_info gauge
node_os_info{build_id="",id="amzn",id_like="centos rhel fedora",image_id="",image_version="",name="Amazon Linux",pretty_name="Amazon Linux 2",variant="",variant_id="",version="2",version_codename="",version_id="2"} 1

@aidan-kwon aidan-kwon added this to the v1.9.1 milestone Jul 5, 2022
@odg0318 odg0318 closed this as completed Jul 23, 2022
@dcground dcground modified the milestones: v1.9.2, v1.10.0 (Kore) Sep 2, 2022
@kjhman21 kjhman21 removed this from the v1.10 (Kore) milestone Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants