Skip to content

Commit 40e88c6

Browse files
liukuijun666liukj
and
liukj
authored
chore: add docs (#8)
* chore: add docs * fix: update zh languageName * docs: update docs * docs: update docs link and default docs --------- Co-authored-by: liukj <[email protected]>
1 parent 881fadd commit 40e88c6

30 files changed

+1134
-0
lines changed

docs/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/public/
2+
/resources/
3+
/themes/
4+
/config.bak

docs/Makefile

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
SHELL=/bin/bash
2+
3+
# Basic info
4+
PRODUCT?= $(shell basename "$(shell cd .. && pwd)")
5+
BRANCH?= main
6+
VERSION?= $(shell [[ "$(BRANCH)" == "main" ]] && echo "main" || echo "$(BRANCH)")
7+
CURRENT_VERSION?= $(VERSION)
8+
VERSIONS?= "main"
9+
OUTPUT?= "/tmp/docs"
10+
THEME_FOLDER?= "themes/book"
11+
THEME_REPO?= "https://github.com/infinilabs/docs-theme.git"
12+
THEME_BRANCH?= "main"
13+
14+
.PHONY: docs-build
15+
16+
default: docs-build
17+
18+
docs-init:
19+
@if [ ! -d $(THEME_FOLDER) ]; then echo "theme does not exist";(git clone -b $(THEME_BRANCH) $(THEME_REPO) $(THEME_FOLDER) ) fi
20+
21+
docs-env:
22+
@echo "Debugging Variables:"
23+
@echo "PRODUCT: $(PRODUCT)"
24+
@echo "BRANCH: $(BRANCH)"
25+
@echo "VERSION: $(VERSION)"
26+
@echo "CURRENT_VERSION: $(CURRENT_VERSION)"
27+
@echo "VERSIONS: $(VERSIONS)"
28+
@echo "OUTPUT: $(OUTPUT)"
29+
30+
docs-config: docs-init
31+
cp config.yaml config.bak
32+
# Detect OS and apply the appropriate sed command
33+
@if [ "$$(uname)" = "Darwin" ]; then \
34+
echo "Running on macOS"; \
35+
sed -i '' "s/BRANCH/$(VERSION)/g" config.yaml; \
36+
else \
37+
echo "Running on Linux"; \
38+
sed -i 's/BRANCH/$(VERSION)/g' config.yaml; \
39+
fi
40+
41+
docs-build: docs-config
42+
hugo --minify --theme book --destination="$(OUTPUT)/$(PRODUCT)/$(VERSION)" \
43+
--baseURL="/$(PRODUCT)/$(VERSION)"
44+
@$(MAKE) docs-restore-generated-file
45+
46+
docs-serve: docs-config
47+
hugo serve
48+
@$(MAKE) docs-restore-generated-file
49+
50+
docs-place-redirect:
51+
echo "<!DOCTYPE html> <html> <head> <meta http-equiv=refresh content=0;url=main /> </head> <body> <p><a href=main />REDIRECT TO THE LATEST_VERSION</a>.</p> </body> </html>" > $(OUTPUT)/$(PRODUCT)/index.html
52+
53+
docs-restore-generated-file:
54+
mv config.bak config.yaml

docs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

docs/config.yaml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# VERSIONS=latest,v1.0 hugo --minify --baseURL="/product/v1.0/" -d public/product/v1.0
2+
3+
title: INFINI Agent
4+
theme: book
5+
6+
# Book configuration
7+
disablePathToLower: true
8+
enableGitInfo: false
9+
10+
# Needed for mermaid/katex shortcodes
11+
markup:
12+
goldmark:
13+
renderer:
14+
unsafe: true
15+
tableOfContents:
16+
startLevel: 1
17+
18+
# Multi-lingual mode config
19+
# There are different options to translate files
20+
# See https://gohugo.io/content-management/multilingual/#translation-by-filename
21+
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
22+
defaultContentLanguage: en
23+
languages:
24+
en:
25+
languageName: English
26+
contentDir: content.en
27+
weight: 3
28+
zh:
29+
languageName: 简体中文
30+
contentDir: content.zh
31+
weight: 4
32+
33+
menu:
34+
before: []
35+
after:
36+
- name: "Github"
37+
url: "https://github.com/infinilabs/agent"
38+
weight: 10
39+
40+
params:
41+
# (Optional, default light) Sets color theme: light, dark or auto.
42+
# Theme 'auto' switches between dark and light modes based on browser/os preferences
43+
BookTheme: "auto"
44+
45+
# (Optional, default true) Controls table of contents visibility on right side of pages.
46+
# Start and end levels can be controlled with markup.tableOfContents setting.
47+
# You can also specify this parameter per page in front matter.
48+
BookToC: true
49+
50+
# (Optional, default none) Set the path to a logo for the book. If the logo is
51+
# /static/logo.png then the path would be logo.png
52+
BookLogo: img/logo
53+
54+
# (Optional, default none) Set leaf bundle to render as side menu
55+
# When not specified file structure and weights will be used
56+
# BookMenuBundle: /menu
57+
58+
# (Optional, default docs) Specify root page to render child pages as menu.
59+
# Page is resoled by .GetPage function: https://gohugo.io/functions/getpage/
60+
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
61+
BookSection: docs
62+
63+
# Set source repository location.
64+
# Used for 'Last Modified' and 'Edit this page' links.
65+
BookRepo: https://github.com/infinilabs/agent
66+
67+
# Enable "Edit this page" links for 'doc' page type.
68+
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
69+
# Edit path must point to root directory of repo.
70+
BookEditPath: edit/BRANCH/docs
71+
72+
# Configure the date format used on the pages
73+
# - In git information
74+
# - In blog posts
75+
BookDateFormat: "January 2, 2006"
76+
77+
# (Optional, default true) Enables search function with flexsearch,
78+
# Index is built on fly, therefore it might slowdown your website.
79+
# Configuration for indexing can be adjusted in i18n folder per language.
80+
BookSearch: false
81+
82+
# (Optional, default true) Enables comments template on pages
83+
# By default partals/docs/comments.html includes Disqus template
84+
# See https://gohugo.io/content-management/comments/#configure-disqus
85+
# Can be overwritten by same param in page frontmatter
86+
BookComments: false
87+
88+
# /!\ This is an experimental feature, might be removed or changed at any time
89+
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
90+
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
91+
# Theme will print warning if page referenced in markdown does not exists.
92+
BookPortableLinks: true
93+
94+
# /!\ This is an experimental feature, might be removed or changed at any time
95+
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
96+
BookServiceWorker: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
weight: 20
3+
title: "References"
4+
bookCollapseSection: true
5+
---
6+
7+
# References
8+
9+
- [env](https://docs.infinilabs.com/gateway/main/docs/references/config/#environment-variables)
10+
- [path](https://docs.infinilabs.com/gateway/main/docs/references/config/#path)
11+
- [log](https://docs.infinilabs.com/gateway/main/docs/references/config/#log)
12+
- [configs](https://docs.infinilabs.com/gateway/main/docs/references/config/#configs)
13+
- [api](https://docs.infinilabs.com/gateway/main/docs/references/config/#api)
14+
- [badger](https://docs.infinilabs.com/gateway/main/docs/references/config/#badger)
15+
- [disk_queue](https://docs.infinilabs.com/gateway/main/docs/references/config/#local-disk-queue)
16+
- [elasticsearch](https://docs.infinilabs.com/gateway/main/docs/references/elasticsearch/)
17+
- [resource_limit](https://docs.infinilabs.com/gateway/main/docs/references/config/#resource-limitations)
18+
- [metrics](https://docs.infinilabs.com/gateway/main/docs/references/config/#metrics)
19+
- [node](https://docs.infinilabs.com/gateway/main/docs/references/config/#node)
20+
- [processors](./processors/_index.md)
21+
- [other](https://docs.infinilabs.com/gateway/main/docs/references/config/#misc)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
weight: 20
3+
title: "Offline Processor"
4+
bookCollapseSection: true
5+
---
6+
7+
# Processor List
8+
9+
## Metric Collection
10+
11+
- [es_cluster_health](./es_cluster_health.md)
12+
- [es_cluster_stats](./es_cluster_stats.md)
13+
- [es_index_stats](./es_index_stats.md)
14+
- [es_node_stats](./es_node_stats.md)
15+
16+
## Log Collection
17+
18+
- [es_logs_processor](./es_logs_processor.md)
19+
- [logs_processor](./logs_processor.md)
20+
21+
For more processor content, please see [processors](https://docs.infinilabs.com/gateway/main/docs/references/processors/).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: es_cluster_health
3+
---
4+
5+
# es_cluster_health
6+
7+
## Description
8+
9+
Collect the cluster health metrics.
10+
11+
## Configuration Example
12+
13+
```yaml
14+
pipeline
15+
- name: collect_default_es_cluster_health
16+
auto_start: true
17+
keep_running: true
18+
retry_delay_in_ms: 3000
19+
processor:
20+
- es_cluster_health:
21+
elasticsearch: default
22+
```
23+
24+
## Parameter Description
25+
26+
| Name | Type | Description |
27+
| --- | --- | --- |
28+
| elasticsearch | string | Cluster instance name (Please see [elasticsearch](https://docs.infinilabs.com/gateway/main/docs/references/elasticsearch/) `name` parameter) |
29+
| labels | map | Custom labels |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: es_cluster_stats
3+
---
4+
5+
# es_cluster_stats
6+
7+
## Description
8+
9+
Collect the cluster stats metrics.
10+
11+
## Configuration Example
12+
13+
```yaml
14+
pipeline
15+
- name: collect_default_es_cluster_stats
16+
auto_start: true
17+
keep_running: true
18+
retry_delay_in_ms: 3000
19+
processor:
20+
- es_cluster_stats:
21+
elasticsearch: default
22+
```
23+
24+
## Parameter Description
25+
26+
| Name | Type | Description |
27+
| --- | --- | --- |
28+
| elasticsearch | string | Cluster instance name (Please see [elasticsearch](https://docs.infinilabs.com/gateway/main/docs/references/elasticsearch/) `name` parameter) |
29+
| labels | map | Custom labels |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: es_index_stats
3+
---
4+
5+
# es_index_stats
6+
7+
## Description
8+
9+
Collect the cluster index stats metrics.
10+
11+
## Configuration Example
12+
13+
```yaml
14+
pipeline
15+
- name: collect_default_es_index_stats
16+
auto_start: true
17+
keep_running: true
18+
retry_delay_in_ms: 3000
19+
processor:
20+
- es_index_stats:
21+
elasticsearch: default
22+
```
23+
24+
## Parameter Description
25+
26+
| Name | Type | Description |
27+
| --- | --- | --- |
28+
| elasticsearch | string | Cluster instance name (Please see [elasticsearch](https://docs.infinilabs.com/gateway/main/docs/references/elasticsearch/) `name` parameter) |
29+
| all_index_stats | bool | Whether to enable the metric collection of all indexes, default is `true`. |
30+
| index_primary_stats | bool | Whether to enable the metric collection of index primary shards, default is `true`. |
31+
| labels | map | Custom labels |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: es_logs_processor
3+
---
4+
5+
# es_logs_processor
6+
7+
## Description
8+
9+
Collect the cluster log files.
10+
11+
## Configuration Example
12+
13+
```yaml
14+
pipeline
15+
- name: collect_default_es_logs
16+
auto_start: true
17+
keep_running: true
18+
retry_delay_in_ms: 3000
19+
processor:
20+
- es_logs_processor:
21+
elasticsearch: default
22+
logs_path: "/opt/dev-environment/ecloud/logs"
23+
queue_name: logs
24+
```
25+
26+
## Parameter Description
27+
28+
| Name | Type | Description |
29+
| --- | --- | --- |
30+
| queue_name | string | Log collection queue name |
31+
| elasticsearch | string | Cluster instance name (Please see [elasticsearch](https://docs.infinilabs.com/gateway/main/docs/references/elasticsearch/) `name` parameter) |
32+
| logs_path | string | Cluster log path |
33+
| labels | map | Custom labels |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: es_node_stats
3+
---
4+
5+
# es_node_stats
6+
7+
## Description
8+
9+
Collect the cluster node stats metrics.
10+
11+
## Configuration Example
12+
13+
```yaml
14+
pipeline
15+
- name: collect_default_es_node_stats
16+
auto_start: true
17+
keep_running: true
18+
retry_delay_in_ms: 3000
19+
processor:
20+
- es_node_stats:
21+
elasticsearch: default
22+
```
23+
24+
## Parameter Description
25+
26+
| Name | Type | Description |
27+
| --- | --- | --- |
28+
| elasticsearch | string | Cluster instance name (Please see [elasticsearch](https://docs.infinilabs.com/gateway/main/docs/references/elasticsearch/) `name` parameter) |
29+
| level | string | Metric level, Optional `cluster`, `indices`, `shards`, default is `shards`。 |
30+
| labels | map | Custom labels |

0 commit comments

Comments
 (0)