go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

Add informational metrics to prometheus endpoint

Open ulope opened this issue 5 years ago • 17 comments

System information

Geth version: 1.9.23 OS & Version: OSX

Feature request

Please add informational metrics to the prometheus endpoint:

  • Chain / network info
  • Geth version

For example:

# TYPE chain_info gauge
chain_info{chain_id="5", network_name="goerli"} 1
# TYPE geth_info gauge
geth_info{version="1.9.23-stable", arch="amd64", os="darwin", commit="deadbeef", protocol_versions="63,64,65"} 1

ulope avatar Nov 03 '20 14:11 ulope

We'd need to investigate a bit how to expose metadata in Prometheus and InfluxDB. I'm all for surfacing these infos, just have no idea yet what the standard way is. If you have any docs you could point us to, that would be grand.

karalabe avatar Jun 17 '21 08:06 karalabe

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have more relevant information or answers to our questions so that we can investigate further.

no-response[bot] avatar Jul 24 '21 09:07 no-response[bot]

@karalabe Sorry I missed this.

Here's a (pretty old but still accurate) post on the Robust Perception blog

As well as a sample of some of the exporters / tools I've used in the past that include such a metric:

My example above follows this pattern.

ulope avatar Oct 05 '21 13:10 ulope

I would like to work on this issue if this is still required.

Ab-hishek avatar Oct 12 '21 20:10 Ab-hishek

@karalabe @holiman @MariusVanDerWijden can this be closed ?

MONITORING GETH WITH INFLUXDB AND GRAFANA : https://ethereum.org/en/developers/tutorials/monitoring-geth-with-influxdb-and-grafana/ has been already added.

muddlebee avatar Nov 04 '21 19:11 muddlebee

@ulope FYI

muddlebee avatar Nov 04 '21 19:11 muddlebee

Cannot be closed, no. The issue requests meta-information to be exposed via influx/prometheus, like

# TYPE chain_info gauge
chain_info{chain_id="5", network_name="goerli"} 1
# TYPE geth_info gauge
geth_info{version="1.9.23-stable", arch="amd64", os="darwin", commit="deadbeef", protocol_versions="63,64,65"} 1

Not fixed

holiman avatar Nov 04 '21 20:11 holiman

@holiman this looks interesting. Can I work on this? I am participating in Ethereum "Core Developer" Apprenticeship Program . I might add this as well in my deliverable tasks.

If this sounds good. Can you assign this task to me please?

muddlebee avatar Nov 04 '21 20:11 muddlebee

Sure, just go ahead. (no need to assign the ticket though)

holiman avatar Nov 04 '21 21:11 holiman

this ticket is still open? should we close it?

aertoria avatar Jun 29 '22 06:06 aertoria

I also really need that metrics, it's very useful!

ghost avatar Oct 05 '22 10:10 ghost

Is this feature still needed? Saw an old relevant PR: https://github.com/jorgeacortes/go-ethereum/commit/cff0d5924b1f531fcdf7da59cea5548c6afbc4a2 why didn't we merge that? If this feature is still needed, I would like to have a try

timqian avatar Feb 15 '23 03:02 timqian

why didn't we merge that?

The PR in question is here: https://github.com/ethereum/go-ethereum/pull/24877 . As for why it has not been merged, I would guess that the answer is that it touches 17 files and adds 423 LOC, adding a new gauge-type. Reviewing + testing that is non-trivial, particularly since the testing involves not only the code itself, but testing against e.g. grafana.

So, (and this is not criticism!), it kind of has the combo of being "rather large amount of work" and also "not considered high prio".

If this feature is still needed, I would like to have a try

If you want to help push the feature along, I think rather than implementing it all over again (unless you have some better idea about how to do it), it would be better to spend the effort towards reviewing and testing that pr, and give feedback on how it works.

holiman avatar Feb 15 '23 08:02 holiman

THere was AFAIK a different PR opened that also does this for influx. Should look into that, we need both.

karalabe avatar Feb 15 '23 09:02 karalabe

Thankyou forball the work you're putting in , what have I got to do at my end Frances Reid

On Wed, 15 Feb 2023, 09:02 Péter Szilágyi, @.***> wrote:

THere was AFAIK a different PR opened that also does this for influx. Should look into that, we need both.

— Reply to this email directly, view it on GitHub https://github.com/ethereum/go-ethereum/issues/21783#issuecomment-1430974032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYKCHV6DS52BAWOH5CVQ6DLWXSLRHANCNFSM4TI3BV4Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Francesreid avatar Feb 15 '23 14:02 Francesreid

@holiman Thanks for the note, the PR looks good to me, looks adding a new gauge-type is inevitable. I have tested it and left a comment there @karalabe I didn't see another PR doing this for influx. Seems the influx part is also handled in the same PR

timqian avatar Feb 16 '23 02:02 timqian

I made a few comments on the PR. This would be very useful to have: for anyone attempting to manage multiple instances of geth, having version information to hand via prometheus allows much easier understanding of which versions are where.

mcdee avatar Feb 16 '23 23:02 mcdee

THere was AFAIK a different PR opened that also does this for influx. Should look into that, we need both.

The PR contains both. I searched but haven't found any other PR, if you know of one I'd gladly check what it contains and if there's anything we're missing.

holiman avatar Aug 28 '23 12:08 holiman

Closed by https://github.com/ethereum/go-ethereum/pull/24877

holiman avatar Aug 31 '23 17:08 holiman