mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 16:26:31 +01:00
Merge branch 'develop' into feat/add-rootless-dockerfiles
This commit is contained in:
@@ -1735,37 +1735,30 @@
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_optionsAppearance",
|
||||
"value": "nRhnJkTT8cPs",
|
||||
"isInheritable": false,
|
||||
"position": 180
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "nRhnJkTT8cPs",
|
||||
"value": "KSZ04uQ2D1St",
|
||||
"isInheritable": false,
|
||||
"position": 190
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "KSZ04uQ2D1St",
|
||||
"value": "WOcw2SLH6tbX",
|
||||
"isInheritable": false,
|
||||
"position": 200
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "WOcw2SLH6tbX",
|
||||
"isInheritable": false,
|
||||
"position": 210
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "veGu4faJErEM",
|
||||
"isInheritable": false,
|
||||
"position": 220
|
||||
"position": 210
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
@@ -2053,30 +2046,23 @@
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_options",
|
||||
"value": "oPVyFC7WL2Lp",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "oPVyFC7WL2Lp",
|
||||
"value": "3seOhtN8uLIY",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "3seOhtN8uLIY",
|
||||
"isInheritable": false,
|
||||
"position": 50
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "cbkrhQjrkKrh",
|
||||
"isInheritable": false,
|
||||
"position": 60
|
||||
"position": 50
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
@@ -3076,65 +3062,51 @@
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_optionsTextNotes",
|
||||
"value": "zEY4DaJG4YT5",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_optionsCodeNotes",
|
||||
"value": "iPIMuisry3hd",
|
||||
"isInheritable": false,
|
||||
"position": 20
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "zEY4DaJG4YT5",
|
||||
"value": "6f9hih2hXXZk",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "iPIMuisry3hd",
|
||||
"value": "4TIF1oA4VQRO",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "6f9hih2hXXZk",
|
||||
"value": "BlN9DFI679QC",
|
||||
"isInheritable": false,
|
||||
"position": 50
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "4TIF1oA4VQRO",
|
||||
"value": "XpOYSgsLkTJy",
|
||||
"isInheritable": false,
|
||||
"position": 60
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "BlN9DFI679QC",
|
||||
"isInheritable": false,
|
||||
"position": 70
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "XpOYSgsLkTJy",
|
||||
"isInheritable": false,
|
||||
"position": 80
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "s1aBHPd79XYj",
|
||||
"isInheritable": false,
|
||||
"position": 90
|
||||
"position": 70
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
@@ -5479,19 +5451,12 @@
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_optionsTextNotes",
|
||||
"isInheritable": false,
|
||||
"position": 20
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "BlN9DFI679QC",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
"position": 20
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
@@ -5668,23 +5633,16 @@
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_optionsTextNotes",
|
||||
"value": "zEY4DaJG4YT5",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "zEY4DaJG4YT5",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "BFvAtE74rbP6",
|
||||
"isInheritable": false,
|
||||
"position": 50
|
||||
"position": 40
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
@@ -6694,19 +6652,12 @@
|
||||
"isInheritable": false,
|
||||
"position": 20
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_optionsTextNotes",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "zEY4DaJG4YT5",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
@@ -10632,177 +10583,93 @@
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_globalNoteMap",
|
||||
"value": "YKWqdJhzi2VY",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_sqlConsole",
|
||||
"value": "ivYnonVFBxbQ",
|
||||
"isInheritable": false,
|
||||
"position": 50
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "YKWqdJhzi2VY",
|
||||
"value": "eIg8jdvaoNNd",
|
||||
"isInheritable": false,
|
||||
"position": 60
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_search",
|
||||
"value": "QEAPj01N5f7w",
|
||||
"isInheritable": false,
|
||||
"position": 70
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_bulkAction",
|
||||
"value": "m1lbrzyKDaRB",
|
||||
"isInheritable": false,
|
||||
"position": 80
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "ivYnonVFBxbQ",
|
||||
"value": "x3i7MxGccDuM",
|
||||
"isInheritable": false,
|
||||
"position": 90
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_backendLog",
|
||||
"value": "bdUJEHsAPYQR",
|
||||
"isInheritable": false,
|
||||
"position": 100
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_userHidden",
|
||||
"value": "xYmIYSP6wE3F",
|
||||
"isInheritable": false,
|
||||
"position": 110
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_lbTplRoot",
|
||||
"value": "u3YFHC9tQlpm",
|
||||
"isInheritable": false,
|
||||
"position": 120
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_share",
|
||||
"value": "qzNzp9LYQyPT",
|
||||
"isInheritable": false,
|
||||
"position": 130
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_lbRoot",
|
||||
"value": "CdNpE2pqjmI6",
|
||||
"isInheritable": false,
|
||||
"position": 140
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_options",
|
||||
"value": "R9pX4DGra2Vt",
|
||||
"isInheritable": false,
|
||||
"position": 150
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_lbMobileRoot",
|
||||
"isInheritable": false,
|
||||
"position": 160
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "_help",
|
||||
"isInheritable": false,
|
||||
"position": 170
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "eIg8jdvaoNNd",
|
||||
"isInheritable": false,
|
||||
"position": 180
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "QEAPj01N5f7w",
|
||||
"isInheritable": false,
|
||||
"position": 190
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "m1lbrzyKDaRB",
|
||||
"isInheritable": false,
|
||||
"position": 200
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "x3i7MxGccDuM",
|
||||
"isInheritable": false,
|
||||
"position": 210
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "bdUJEHsAPYQR",
|
||||
"isInheritable": false,
|
||||
"position": 220
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "xYmIYSP6wE3F",
|
||||
"isInheritable": false,
|
||||
"position": 230
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "u3YFHC9tQlpm",
|
||||
"isInheritable": false,
|
||||
"position": 240
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "qzNzp9LYQyPT",
|
||||
"isInheritable": false,
|
||||
"position": 250
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "CdNpE2pqjmI6",
|
||||
"isInheritable": false,
|
||||
"position": 260
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "R9pX4DGra2Vt",
|
||||
"isInheritable": false,
|
||||
"position": 270
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "4TIF1oA4VQRO",
|
||||
"isInheritable": false,
|
||||
"position": 280
|
||||
"position": 160
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
@@ -10824,6 +10691,33 @@
|
||||
"dataFileName": "Hidden Notes_image.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"isClone": false,
|
||||
"noteId": "uYF7pmepw27K",
|
||||
"notePath": [
|
||||
"pOsGYCXsbNQG",
|
||||
"tC7s2alapj8V",
|
||||
"uYF7pmepw27K"
|
||||
],
|
||||
"title": "Metrics",
|
||||
"notePosition": 240,
|
||||
"prefix": null,
|
||||
"isExpanded": false,
|
||||
"type": "text",
|
||||
"mime": "text/html",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "label",
|
||||
"name": "iconClass",
|
||||
"value": "bx bxs-data",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "Metrics.md",
|
||||
"attachments": []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
# Configuration (config.ini or environment variables)
|
||||
Trilium supports configuration via a file named `config.ini` and environment variables. Please review the file named [config-sample.ini](https://github.com/TriliumNext/Notes/blob/develop/config-sample.ini) in the [Notes](https://github.com/TriliumNext/Notes) repository to see what values are supported.
|
||||
Trilium supports configuration via a file named `config.ini` and environment variables. Please review the file named [config-sample.ini](https://github.com/TriliumNext/Notes/blob/develop/apps/server/src/assets/config-sample.ini) in the [Notes](https://github.com/TriliumNext/Notes) repository to see what values are supported.
|
||||
|
||||
You can provide the same values via environment variables instead of the `config.ini` file, and these environment variables use the following format:
|
||||
|
||||
|
||||
109
docs/User Guide/User Guide/Advanced Usage/Metrics.md
Normal file
109
docs/User Guide/User Guide/Advanced Usage/Metrics.md
Normal file
@@ -0,0 +1,109 @@
|
||||
# **Trilium Metrics API**
|
||||
|
||||
The Trilium metrics API provides comprehensive monitoring data about your Trilium instance, designed for external monitoring systems like Prometheus.
|
||||
|
||||
## **Endpoint**
|
||||
|
||||
* **URL**: `/etapi/metrics`
|
||||
* **Method**: `GET`
|
||||
* **Authentication**: ETAPI token required
|
||||
* **Default Format**: Prometheus text format
|
||||
|
||||
## **Authentication**
|
||||
|
||||
You need an ETAPI token to access the metrics endpoint. Get one by:
|
||||
|
||||
```
|
||||
# Get an ETAPI token
|
||||
curl -X POST http://localhost:8080/etapi/auth/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"password": "your_password"}'
|
||||
|
||||
```
|
||||
|
||||
## **Usage**
|
||||
|
||||
### **Prometheus Format (Default)**
|
||||
|
||||
```
|
||||
curl -H "Authorization: YOUR_ETAPI_TOKEN" \
|
||||
http://localhost:8080/etapi/metrics
|
||||
|
||||
```
|
||||
|
||||
Returns metrics in Prometheus text format:
|
||||
|
||||
```
|
||||
# HELP trilium_info Trilium instance information
|
||||
# TYPE trilium_info gauge
|
||||
trilium_info{version="0.91.6",db_version="231",node_version="v18.17.0"} 1 1701432000
|
||||
|
||||
# HELP trilium_notes_total Total number of notes including deleted
|
||||
# TYPE trilium_notes_total gauge
|
||||
trilium_notes_total 1234 1701432000
|
||||
|
||||
```
|
||||
|
||||
### **JSON Format**
|
||||
|
||||
```
|
||||
curl -H "Authorization: YOUR_ETAPI_TOKEN" \
|
||||
"http://localhost:8080/etapi/metrics?format=json"
|
||||
|
||||
```
|
||||
|
||||
Returns detailed metrics in JSON format for debugging or custom integrations.
|
||||
|
||||
## **Available Metrics**
|
||||
|
||||
### **Instance Information**
|
||||
|
||||
* `trilium_info` - Version and build information with labels
|
||||
|
||||
### **Database Metrics**
|
||||
|
||||
* `trilium_notes_total` - Total notes (including deleted)
|
||||
* `trilium_notes_deleted` - Number of deleted notes
|
||||
* `trilium_notes_active` - Number of active notes
|
||||
* `trilium_notes_protected` - Number of protected notes
|
||||
* `trilium_attachments_total` - Total attachments
|
||||
* `trilium_attachments_active` - Active attachments
|
||||
* `trilium_revisions_total` - Total note revisions
|
||||
* `trilium_branches_total` - Active branches
|
||||
* `trilium_attributes_total` - Active attributes
|
||||
* `trilium_blobs_total` - Total blob records
|
||||
* `trilium_etapi_tokens_total` - Active ETAPI tokens
|
||||
* `trilium_embeddings_total` - Note embeddings (if available)
|
||||
|
||||
### **Categorized Metrics**
|
||||
|
||||
* `trilium_notes_by_type{type="text|code|image|file"}` - Notes by type
|
||||
* `trilium_attachments_by_type{mime_type="..."}` - Attachments by MIME type
|
||||
|
||||
### **Statistics**
|
||||
|
||||
* `trilium_database_size_bytes` - Database size in bytes
|
||||
* `trilium_oldest_note_timestamp` - Timestamp of oldest note
|
||||
* `trilium_newest_note_timestamp` - Timestamp of newest note
|
||||
* `trilium_last_modified_timestamp` - Last modification timestamp
|
||||
|
||||
## **Prometheus Configuration**
|
||||
|
||||
Add to your `prometheus.yml`:
|
||||
|
||||
```
|
||||
scrape_configs:
|
||||
- job_name: 'trilium'
|
||||
static_configs:
|
||||
- targets: ['localhost:8080']
|
||||
metrics_path: '/etapi/metrics'
|
||||
bearer_token: 'YOUR_ETAPI_TOKEN'
|
||||
scrape_interval: 30s
|
||||
|
||||
```
|
||||
|
||||
## **Error Responses**
|
||||
|
||||
* `400` - Invalid format parameter
|
||||
* `401` - Missing or invalid ETAPI token
|
||||
* `500` - Internal server error
|
||||
Reference in New Issue
Block a user