mimir icon indicating copy to clipboard operation
mimir copied to clipboard

Track the installation mode via the anonymous usage statistics

Open pracucci opened this issue 2 years ago • 4 comments

I would like to track via the anonymous usage statistics how was installed Mimir (Helm, Jsonnet, other). To make the tracking reliable I propose to add a new configuration option -usage-stats.installation-mode (defaults to custom), and then have Helm setting it to helm, and jsonnet to jsonnet.

pracucci avatar Oct 06 '22 15:10 pracucci

This looks like very fun. Can I have a try? Could you please add some guides?

Rustin170506 avatar Oct 12 '22 02:10 Rustin170506

This looks like very fun. Can I have a try? Could you please add some guides?

You will need to

  1. add configuration option as suggested by this issue
  2. initialize installation mode in initUsageStats, by using usagestats.GetString(...).Set(value) similar to what initUsageStats does for "blocks_storage_backend" here.

I think that's it for the code. Then we should modify Jsonnet and Helm to set the values.

pstibrany avatar Oct 12 '22 07:10 pstibrany

Then we should modify Jsonnet and Helm to set the values.

Yes, this too.

For jsonnet you can just inject a CLI flag to each component (e.g. a way could be define a dedicated config block usageStatsConfig similarly to grpcConfig in operations/mimir/config.libsonnet and merge it in every component args (similarly to what do we with grpcConfig).

For Helm, let's ask some help to @Logiraptor.

pracucci avatar Oct 12 '22 09:10 pracucci

For helm I would add an entry under mimir.config in the default values.yaml file here: https://github.com/grafana/mimir/blob/e7199818e100ab5d2038bd3bf0b1a6163624a347/operations/helm/charts/mimir-distributed/values.yaml#L83

It would probably look something like

mimir:
  config: |
    usage_stats:
      installation_mode: helm
    ... <rest of current config block omitted>

So this means the new configuration option would be available via both CLI and yaml configuration like most other flags.

Logiraptor avatar Oct 13 '22 22:10 Logiraptor