Donders-Institute / bidscoin

BIDScoin converts your source-level neuroimaging data to BIDS
https://bidscoin.readthedocs.io
GNU General Public License v3.0
129 stars 35 forks source link

Add the possibility to track bidscoin usage #200

Closed marcelzwiers closed 1 year ago

marcelzwiers commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, it is unclear how much and how bidscoin is used

Describe the solution you'd like Using an opt-in/out user setting (#197), I want to get information on:

Perhaps this information can be gathered and put into a dashboard using a combination of:

Describe alternatives you've considered I've considered etelemetry (used by e.g. heudiconv, nipype -> fmriprep, mriqc, etc)

robertoostenveld commented 1 year ago

here is a part of the apache log (ip addresses on the left cut off)

image

hurngchunlee commented 1 year ago

Another option using google analytics: https://practicaldatascience.co.uk/data-science/how-to-send-data-to-google-analytics-in-python-using-pygamp

btw, some thoughts on the Apache/Logstash/Grafana approach:

Grafana only displays data in time series format. Actually data should be transformed into one of the time series databases (e.g. prometheus, OpenTSDB) supported by Grafana; or if general purpose database (SQL or Elastic) is used behind Grafana, certain data structure/schema should be followed.

If filebeat or logstash is used to parse web server log, it is beter to store the data in Elastic and use Kibana for display. The so-called ELK stack.

marcelzwiers commented 1 year ago

Perhaps, but pygamp only had 6 commits altogether and seems no longer supporting the new API? https://github.com/flyandlure/pygamp/issues/2

marcelzwiers commented 1 year ago

Is Grafana Loki perhaps a solution? https://grafana.com/docs/loki/latest/get-started/overview/

hurngchunlee commented 1 year ago

Is Grafana Loki perhaps a solution? https://grafana.com/docs/loki/latest/get-started/overview/

Grafana Loki is very interesting. It may be also useful for collecting and analyzing server logs concerning IT security. Will have a look into it.

marcelzwiers commented 1 year ago

The Loki <> Grafana option seems to be the way forward. You can now see bidscoin tracking with:

$ bidscoin --tracking show
INFO | trackusage = 'yes'       # Upload anonymous usage data if 'yes' (maximally 1 upload every 1 hour)
Data upload example: -> https://telemetry.donders.ru.nl/bidscoin
{
   event:       bidscoin
   bidscoin:    4.1.1
   python:      3.11.5
   system:      Linux
   release:     5.14.21-150500.55.19-default
   userid:      2feb5e843ccb54a41416f963a6c88a5d
   hostid:      e138231a68ad82f054e3d756c6634ba1
}

NB: As you can see above, BIDScoin does NOT upload any identifying details about you nor
information about the data. Uploaded data is used to generate usage and error statistics,
and helps the developers to improve BIDScoin