From d9610a8753b4e6db507f70d2a600546e9ad984ed Mon Sep 17 00:00:00 2001 From: Mathieu Pillard Date: Wed, 25 Sep 2024 15:25:42 +0200 Subject: [PATCH] Add basic documentation about the various types of logs that AMO has (#22702) --- docs/conf.py | 2 +- docs/index.md | 1 + docs/topics/logs.md | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 docs/topics/logs.md diff --git a/docs/conf.py b/docs/conf.py index 7e1b03209d6..525f38d00c7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -52,7 +52,7 @@ # General information about the project. project = u'addons-server' -copyright = u'2023, Mozilla' +copyright = u'2024, Mozilla' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/index.md b/docs/index.md index 38224245e52..86cfc7e0493 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,6 +14,7 @@ refers to this project. topics/readme_include topics/api/index topics/development/index +topics/logs topics/remote_addr topics/third-party topics/blocklist diff --git a/docs/topics/logs.md b/docs/topics/logs.md new file mode 100644 index 00000000000..c2a980ddaeb --- /dev/null +++ b/docs/topics/logs.md @@ -0,0 +1,36 @@ +# Logs + +(logs)= + +We have various types of logs with different purposes in AMO. The following +tables summarize their characteristics: + + +| | `ActivityLog` / `LogEntry` | +|-| -------------------------- | +|Type| Database entry | +|Purpose| Storing information about developers/reviewers/admin actions | +|Stores IP| Depending on the action | +|Stores user| Yes, explictly (mandatory) | +|Retention| A year to forever depending on the action | +|Access| Redash | + +| | [Application logging](./development/logging.md) | +|-| ----------------------------------------------- | +|Type| JSON (MozLog [^1]) | +|Purpose| Tracing specific calls / debugging | +|Stores IP| Yes | +|Stores user | Yes, if applicable (automatically for authenticated requests) | +|Retention| 6 months | +|Access| [Google Log Explorer](https://mozilla-hub.atlassian.net/wiki/spaces/SRE/pages/27921597/AMO+Dev+Resources#Application-Logs) | + +| | CDN logs | +|-| -------- | +|Type| HTTP access logs | +|Purpose| Generic request logging | +|Stores IP| Yes | +|Stores user| No | +|Retention| 3 months | +|Access| Google Cloud Storage Bucket | + +[^1]: addons-server and addons-frontend both produce application logs through python `logging` and `pino` respectively, emitting them in the [MozLog format](https://wiki.mozilla.org/Firefox/Services/Logging). That gets sent to our application logging pipeline used by all Firefox services.