dub icon indicating copy to clipboard operation
dub copied to clipboard

Exporting the Analytics Data

Open Prajwalprakash3722 opened this issue 1 year ago • 1 comments

Our organization uses Prometheus and Grafana to view analytics, and we would really love to have all the analytics in one place. Is there any way to export the data periodically?

Prajwalprakash3722 avatar Dec 06 '23 18:12 Prajwalprakash3722

Hey, yes there is a way to export data periodically. we can use Prometheus API to get the data programmatically and Grafana supports scheduled exports. we can export and send data periodically using this. I can work on this

ranjithjupaka avatar Dec 11 '23 12:12 ranjithjupaka

Exporting analytics data is especially important now that all paid Dub plans have limits on analytics retention. Pro and Business plan changed from unlimited link history to 1 and 2 years respectively.

tonyflo avatar Jan 23 '24 15:01 tonyflo

@tonyflo thanks for the callout – will get this prioritized soon :salute:

steven-tey avatar Jan 24 '24 00:01 steven-tey

I can work on this if you want ? @steven-tey

Prajwalprakash3722 avatar Jan 24 '24 02:01 Prajwalprakash3722

A hacky fix if you self host dub, you can just plug MySQL with grafana and write SQL queries :)

Prajwalprakash3722 avatar Jan 25 '24 11:01 Prajwalprakash3722

@Prajwalprakash3722 sure, thank you! A good approach would be the way Plausible handles this: https://plausible.io/plausible.io

steven-tey avatar Jan 26 '24 05:01 steven-tey

Let me clarify, do we want to export the analytics as:

  • API (https://plausible.io/docs/stats-api)
  • Download option (https://plausible.io/docs/export-stats)
  • Expose it in Prometheus metric format

Plausible supports options 1 and 2.

Prajwalprakash3722 avatar Jan 26 '24 09:01 Prajwalprakash3722

Let's start with the Download Option @Prajwalprakash3722 🙏

steven-tey avatar Jan 28 '24 19:01 steven-tey

Alright 🆗

Prajwalprakash3722 avatar Jan 29 '24 06:01 Prajwalprakash3722

Wanted to follow up here – this feature has been shipped: https://d.to/export

Shoutout to @flornkm for building this out!

steven-tey avatar Mar 28 '24 17:03 steven-tey