Commit Graph

16 Commits

Author SHA1 Message Date
Hector Sanjuan
4255cc3889
feat: telemetry plugin (#10866)
* Initial pass at Telemetry plugin

Currently, IP Shipyard, with the help of Probelab, monitor and extract
Amino/IPFS public network metrics with the use of DHT crawlers and
bootstrappers (via peerlog plugin). For example, we log all peer IDs seen and
their AgentVersion/Addresses obtained from the `identify` protocol, which
provides insights into protocol usage, total number of peers etc.

We would like to increase the ability to obtain more insights from the network
by collecting some more information in the future, but also to give users more
control over this collection (i.e. opt-out). The information collected will
not allow unique identification of anyone and is only used for aggregation.

Now, this PR explores a way of moving in this direction:

* A new "telemetry" fx plugin is in charge of dealing with telemetry
* The FX plugin allows to plug and make decisions / take actions during the setup phase:
  * We can inspect whether we are using Private Networks before the libp2p.Host has been initialized.
  * We can send telemetry after the libp2p Host is initialized.
  * Everything is self-contained. Custom builds can remove the plugin altogether without needing to surgically edit the code.

As for behaviour:

* The user can opt-in/out via EnvVar, file in the repo path or plugin configuration.
* Users on private networks or with custom bootstrappers are detected, offered a wall of text explaining why we need telemetry and invited to opt-in. Opt-out happens otherwise on a timeout (with no input). Their preferences are stored.
* Users on standard settings are opted-in by default. This is the status quo in Kubo already, except they don't get a chance to opt out.

The telemetry libp2p protocol is yet to be defined, but expect something similar to identify, with a protobuf being pushed to bootstrappers or to a specific telemetry node that we define. In the case of pnets, this will be done with a temporary peer.

* checkpoint

* telemetry plugin: second pass

* On first run it generates a UUID and shows a message to the user.
* UUID is persistend to "telemetry_uuid"
* Sends telemetry 1 minute after boot and every 24h
* LogEvent is the thing containing all the telemetry that is sent
* Opt-out possible via env-var or plugin configuration

* Telemetry: add changelog and environment variable documentation

* docs: improved daemon message

making it more obvious nothing was sent yet
and that user had 15m to out-out

plus some debug logs that confirm opt-out

* refactor: rename IPFS_TELEMETRY_MODE to IPFS_TELEMETRY

* fix: add User-Agent header to telemetry requests

---------

Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-08-18 20:46:05 +02:00
Gus Eggert
e0b08ed783
docs: use fx.Decorate instead of fx.Replace in examples (#9725)
In practice there are cases when fx.Replace doesn't work as expected,
so this updates the documentation to recommend using fx.Decorate
instead which is a bit easier to use.
2023-03-20 17:27:45 -04:00
Gus Eggert
795c2cf819
docs: add fx plugin documentation to plugins.md (#9191) 2022-08-13 08:08:52 -04:00
Marcin Rataj
8565bbb75c
refactor: kubo in ./docs 2022-07-06 23:45:25 +02:00
Marten Seemann
a9dfe38c4b stop using deprecated Go flag -i 2021-05-15 17:27:52 -07:00
Steven Allen
f55d3e8a15 feat: release 0.5.0 2020-04-28 07:48:34 -07:00
Steven Allen
aae957a70d
Merge pull request #6887 from ipfs/peerlog-plugin
feat: add peerlog plugin
2020-02-10 14:53:06 -08:00
Steven Allen
58e52f351d feat: make it possible to enable plugins with a build env variable 2020-02-10 13:05:32 -08:00
Steven Allen
943375b33f doc(plugin): document internal plugins 2020-02-10 12:48:25 -08:00
Steven Allen
150b6dd1bd plugins: add support for plugin configs
For now, configs specified in `daemon --init-config` and `init CONFIG` are not
available. We should fix this eventually but isn't necessary for now (and
supporting this will be annoying).
2019-08-29 17:17:23 -07:00
Steven Allen
45734ebe2c doc: link to the jaeger plugin
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-30 12:54:04 -08:00
Steven Allen
6b676d2782 plugin: document tracer and daemon plugin types
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-30 12:54:04 -08:00
Steven Allen
02a1feab37 docs: address CR on plugin documentation
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-26 19:50:27 -08:00
Steven Allen
f706bc69ba docs: flesh out plugin documentation
* Flesh out build documentation.
* Add datastore plugins to plugin list.
* Link to example plugin.
* Add a TOC.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-26 16:48:49 -08:00
Jeromy Johnson
be6935924f Update plugins.md
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-10-05 02:18:11 -07:00
Łukasz Magiera
a11bb713d6 docs: Add some docs on plugins
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-05 02:18:11 -07:00