Skip to content

Commit

Permalink
config: filter out robots and flag machines
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Aug 29, 2024
1 parent fcca3ef commit 8205056
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions invenio_app_rdm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@
from invenio_requests.resources.requests.config import request_error_handlers
from invenio_stats.aggregations import StatAggregator
from invenio_stats.contrib.event_builders import build_file_unique_id
from invenio_stats.processors import EventsIndexer, anonymize_user, flag_robots
from invenio_stats.processors import (
EventsIndexer,
anonymize_user,
filter_robots,
flag_machines,
)
from invenio_stats.queries import TermsQuery
from invenio_stats.tasks import StatsAggregationTask, StatsEventTask
from invenio_vocabularies.config import (
Expand Down Expand Up @@ -1130,6 +1135,7 @@ def github_link_render(record):
# =============
# See https://invenio-stats.readthedocs.io/en/latest/configuration.html


STATS_EVENTS = {
"file-download": {
"templates": "invenio_rdm_records.records.stats.templates.events.file_download",
Expand All @@ -1139,7 +1145,12 @@ def github_link_render(record):
],
"cls": EventsIndexer,
"params": {
"preprocessors": [flag_robots, anonymize_user, build_file_unique_id]
"preprocessors": [
filter_robots,
flag_machines,
anonymize_user,
build_file_unique_id,
]
},
},
"record-view": {
Expand All @@ -1151,7 +1162,12 @@ def github_link_render(record):
],
"cls": EventsIndexer,
"params": {
"preprocessors": [flag_robots, anonymize_user, build_record_unique_id],
"preprocessors": [
filter_robots,
flag_machines,
anonymize_user,
build_record_unique_id,
],
},
},
}
Expand Down

0 comments on commit 8205056

Please sign in to comment.