Commit Graph

1845 Commits (30d0df345ab96e1f0e7cb65ef73207fc9fd322ae)
 

Author SHA1 Message Date
Adam Rutkowski 30d0df345a Update expectations for export tests 4 years ago
Adam Rutkowski 7859a73f4c Support '(not set)' in breakdown/filters 4 years ago
Adam Rutkowski 90621331c6 Make Device section components aware of (not set)
So that no extra sub-filters are possible when the unset
top item is selected.
4 years ago
Adam Rutkowski 912c9374d4
Bump clickhousex (per-query timeout override) (#2645)
https://github.com/plausible/clickhousex/pull/21
4 years ago
Adam Rutkowski 482249ffba
Better error message on site creation error (#2644)
* Ensure clear error message on site creation error

* Update colons in API error messages
4 years ago
Cenk Kücük f6ee17a400
Use hostname for server_name (#2642) 4 years ago
Vini Brasil a730763838
Add city name to imported_locations table (#2633)
See also #2608
4 years ago
Adam Rutkowski f678cfab25
Prevent error reports from being sent with short feedback (#2635) 4 years ago
Vini Brasil 061cb6ec83
Remove the ability to collapse the main graph + transition bug fix (#2627)
* Remove the ability to collpase the top graph

This commit removes the ability to collapse the top graph. The graph
collapsed whenever `metric` was falsy. I removed all related code to
that. Metric now defaults to visitors.

We want to add new items to top stats, and this commit will make it
easier to change it. Also, there's currently a bug where top stats is
randomly collapsing, which should be fixed by this commit.

* Refactor graph and top stats loading state

The graph loading state shows and hides the graph conditionally
depending on whether the data is loaded, loading or refreshing.

The current code is a bit difficult to read because its big
conditionals. This commit refactors the loading state making it easier
to read.

This commit also fixes a bug where the graph wasn't fading out when
changing metrics.
4 years ago
Adam Rutkowski 8f9f032968
Delay stats deletions (#2632)
* Implement Site removal transaction

* Implement Stats removal Oban worker

* Configure site removal queue

* Call Site.Removal.run() instead of Purge.delete_site!

* Test site/stats removal

* Remove FIXME - filed a ticket

* Over-communicate lenghty deletion process to the users
4 years ago
Vini Brasil 1b9e6d9ae5
Add city geolocation data to seeds (#2626) 4 years ago
Marko Saric 66c65e0071
Changes to the site settings danger zone (#2629)
* Changes to the site settings danger zone

The idea was to:

1. Show a transfer site ownership message to owners of the site only. This will make ownership transfer feature more discoverable. Will also help people to transfer ownership of a site rather than deleting the whole thing when that makes more sense
2. Add a note that site deletion is a delayed operation
3. Make some other tiny copy changes

What did I break? :)

* Fix markup so the long text wraps sooner

* Fix indent

---------

Co-authored-by: Adam Rutkowski <hq@mtod.org>
4 years ago
Adam Rutkowski ad12e1ef31
Show user feedback form on server errors (#2617)
* Move Endpoint errors setup to common config

* Implement naive Sentry link resolver

* Implement error report e-mail

* Delete static sentry script

* Implement user feedback form on server errors

* Re-arrange pipe

* Use Sentry.Config.dsn() where applicable

* Fix typo

* Use Map.replace/3
4 years ago
Adam Rutkowski 5bb53c7e35
Revert "parse date labels by local timezone instead of UTC (#2601)" (#2619)
This reverts commit 7a7076ed20.
4 years ago
Marko Saric c1d174d0fa
Some changes to the "locked site" copy (#2615)
Some changes to be more consistent with the emails we send. Also "valid" subscription rather than "active" subscription fits better for the different cases where this screen is shown
4 years ago
RobertJoonas 7a7076ed20
parse date labels by local timezone instead of UTC (#2601) 4 years ago
RobertJoonas bd0de97521
Fix returning more pageviews with a visit property filter (#2612)
* fix subquery for sessions in base_event_query/2

As the 'sessions' table is using the CollapsingMergeTree engine, we have
to select session_id's distinctively. Otherwise we will get multiple rows
(with sign -1 and 1) as long as the background merge hasn't happened.

* update changelog

* use GROUP BY instead of SELECT DISTINCT

* remove comma
4 years ago
ruslandoga 8640ba499f
fix clickhouse-ci rule in Makefile (#2614) 4 years ago
ruslandoga e3f095ade7
fix class name typo and include it in safelist (#2610) 4 years ago
Adam Rutkowski 1a4b65c36c
Communicate site creation edge cases to the users (#2605)
* Fingerprint DBConnection.ConnectionError in Sentry

* Check events before creating a site

* Enable sites limit screen

* Remove debugging remnant

* Fix buggy assertions

This wasn't doing what expected:

  iex(1)> Repo.exists?(Plausible.Site, domain: "foo")
  [debug] QUERY OK source="sites" db=0.6ms idle=1906.2ms
  SELECT TRUE FROM "sites" AS s0 LIMIT 1 []

* Encapsulate check to satisfy credo

* Use less technically involved error message

* Bring back e-mail to the limit error message
4 years ago
Vini Brasil 86d5098b31
Stop logging invalid_address errors from Locus (#2604)
This commit stops logging `{:invalid_address, "ip"}` errors. This
reduces noise on Sentry, that is capturing error logs. Other errors are
still logged.
4 years ago
RobertJoonas c4b8bf8c32
Fix metric undefined (#2589)
* extract maybeUpdateMetric function

* reset graph metric after fetching top stats

* fix bug

Also make sure we do not allow 'metric' to become undefined anymore

* keep graph hidden when empty metric saved

* reset metric in setState callback

* pass function not call
4 years ago
Uku Taht 818d4404a8
Support custom events and props in mix send_pageview (#2606) 4 years ago
ruslandoga 166748dcf2
Replace Geolix with Locus (#2362)
This PR replaces geolix with locus to simplify self-hosted setup. locus can auto-update maxmind dbs which are recommended for self-hosters if they want city-level geolocation. locus is also a bit faster.

This PR also uses a test mmdb file from https://github.com/maxmind/MaxMind-DB for e2e geolocation tests without stubs.
4 years ago
Uku Taht 2a4061de8c
Make checkly alert after 5 minutes of downtime (#2599) 4 years ago
Adam Rutkowski 5ba8697c31
Fingerprint DBConnection.ConnectionError in Sentry (#2597) 4 years ago
Vini Brasil cb5d8a0d25
Make warning notices responsive (#2591)
Closes #2528
4 years ago
RobertJoonas 3999f282a5
Last updated tooltip (#2576)
* extract blinkingDot function

* position pulsating-circle with tailwind instead

* remove unused function

* extract renderStatName function

* display seconds since last realtime update

Adds a 'Last updated X seconds ago' label to the Current Visitors tooltip.

* small refactor: avoid duplication of this.props and this.state

* show the 'last updated ...' tooltip in historical

* changelog update

* use className utility function
4 years ago
David Janda b6349df475
Display pageviews in details modal for top pages when filtering by a source (#2585) 4 years ago
Adam Rutkowski 61bf624761
Sentry cleanup (#2590)
* Filter DBConnection logs for clickhouse in Sentry

Removing the never matching clause btw

* Exclude Plug.CSRFProtection.InvalidCSRFTokenError from Sentry

* Turn common Sentry captures into logged warnings

* Exclude fonts from static conf and InvalidPathError from Sentry
4 years ago
Adam Rutkowski 97a3ce72e4
Update clickhousex & fingerprint sentry errors (#2587)
* Revert "Revert "Fingerprint Clickhousex.Error exceptions in Sentry (#2578)" (#2586)"

This reverts commit a78e07236a.

* Bump clickhousex to include https://github.com/plausible/clickhousex/pull/20
4 years ago
Cenk Kücük d9011e4189
unmute checkly (#2588) 4 years ago
Adam Rutkowski a78e07236a
Revert "Fingerprint Clickhousex.Error exceptions in Sentry (#2578)" (#2586)
This reverts commit 2428a2bf36.
4 years ago
Adam Rutkowski 2428a2bf36
Fingerprint Clickhousex.Error exceptions in Sentry (#2578)
* Fingerprint Clickhousex.Error exceptions in Sentry

* Update clickhousex
4 years ago
Marko Saric 934c3c323e
Some changes to the 'dashboard locked' email copy (#2584) 4 years ago
Marko Saric 5ba446e87c
Some changes to the 'over limit' email copy (#2583) 4 years ago
Adam Rutkowski 4bde884da8
Self-host Sentry user feedback script (#2579)
* Add static, minified sentry bundle

OG source: https://browser.sentry-cdn.com/5.9.1/bundle.min.js

* On 500s, load our self-hosted sentry bundle
4 years ago
ruslandoga a6e75ada7b
update ecto to include db url scheme (#2570)
* update ecto to include db url scheme

* update clickhousex

* update changelog
4 years ago
Uku Taht 256e8263c0 Add Hetzner load balancer to health checks 4 years ago
Uku Taht f10c67e0e7 Add custom.plausible.io to checkly monitoring 4 years ago
RobertJoonas 13a05b4e1e
Change metric labels for realtime with goal filter (#2560)
* change metric labels for realtime with goal filter

* changelog

* fix formatting
4 years ago
Uku Taht 1772ddff17
Add Checkly (#2520)
* Add Checkly Terraform config

* add deployment workflow

* use pagerduty instead of email for notifications

* use terraform cloud backend

* update variable declaration

* rename checkly check group

* update syntax

* test trigger

* Revert "test trigger"

This reverts commit 333e82beac.

* run a single job at a time

Co-authored-by: Cenk Kücük <c@cenk.me>
4 years ago
Uku Taht 51fc9c0945
Refine parallel application-side joins (#2564)
* Consolidate task timeouts, incrase to 15s

* Use Task.async_stream for parallel Clickhouse queries

* Propagate Opentelemetry context to child Task process
4 years ago
David Janda f949278d39
Convert list elements to button elements for stats tabs in order to enable keyboard navigation (#2526) 4 years ago
Adam Rutkowski 89da676215
Update clickhousex (start using Mint and proper pool management) (#2502)
* Pin clickhousex to @ruslandoga's rebase branch

* Bump lockfile

* Use HTTP pings

* Update lockfile

* Pin to master
4 years ago
Vini Brasil 4503895d0a
Fix breakdown API pagination when using event metrics (#2562)
* Fix breakdown API pagination when using event metrics

This commit fixes a bug where the subsequent breakdown API pages had
the same items as the first page. The fix sorts the underlying
ClickHouse query by timestamp, keeping the same order between requests,
as we use OFFSET/LIMIT pagination.

* Fix repeated results assertion

* Add different ORDER BY to each breakdown property
4 years ago
Adam Rutkowski 44afbaa2f9
Wrap paddle actions with DB transactions (#2558)
* Wrap paddle actions with DB transactions

* Bow to credo

* Make the paddle transactions crash when applicable

* s/changeset/details
4 years ago
Uku Taht 1785653b1e
Ignore unknown countries (#2556)
* Ignore XX and T1 countries

* Add fallback if country_code=nil

* Lookup city overrides directly in CityOverrides module

* Changelog

* Add empty moduledoc

* Remove redundant comment
4 years ago
RobertJoonas 47e21121db
Realtime dashboard improvements (#2445)
* add a new realtime-update-timer module

* hook to the new 'tick' event in ListReport for auto-updates

This commit fixes the bug where all reports using the `ListReport` component did not
auto-update in realtime mode. Those reports are:

- Pages (Top / Entry / Exit)
- Locations (Countries / Regions / Cities)
- Devices (Screen Sizes / Browsers + versions / OS-s + versions)

* fetch data for ListReports only when scrolled into view

* refactor fetching data in ListReport

* refer to one source of truth for utm tags

* make the 'All' tab in Sources auto-update

* make all UTM tabs in Sources auto-update

* fetch UTM data only when scrolled into view

* auto-update Referrers with the new timer

* auto-update google search terms

* auto-update Conversions

* make countries map auto-update

* auto-update visitor-graph and top stats with new timer

* use new tick event for current visitors (in Historical)

* remove the old timer class

* update changelog

* Visual improvements to automatic realtime updates (#2532)

* minor consistency fix for text color in dark mode

* use FlipMove in goal conversions report

* use FlipMove in ListReports

* set main graph and top stats loading state correctly

* refactor isIntervalValid function

* enforce intervals are valid when set and stored

* remove duplicate data fetching on interval change

Fetching new data is handled by the `fetchGraphData` callback in `updateInterval`

* refactor updateMetric function

* make it clearer why 'metric' can be a faulty value

* extract 'query' and 'site' variables from 'this.props'

* reset interval state only when period is changed

The 'maybeRollbackInterval' function was also used to fetch data. This commit replaces
all those function calls with 'fetchGraphData' which better describes the actual behavior.
We should only worry about rolling back the interval if 'query.period' has changed.

This commit also stops the graph from flickering when it is updated in realtime.

* update names of two variables

* remove unnecessary negation

* make collapsed graph state more explicit

* consider stored invalid intervals when graph mounts

* fix not showing loading spinner regression

* remove interval state from VisitorGraph (#2540)

* Realtime prop breakdown (#2535)

* disable load more in realtime mode

* extract doFetch function

* separate fetchPropBreakdown and fetchNextPage functions

* subscribe for auto-updates in realtime

* improve readability with function name changes
4 years ago
Vini Brasil 22e2ae1844
Add OTEL tracing to breakdown functions (#2544)
Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
4 years ago