Bitcoin Forum
April 19, 2024, 11:47:07 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Metrics in Bitcoin Core with Opentelemetry  (Read 90 times)
dougEfish (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 27


View Profile
May 08, 2021, 04:28:13 PM
Merited by ABCbits (2), odolvlobo (1)
 #1

jlopp has a great fork for node metrics  https://github.com/jlopp/statoshi and I'll like to extend it.
Currently statoshi only exports metrics to statsd but I want to the ability to write (easily) to another collector.
Opentelemetry ( https://github.com/open-telemetry/opentelemetry-cpp ) is one lib I found that provides an abstract interface and already has multiple collectors (e.g. https://github.com/open-o11y/docs/tree/master/cpp-prometheus)
Thoughts on this approach? Is there another lib or methodology that makes more sense?

 
1713527227
Hero Member
*
Offline Offline

Posts: 1713527227

View Profile Personal Message (Offline)

Ignore
1713527227
Reply with quote  #2

1713527227
Report to moderator
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713527227
Hero Member
*
Offline Offline

Posts: 1713527227

View Profile Personal Message (Offline)

Ignore
1713527227
Reply with quote  #2

1713527227
Report to moderator
1713527227
Hero Member
*
Offline Offline

Posts: 1713527227

View Profile Personal Message (Offline)

Ignore
1713527227
Reply with quote  #2

1713527227
Report to moderator
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6670


bitcoincleanup.com / bitmixlist.org


View Profile WWW
May 08, 2021, 04:39:39 PM
 #2

Why wire Core to pass stats through a separate collector lib when you can just hardcode the information-gathering inside Core itself and have it export the data directly to a monitor like statsd or prometheus?

Any collecting will have to be done by making Core dump the stats to files since connecting Bitcoind with sockets to other auxiliary programs is not something I think the core devs are enthusiastic about doing.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3192



View Profile
May 08, 2021, 07:08:12 PM
Merited by ABCbits (1)
 #3

jlopp has a great fork for node metrics  https://github.com/jlopp/statoshi and I'll like to extend it.
Currently statoshi only exports metrics to statsd but I want to the ability to write (easily) to another collector.
Opentelemetry ( https://github.com/open-telemetry/opentelemetry-cpp ) is one lib I found that provides an abstract interface and already has multiple collectors (e.g. https://github.com/open-o11y/docs/tree/master/cpp-prometheus)

The actual OpenTelemetry site is this: https://opentelemetry.io/. The github project that you link to is a C++ client that is still in development.

Why wire Core to pass stats through a separate collector lib when you can just hardcode the information-gathering inside Core itself and have it export the data directly to a monitor like statsd or prometheus?

Any collecting will have to be done by making Core dump the stats to files since connecting Bitcoind with sockets to other auxiliary programs is not something I think the core devs are enthusiastic about doing.

If you are going to hard-code the information-gathering, you are going to end up creating a collection module anyway, so you might be better off using a mature well-tested library rather than rolling your own.

Bitcoin Core has performance bottlenecks. Creating a special telemetry build that would not be intended for general use is a good idea. Core devs should be enthusiastic about something like that.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
dougEfish (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 27


View Profile
May 08, 2021, 07:16:46 PM
 #4

My intent is not to integrate this into Core, but to fork Core so that:

1. I learn about the bitcoin software architecture through metrics
2. integrate an abstract lib that can be configured to export to statsd or prometheus (or even both and others)

 https://github.com/jlopp/statoshi hard codes statsd, I personally want prometheus.

Opentelemetry-cpp seems to be flexible in collecting metrics.   I'm wondering if opentelemetry-cpp is stable and worth it...or maybe there's another way.


NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6670


bitcoincleanup.com / bitmixlist.org


View Profile WWW
May 08, 2021, 09:59:47 PM
 #5

If you are going to hard-code the information-gathering, you are going to end up creating a collection module anyway, so you might be better off using a mature well-tested library rather than rolling your own.

My idea of performance logging is that all of those statoshi metrics don't need to be tracked, all listed as a graph in https://statoshi.info/, just the most important ones such as mempool size. This can be logged with a large interval and then written to disk while bitcoind is poll()ing for a message to come.

Opentelemetry-cpp seems to be flexible in collecting metrics.   I'm wondering if opentelemetry-cpp is stable and worth it...or maybe there's another way.

Whatever you do end up using, it had better lend itself easily to being included in automake/configure builds.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!