diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 870fc6aa7..6aba59c2f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@vuepress/plugin-docsearch': specifier: 2.0.0-rc.67 version: 2.0.0-rc.67(@algolia/client-search@5.15.0)(search-insights@2.17.0)(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4))) + '@vuepress/plugin-links-check': + specifier: 2.0.0-rc.68 + version: 2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4))) mathjax-full: specifier: 3.2.2 version: 3.2.2 @@ -808,51 +811,61 @@ packages: resolution: {integrity: sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.28.1': resolution: {integrity: sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.28.1': resolution: {integrity: sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.28.1': resolution: {integrity: sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.28.1': resolution: {integrity: sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.28.1': resolution: {integrity: sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.28.1': resolution: {integrity: sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.28.1': resolution: {integrity: sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.28.1': resolution: {integrity: sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.28.1': resolution: {integrity: sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.28.1': resolution: {integrity: sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==} @@ -1083,6 +1096,11 @@ packages: peerDependencies: vuepress: 2.0.0-rc.19 + '@vuepress/helper@2.0.0-rc.68': + resolution: {integrity: sha512-4TlvjNQEiwDCCzb6m5bgfTBGdcMXW+78kevkOBW+1bksYjX0B4Gp8tKfJvzz3YwuHr/FCZ92zhPfSvhsvC5c0g==} + peerDependencies: + vuepress: 2.0.0-rc.19 + '@vuepress/highlighter-helper@2.0.0-rc.66': resolution: {integrity: sha512-RxhUIR+GFXXjCy5aFHHLvIKPcyyDhyzmka7shV+xr/vaU+EDbnQFrF67qo9pLDfzJc0KKTL9cKo4CcjkAoZ/tQ==} peerDependencies: @@ -1155,6 +1173,11 @@ packages: peerDependencies: vuepress: 2.0.0-rc.19 + '@vuepress/plugin-links-check@2.0.0-rc.68': + resolution: {integrity: sha512-ZA4YZO2lms31/GBS97bmezO3B6wjXDGJTKciJSd1Yv6nmYnoV6X7TH/xJeMCOSAg7XlZrvYZ2I+LMx33ELQ7Fg==} + peerDependencies: + vuepress: 2.0.0-rc.19 + '@vuepress/plugin-markdown-ext@2.0.0-rc.66': resolution: {integrity: sha512-heSwOXrgh0hGDxDD6zCfi4xe1Uaz4GgguWdnWEMl1ewhssjjhC07be/FNt9wwWKjTJkkKHsdTUwyKV0R+mL3Gw==} peerDependencies: @@ -1272,12 +1295,21 @@ packages: '@vueuse/core@12.0.0': resolution: {integrity: sha512-C12RukhXiJCbx4MGhjmd/gH52TjJsc3G0E0kQj/kb19H3Nt6n1CA4DRWuTdWWcaFRdlTe0npWDS942mvacvNBw==} + '@vueuse/core@12.3.0': + resolution: {integrity: sha512-cnV8QDKZrsyKC7tWjPbeEUz2cD9sa9faxF2YkR8QqNwfofgbOhmfIgvSYmkp+ttSvfOw4E6hLcQx15mRPr0yBA==} + '@vueuse/metadata@12.0.0': resolution: {integrity: sha512-Yzimd1D3sjxTDOlF05HekU5aSGdKjxhuhRFHA7gDWLn57PRbBIh+SF5NmjhJ0WRgF3my7T8LBucyxdFJjIfRJQ==} + '@vueuse/metadata@12.3.0': + resolution: {integrity: sha512-M/iQHHjMffOv2npsw2ihlUx1CTiBwPEgb7DzByLq7zpg1+Ke8r7s9p5ybUWc5OIeGewtpY4Xy0R2cKqFqM8hFg==} + '@vueuse/shared@12.0.0': resolution: {integrity: sha512-3i6qtcq2PIio5i/vVYidkkcgvmTjCqrf26u+Fd4LhnbBmIT6FN8y6q/GJERp8lfcB9zVEfjdV0Br0443qZuJpw==} + '@vueuse/shared@12.3.0': + resolution: {integrity: sha512-X3YD35GUeW0d5Gajcwv9jdLAJTV2Jdb/Ll6Ii2JIYcKLYZqv5wxyLeKtiQkqWmHg3v0J0ZWjDUMVOw2E7RCXfA==} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3889,6 +3921,18 @@ snapshots: transitivePeerDependencies: - typescript + '@vuepress/helper@2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': + dependencies: + '@vue/shared': 3.5.13 + '@vueuse/core': 12.3.0(typescript@5.5.4) + cheerio: 1.0.0 + fflate: 0.8.2 + gray-matter: 4.0.3 + vue: 3.5.13(typescript@5.5.4) + vuepress: 2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)) + transitivePeerDependencies: + - typescript + '@vuepress/highlighter-helper@2.0.0-rc.66(@vueuse/core@12.0.0(typescript@5.5.4))(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': dependencies: vuepress: 2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)) @@ -4007,6 +4051,13 @@ snapshots: transitivePeerDependencies: - typescript + '@vuepress/plugin-links-check@2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': + dependencies: + '@vuepress/helper': 2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4))) + vuepress: 2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)) + transitivePeerDependencies: + - typescript + '@vuepress/plugin-markdown-ext@2.0.0-rc.66(markdown-it@14.1.0)(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': dependencies: '@mdit/plugin-container': 0.14.0(markdown-it@14.1.0) @@ -4225,14 +4276,31 @@ snapshots: transitivePeerDependencies: - typescript + '@vueuse/core@12.3.0(typescript@5.5.4)': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 12.3.0 + '@vueuse/shared': 12.3.0(typescript@5.5.4) + vue: 3.5.13(typescript@5.5.4) + transitivePeerDependencies: + - typescript + '@vueuse/metadata@12.0.0': {} + '@vueuse/metadata@12.3.0': {} + '@vueuse/shared@12.0.0(typescript@5.5.4)': dependencies: vue: 3.5.13(typescript@5.5.4) transitivePeerDependencies: - typescript + '@vueuse/shared@12.3.0(typescript@5.5.4)': + dependencies: + vue: 3.5.13(typescript@5.5.4) + transitivePeerDependencies: + - typescript + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: acorn: 8.12.1 diff --git a/src/.vuepress/sidebar_timecho/V1.3.3/en.ts b/src/.vuepress/sidebar_timecho/V1.3.3/en.ts index 207df6539..bf62e20a1 100644 --- a/src/.vuepress/sidebar_timecho/V1.3.3/en.ts +++ b/src/.vuepress/sidebar_timecho/V1.3.3/en.ts @@ -194,6 +194,7 @@ export const enSidebar = { { text: 'Ignition', link: 'Ignition-IoTDB-plugin_timecho' }, { text: 'Grafana(IoTDB)', link: 'Grafana-Connector' }, { text: 'Grafana Plugin', link: 'Grafana-Plugin' }, + { text: 'Telegraf插件', link: 'Telegraf' }, { text: 'ThingsBoard', link: 'Thingsboard' }, ], }, diff --git a/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts b/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts index 46047d0ea..dacdc5354 100644 --- a/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts +++ b/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts @@ -176,6 +176,7 @@ export const zhSidebar = { { text: 'Ignition', link: 'Ignition-IoTDB-plugin_timecho' }, { text: 'Grafana(IoTDB)', link: 'Grafana-Connector' }, { text: 'Grafana插件', link: 'Grafana-Plugin' }, + { text: 'Telegraf插件', link: 'Telegraf' }, { text: 'ThingsBoard', link: 'Thingsboard' }, ], }, diff --git a/src/.vuepress/sidebar_timecho/V2.0.1/en.ts b/src/.vuepress/sidebar_timecho/V2.0.1/en.ts index 207df6539..28e5688dc 100644 --- a/src/.vuepress/sidebar_timecho/V2.0.1/en.ts +++ b/src/.vuepress/sidebar_timecho/V2.0.1/en.ts @@ -194,6 +194,7 @@ export const enSidebar = { { text: 'Ignition', link: 'Ignition-IoTDB-plugin_timecho' }, { text: 'Grafana(IoTDB)', link: 'Grafana-Connector' }, { text: 'Grafana Plugin', link: 'Grafana-Plugin' }, + { text: 'Telegraf Plugin', link: 'Telegraf' }, { text: 'ThingsBoard', link: 'Thingsboard' }, ], }, diff --git a/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts b/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts index 42bb64139..3ccb8b296 100644 --- a/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts +++ b/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts @@ -176,6 +176,7 @@ export const zhSidebar = { { text: 'Ignition', link: 'Ignition-IoTDB-plugin_timecho' }, { text: 'Grafana(IoTDB)', link: 'Grafana-Connector' }, { text: 'Grafana插件', link: 'Grafana-Plugin' }, + { text: 'Telegraf插件', link: 'Telegraf' }, { text: 'ThingsBoard', link: 'Thingsboard' }, ], }, diff --git a/src/UserGuide/Master/Tree/API/Telegraf.md b/src/UserGuide/Master/Tree/API/Telegraf.md new file mode 100644 index 000000000..42e7c014f --- /dev/null +++ b/src/UserGuide/Master/Tree/API/Telegraf.md @@ -0,0 +1,18 @@ + +Comming Soon \ No newline at end of file diff --git a/src/UserGuide/V2.0.1/Tree/API/Telegraf.md b/src/UserGuide/V2.0.1/Tree/API/Telegraf.md new file mode 100644 index 000000000..42e7c014f --- /dev/null +++ b/src/UserGuide/V2.0.1/Tree/API/Telegraf.md @@ -0,0 +1,18 @@ + +Comming Soon \ No newline at end of file diff --git a/src/UserGuide/latest/API/Telegraf.md b/src/UserGuide/latest/API/Telegraf.md new file mode 100644 index 000000000..42e7c014f --- /dev/null +++ b/src/UserGuide/latest/API/Telegraf.md @@ -0,0 +1,18 @@ + +Comming Soon \ No newline at end of file diff --git a/src/zh/UserGuide/Master/Tree/API/Telegraf.md b/src/zh/UserGuide/Master/Tree/API/Telegraf.md new file mode 100644 index 000000000..852d92f78 --- /dev/null +++ b/src/zh/UserGuide/Master/Tree/API/Telegraf.md @@ -0,0 +1,191 @@ + +# Telegraf + +## 1、产品概述 + +### 1.1 Telegraf + +[Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) 是一个开源代理工具,用于收集、处理和传输度量数据,由 InfluxData 开发。 + +Telegraf 有以下这些特点: + +- 插件体系结构:Telegraf 的强大之处在于其广泛的插件生态系统。它支持多种输入、输出和处理器插件,可以与各种数据源和目标无缝集成。 + - 数据收集:Telegraf 擅长从不同来源收集度量数据,例如系统指标、日志、数据库等。其多功能性使其适用于监视应用程序、基础架构和物联网设备。 + - 输出目标:一旦收集到数据,可以将其发送到各种输出目标,包括流行的数据库如 InfluxDB。这种灵活性使 Telegraf 适应不同的监视和分析设置。 +- 配置简易:Telegraf 的配置使用 TOML 文件进行。这种简单性使用户能够轻松定义输入、输出和处理器,使定制变得简单明了。 +- 社区与支持:作为开源项目,Telegraf 受益于活跃的社区。用户可以通过论坛和文档贡献插件、报告问题并寻求帮助。 + +### 1.2 Telegraf-IoTDB 插件 + +Telegraf-IoTDB 插件可以将保存在 Telegraf 中的监控信息输出存储到 IoTDB,输出插件使用了 IoTDB session 进行连接和数据写入。 + +![](https://alioss.timecho.com/docs/img/Telegraf.png) + +## 2、安装要求 + +Telegraf支持多种操作系统,包括Linux、Windows、macOS,Telegraf 的安装推荐使用`root`管理员权限才能成功完成,具体安装要求请查看 [安装要求](https://docs.influxdata.com/telegraf/v1/install/) + +## 3、安装步骤 + +具体安装步骤请查看 [安装步骤](https://docs.influxdata.com/telegraf/v1/install/) + +- 注:此插件为Telegraf内置插件,无需进行二次安装 + +## 4、使用说明 + +### 4.1 设置输入源 + +在“telegraf.conf”配置文件中找到“INPUT PLUGINS”来配置输入源,具体配置内容如下表所示 + +| 配置项 | 说明 | 备注 | +| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| alias | 命名插件的实例 | | +| interval | 收集此指标的频率。普通插件使用单个全局间隔,但如果某个特定输入的运行频率应更低或更高,您可以在此处进行配置。`interval`可以增加间隔以减少数据输入速率限制。 | | +| precision | 覆盖`precision`代理的设置。收集的指标四舍五入到指定的精度`interval`。当在服务输入上设置此值(例如`statsd`:)时,输出数据库可能会合并在同一时间戳发生的多个事件。 | | +| collection_jitter | 覆盖`collection_jitter`代理的设置。Collection jitter 用于通过随机的`interval` | | +| name_override | 输出到 IoTDB 时使用的自定义时间序列路径名 | 输出的路径名称需满足“[语法要求](../Reference/Syntax-Rule.md)”要求 | +| name_prefix | 指定附加到测量名称的前缀 | | +| name_suffix | 指定附加到测量名称的后缀 | | + +![](https://alioss.timecho.com/docs/img/Telegraf_1.png) + +### 4.2 设置输出源 + +在“telegraf.conf”配置文件中找到“outputs.iotdb”来配置输出源,具体配置内容如下表所示,具体输入源示例可查看 [输出源示例](https://docs.influxdata.com/telegraf/v1/configuration/#output-configuration-examples) + +| 配置项 | 说明 | 修改前 | 修改后 | 备注 | +| ------------------- | -------------- | ----------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | +| host | IoTDB 的 host | # host = "127.0.0.1" | host = "部署 IoTDB 的 host" | 默认为 127.0.0.1 | +| port | IoTDB 的端口号 | # port = "6667" | port = "部署 IoTDB 的端口号" | 默认为 6667 | +| user | IoTDB 的用户名 | # user = "root" | user = "IoTDB 的用户名" | 默认为 root | +| password | IoTDB 的用户名 | # password = "root" | password= "IoTDB 的用户名" | 默认为 root | +| timestamp_precision | 时间戳精度 | timestamp_precision = "millisecond" | timestamp_precision = "与 IoTDB 相同的时间戳精度" | 您可以通过查看"iotdb-system.properties"中"timestamp_precision"字段即可 | +| sanitize_tag | 数据库版本 | 无 | sanitize_tag = "0.13/1.0/1.1/1.2/1.3" | | + +![](https://alioss.timecho.com/docs/img/Telegraf_2.png) + +### 4.3 启动Telegraf服务 + +```Bash +telegraf -config /path/to/telegraf.conf +``` + +## 5、使用示例 + +以下是一个使用 Telegraf 收集 CPU 数据并使用 Telegraf-IoTDB 输出到 IoTDB 的示例。使用 telegraf 命令生成配置文件 + +```Bash +telegraf --sample-config --input-filter cpu --output-filter iotdb > cpu_iotdb.conf +``` + +1. 在 cpu_iotdb.conf 中修改 input cpu 插件的配置。其中,“name_override” 字段为输出到 IoTDB 时使用的自定义时间序列路径名 + +```Bash +# Read metrics about cpu usage +[[inputs.cpu]] + ## Whether to report per-cpu stats or not + percpu = true + ## Whether to report total system cpu stats or not + totalcpu = true + ## If true, collect raw CPU time metrics + collect_cpu_time = false + ## If true, compute and report the sum of all non-idle CPU states + report_active = false + ## If true and the info is available then add core_id and physical_id tags + core_tags = false + name_override = "root.demo.telgraf.cpu" +``` + +2. 在 cpu_iotdb.conf 中修改 output iotdb 插件的配置 + +| 配置项 | 说明 | 修改前 | 修改后 | 备注 | +| ------------------- | -------------- | ----------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | +| host | IoTDB 的 host | # host = "127.0.0.1" | host = "部署 IoTDB 的 host" | 默认为 127.0.0.1 | +| port | IoTDB 的端口号 | # port = "6667" | port = "部署 IoTDB 的端口号" | 默认为 6667 | +| user | IoTDB 的用户名 | # user = "root" | user = "IoTDB 的用户名" | 默认为 root | +| password | IoTDB 的用户名 | # password = "root" | password= "IoTDB 的用户名" | 默认为 root | +| timestamp_precision | 时间戳精度 | timestamp_precision = "millisecond" | timestamp_precision = "与 IoTDB 相同的时间戳精度" | 您可以通过查看"iotdb-system.properties"中"timestamp_precision"字段即可 | +| sanitize_tag | 数据库版本 | 无 | sanitize_tag = "0.13/1.0/1.1/1.2/1.3" | | + +```Bash +# Save metrics to an IoTDB Database +[[outputs.iotdb]] + ## Configuration of IoTDB server connection + host = "127.0.0.1" + # port = "6667" + + ## Configuration of authentication + # user = "root" + # password = "root" + + ## Timeout to open a new session. + ## A value of zero means no timeout. + # timeout = "5s" + + ## Configuration of type conversion for 64-bit unsigned int + ## IoTDB currently DOES NOT support unsigned integers (version 13.x). + ## 32-bit unsigned integers are safely converted into 64-bit signed integers by the plugin, + ## however, this is not true for 64-bit values in general as overflows may occur. + ## The following setting allows to specify the handling of 64-bit unsigned integers. + ## Available values are: + ## - "int64" -- convert to 64-bit signed integers and accept overflows + ## - "int64_clip" -- convert to 64-bit signed integers and clip the values on overflow to 9,223,372,036,854,775,807 + ## - "text" -- convert to the string representation of the value + # uint64_conversion = "int64_clip" + + ## Configuration of TimeStamp + ## TimeStamp is always saved in 64bits int. timestamp_precision specifies the unit of timestamp. + ## Available value: + ## "second", "millisecond", "microsecond", "nanosecond"(default) + timestamp_precision = "millisecond" + + ## Handling of tags + ## Tags are not fully supported by IoTDB. + ## A guide with suggestions on how to handle tags can be found here: + ## https://iotdb.apache.org/UserGuide/Master/API/InfluxDB-Protocol.html + ## + ## Available values are: + ## - "fields" -- convert tags to fields in the measurement + ## - "device_id" -- attach tags to the device ID + ## + ## For Example, a metric named "root.sg.device" with the tags `tag1: "private"` and `tag2: "working"` and + ## fields `s1: 100` and `s2: "hello"` will result in the following representations in IoTDB + ## - "fields" -- root.sg.device, s1=100, s2="hello", tag1="private", tag2="working" + ## - "device_id" -- root.sg.device.private.working, s1=100, s2="hello" + # convert_tags_to = "device_id" + ## Handling of unsupported characters + ## Some characters in different versions of IoTDB are not supported in path name + ## A guide with suggetions on valid paths can be found here: + ## for iotdb 0.13.x -> https://iotdb.apache.org/UserGuide/V0.13.x/Reference/Syntax-Conventions.html#identifiers + ## for iotdb 1.x.x and above -> https://iotdb.apache.org/UserGuide/V1.3.x/User-Manual/Syntax-Rule.html#identifier + ## + ## Available values are: + ## - "1.0", "1.1", "1.2", "1.3" -- enclose in `` the world having forbidden character + ## such as @ $ # : [ ] { } ( ) space + ## - "0.13" -- enclose in `` the world having forbidden character + ## such as space + ## + ## Keep this section commented if you don't want to sanitize the path + sanitize_tag = "1.3" +``` + +3. 使用 cpu_iotdb.conf 配置文件运行 Telegraf:运行一段时间后,可以在 IoTDB 中查询到 Telegraf 收集上报的数据 \ No newline at end of file diff --git a/src/zh/UserGuide/V2.0.1/Tree/API/Telegraf.md b/src/zh/UserGuide/V2.0.1/Tree/API/Telegraf.md new file mode 100644 index 000000000..852d92f78 --- /dev/null +++ b/src/zh/UserGuide/V2.0.1/Tree/API/Telegraf.md @@ -0,0 +1,191 @@ + +# Telegraf + +## 1、产品概述 + +### 1.1 Telegraf + +[Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) 是一个开源代理工具,用于收集、处理和传输度量数据,由 InfluxData 开发。 + +Telegraf 有以下这些特点: + +- 插件体系结构:Telegraf 的强大之处在于其广泛的插件生态系统。它支持多种输入、输出和处理器插件,可以与各种数据源和目标无缝集成。 + - 数据收集:Telegraf 擅长从不同来源收集度量数据,例如系统指标、日志、数据库等。其多功能性使其适用于监视应用程序、基础架构和物联网设备。 + - 输出目标:一旦收集到数据,可以将其发送到各种输出目标,包括流行的数据库如 InfluxDB。这种灵活性使 Telegraf 适应不同的监视和分析设置。 +- 配置简易:Telegraf 的配置使用 TOML 文件进行。这种简单性使用户能够轻松定义输入、输出和处理器,使定制变得简单明了。 +- 社区与支持:作为开源项目,Telegraf 受益于活跃的社区。用户可以通过论坛和文档贡献插件、报告问题并寻求帮助。 + +### 1.2 Telegraf-IoTDB 插件 + +Telegraf-IoTDB 插件可以将保存在 Telegraf 中的监控信息输出存储到 IoTDB,输出插件使用了 IoTDB session 进行连接和数据写入。 + +![](https://alioss.timecho.com/docs/img/Telegraf.png) + +## 2、安装要求 + +Telegraf支持多种操作系统,包括Linux、Windows、macOS,Telegraf 的安装推荐使用`root`管理员权限才能成功完成,具体安装要求请查看 [安装要求](https://docs.influxdata.com/telegraf/v1/install/) + +## 3、安装步骤 + +具体安装步骤请查看 [安装步骤](https://docs.influxdata.com/telegraf/v1/install/) + +- 注:此插件为Telegraf内置插件,无需进行二次安装 + +## 4、使用说明 + +### 4.1 设置输入源 + +在“telegraf.conf”配置文件中找到“INPUT PLUGINS”来配置输入源,具体配置内容如下表所示 + +| 配置项 | 说明 | 备注 | +| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| alias | 命名插件的实例 | | +| interval | 收集此指标的频率。普通插件使用单个全局间隔,但如果某个特定输入的运行频率应更低或更高,您可以在此处进行配置。`interval`可以增加间隔以减少数据输入速率限制。 | | +| precision | 覆盖`precision`代理的设置。收集的指标四舍五入到指定的精度`interval`。当在服务输入上设置此值(例如`statsd`:)时,输出数据库可能会合并在同一时间戳发生的多个事件。 | | +| collection_jitter | 覆盖`collection_jitter`代理的设置。Collection jitter 用于通过随机的`interval` | | +| name_override | 输出到 IoTDB 时使用的自定义时间序列路径名 | 输出的路径名称需满足“[语法要求](../Reference/Syntax-Rule.md)”要求 | +| name_prefix | 指定附加到测量名称的前缀 | | +| name_suffix | 指定附加到测量名称的后缀 | | + +![](https://alioss.timecho.com/docs/img/Telegraf_1.png) + +### 4.2 设置输出源 + +在“telegraf.conf”配置文件中找到“outputs.iotdb”来配置输出源,具体配置内容如下表所示,具体输入源示例可查看 [输出源示例](https://docs.influxdata.com/telegraf/v1/configuration/#output-configuration-examples) + +| 配置项 | 说明 | 修改前 | 修改后 | 备注 | +| ------------------- | -------------- | ----------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | +| host | IoTDB 的 host | # host = "127.0.0.1" | host = "部署 IoTDB 的 host" | 默认为 127.0.0.1 | +| port | IoTDB 的端口号 | # port = "6667" | port = "部署 IoTDB 的端口号" | 默认为 6667 | +| user | IoTDB 的用户名 | # user = "root" | user = "IoTDB 的用户名" | 默认为 root | +| password | IoTDB 的用户名 | # password = "root" | password= "IoTDB 的用户名" | 默认为 root | +| timestamp_precision | 时间戳精度 | timestamp_precision = "millisecond" | timestamp_precision = "与 IoTDB 相同的时间戳精度" | 您可以通过查看"iotdb-system.properties"中"timestamp_precision"字段即可 | +| sanitize_tag | 数据库版本 | 无 | sanitize_tag = "0.13/1.0/1.1/1.2/1.3" | | + +![](https://alioss.timecho.com/docs/img/Telegraf_2.png) + +### 4.3 启动Telegraf服务 + +```Bash +telegraf -config /path/to/telegraf.conf +``` + +## 5、使用示例 + +以下是一个使用 Telegraf 收集 CPU 数据并使用 Telegraf-IoTDB 输出到 IoTDB 的示例。使用 telegraf 命令生成配置文件 + +```Bash +telegraf --sample-config --input-filter cpu --output-filter iotdb > cpu_iotdb.conf +``` + +1. 在 cpu_iotdb.conf 中修改 input cpu 插件的配置。其中,“name_override” 字段为输出到 IoTDB 时使用的自定义时间序列路径名 + +```Bash +# Read metrics about cpu usage +[[inputs.cpu]] + ## Whether to report per-cpu stats or not + percpu = true + ## Whether to report total system cpu stats or not + totalcpu = true + ## If true, collect raw CPU time metrics + collect_cpu_time = false + ## If true, compute and report the sum of all non-idle CPU states + report_active = false + ## If true and the info is available then add core_id and physical_id tags + core_tags = false + name_override = "root.demo.telgraf.cpu" +``` + +2. 在 cpu_iotdb.conf 中修改 output iotdb 插件的配置 + +| 配置项 | 说明 | 修改前 | 修改后 | 备注 | +| ------------------- | -------------- | ----------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | +| host | IoTDB 的 host | # host = "127.0.0.1" | host = "部署 IoTDB 的 host" | 默认为 127.0.0.1 | +| port | IoTDB 的端口号 | # port = "6667" | port = "部署 IoTDB 的端口号" | 默认为 6667 | +| user | IoTDB 的用户名 | # user = "root" | user = "IoTDB 的用户名" | 默认为 root | +| password | IoTDB 的用户名 | # password = "root" | password= "IoTDB 的用户名" | 默认为 root | +| timestamp_precision | 时间戳精度 | timestamp_precision = "millisecond" | timestamp_precision = "与 IoTDB 相同的时间戳精度" | 您可以通过查看"iotdb-system.properties"中"timestamp_precision"字段即可 | +| sanitize_tag | 数据库版本 | 无 | sanitize_tag = "0.13/1.0/1.1/1.2/1.3" | | + +```Bash +# Save metrics to an IoTDB Database +[[outputs.iotdb]] + ## Configuration of IoTDB server connection + host = "127.0.0.1" + # port = "6667" + + ## Configuration of authentication + # user = "root" + # password = "root" + + ## Timeout to open a new session. + ## A value of zero means no timeout. + # timeout = "5s" + + ## Configuration of type conversion for 64-bit unsigned int + ## IoTDB currently DOES NOT support unsigned integers (version 13.x). + ## 32-bit unsigned integers are safely converted into 64-bit signed integers by the plugin, + ## however, this is not true for 64-bit values in general as overflows may occur. + ## The following setting allows to specify the handling of 64-bit unsigned integers. + ## Available values are: + ## - "int64" -- convert to 64-bit signed integers and accept overflows + ## - "int64_clip" -- convert to 64-bit signed integers and clip the values on overflow to 9,223,372,036,854,775,807 + ## - "text" -- convert to the string representation of the value + # uint64_conversion = "int64_clip" + + ## Configuration of TimeStamp + ## TimeStamp is always saved in 64bits int. timestamp_precision specifies the unit of timestamp. + ## Available value: + ## "second", "millisecond", "microsecond", "nanosecond"(default) + timestamp_precision = "millisecond" + + ## Handling of tags + ## Tags are not fully supported by IoTDB. + ## A guide with suggestions on how to handle tags can be found here: + ## https://iotdb.apache.org/UserGuide/Master/API/InfluxDB-Protocol.html + ## + ## Available values are: + ## - "fields" -- convert tags to fields in the measurement + ## - "device_id" -- attach tags to the device ID + ## + ## For Example, a metric named "root.sg.device" with the tags `tag1: "private"` and `tag2: "working"` and + ## fields `s1: 100` and `s2: "hello"` will result in the following representations in IoTDB + ## - "fields" -- root.sg.device, s1=100, s2="hello", tag1="private", tag2="working" + ## - "device_id" -- root.sg.device.private.working, s1=100, s2="hello" + # convert_tags_to = "device_id" + ## Handling of unsupported characters + ## Some characters in different versions of IoTDB are not supported in path name + ## A guide with suggetions on valid paths can be found here: + ## for iotdb 0.13.x -> https://iotdb.apache.org/UserGuide/V0.13.x/Reference/Syntax-Conventions.html#identifiers + ## for iotdb 1.x.x and above -> https://iotdb.apache.org/UserGuide/V1.3.x/User-Manual/Syntax-Rule.html#identifier + ## + ## Available values are: + ## - "1.0", "1.1", "1.2", "1.3" -- enclose in `` the world having forbidden character + ## such as @ $ # : [ ] { } ( ) space + ## - "0.13" -- enclose in `` the world having forbidden character + ## such as space + ## + ## Keep this section commented if you don't want to sanitize the path + sanitize_tag = "1.3" +``` + +3. 使用 cpu_iotdb.conf 配置文件运行 Telegraf:运行一段时间后,可以在 IoTDB 中查询到 Telegraf 收集上报的数据 \ No newline at end of file diff --git a/src/zh/UserGuide/latest/API/Telegraf.md b/src/zh/UserGuide/latest/API/Telegraf.md new file mode 100644 index 000000000..852d92f78 --- /dev/null +++ b/src/zh/UserGuide/latest/API/Telegraf.md @@ -0,0 +1,191 @@ + +# Telegraf + +## 1、产品概述 + +### 1.1 Telegraf + +[Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) 是一个开源代理工具,用于收集、处理和传输度量数据,由 InfluxData 开发。 + +Telegraf 有以下这些特点: + +- 插件体系结构:Telegraf 的强大之处在于其广泛的插件生态系统。它支持多种输入、输出和处理器插件,可以与各种数据源和目标无缝集成。 + - 数据收集:Telegraf 擅长从不同来源收集度量数据,例如系统指标、日志、数据库等。其多功能性使其适用于监视应用程序、基础架构和物联网设备。 + - 输出目标:一旦收集到数据,可以将其发送到各种输出目标,包括流行的数据库如 InfluxDB。这种灵活性使 Telegraf 适应不同的监视和分析设置。 +- 配置简易:Telegraf 的配置使用 TOML 文件进行。这种简单性使用户能够轻松定义输入、输出和处理器,使定制变得简单明了。 +- 社区与支持:作为开源项目,Telegraf 受益于活跃的社区。用户可以通过论坛和文档贡献插件、报告问题并寻求帮助。 + +### 1.2 Telegraf-IoTDB 插件 + +Telegraf-IoTDB 插件可以将保存在 Telegraf 中的监控信息输出存储到 IoTDB,输出插件使用了 IoTDB session 进行连接和数据写入。 + +![](https://alioss.timecho.com/docs/img/Telegraf.png) + +## 2、安装要求 + +Telegraf支持多种操作系统,包括Linux、Windows、macOS,Telegraf 的安装推荐使用`root`管理员权限才能成功完成,具体安装要求请查看 [安装要求](https://docs.influxdata.com/telegraf/v1/install/) + +## 3、安装步骤 + +具体安装步骤请查看 [安装步骤](https://docs.influxdata.com/telegraf/v1/install/) + +- 注:此插件为Telegraf内置插件,无需进行二次安装 + +## 4、使用说明 + +### 4.1 设置输入源 + +在“telegraf.conf”配置文件中找到“INPUT PLUGINS”来配置输入源,具体配置内容如下表所示 + +| 配置项 | 说明 | 备注 | +| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| alias | 命名插件的实例 | | +| interval | 收集此指标的频率。普通插件使用单个全局间隔,但如果某个特定输入的运行频率应更低或更高,您可以在此处进行配置。`interval`可以增加间隔以减少数据输入速率限制。 | | +| precision | 覆盖`precision`代理的设置。收集的指标四舍五入到指定的精度`interval`。当在服务输入上设置此值(例如`statsd`:)时,输出数据库可能会合并在同一时间戳发生的多个事件。 | | +| collection_jitter | 覆盖`collection_jitter`代理的设置。Collection jitter 用于通过随机的`interval` | | +| name_override | 输出到 IoTDB 时使用的自定义时间序列路径名 | 输出的路径名称需满足“[语法要求](../Reference/Syntax-Rule.md)”要求 | +| name_prefix | 指定附加到测量名称的前缀 | | +| name_suffix | 指定附加到测量名称的后缀 | | + +![](https://alioss.timecho.com/docs/img/Telegraf_1.png) + +### 4.2 设置输出源 + +在“telegraf.conf”配置文件中找到“outputs.iotdb”来配置输出源,具体配置内容如下表所示,具体输入源示例可查看 [输出源示例](https://docs.influxdata.com/telegraf/v1/configuration/#output-configuration-examples) + +| 配置项 | 说明 | 修改前 | 修改后 | 备注 | +| ------------------- | -------------- | ----------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | +| host | IoTDB 的 host | # host = "127.0.0.1" | host = "部署 IoTDB 的 host" | 默认为 127.0.0.1 | +| port | IoTDB 的端口号 | # port = "6667" | port = "部署 IoTDB 的端口号" | 默认为 6667 | +| user | IoTDB 的用户名 | # user = "root" | user = "IoTDB 的用户名" | 默认为 root | +| password | IoTDB 的用户名 | # password = "root" | password= "IoTDB 的用户名" | 默认为 root | +| timestamp_precision | 时间戳精度 | timestamp_precision = "millisecond" | timestamp_precision = "与 IoTDB 相同的时间戳精度" | 您可以通过查看"iotdb-system.properties"中"timestamp_precision"字段即可 | +| sanitize_tag | 数据库版本 | 无 | sanitize_tag = "0.13/1.0/1.1/1.2/1.3" | | + +![](https://alioss.timecho.com/docs/img/Telegraf_2.png) + +### 4.3 启动Telegraf服务 + +```Bash +telegraf -config /path/to/telegraf.conf +``` + +## 5、使用示例 + +以下是一个使用 Telegraf 收集 CPU 数据并使用 Telegraf-IoTDB 输出到 IoTDB 的示例。使用 telegraf 命令生成配置文件 + +```Bash +telegraf --sample-config --input-filter cpu --output-filter iotdb > cpu_iotdb.conf +``` + +1. 在 cpu_iotdb.conf 中修改 input cpu 插件的配置。其中,“name_override” 字段为输出到 IoTDB 时使用的自定义时间序列路径名 + +```Bash +# Read metrics about cpu usage +[[inputs.cpu]] + ## Whether to report per-cpu stats or not + percpu = true + ## Whether to report total system cpu stats or not + totalcpu = true + ## If true, collect raw CPU time metrics + collect_cpu_time = false + ## If true, compute and report the sum of all non-idle CPU states + report_active = false + ## If true and the info is available then add core_id and physical_id tags + core_tags = false + name_override = "root.demo.telgraf.cpu" +``` + +2. 在 cpu_iotdb.conf 中修改 output iotdb 插件的配置 + +| 配置项 | 说明 | 修改前 | 修改后 | 备注 | +| ------------------- | -------------- | ----------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | +| host | IoTDB 的 host | # host = "127.0.0.1" | host = "部署 IoTDB 的 host" | 默认为 127.0.0.1 | +| port | IoTDB 的端口号 | # port = "6667" | port = "部署 IoTDB 的端口号" | 默认为 6667 | +| user | IoTDB 的用户名 | # user = "root" | user = "IoTDB 的用户名" | 默认为 root | +| password | IoTDB 的用户名 | # password = "root" | password= "IoTDB 的用户名" | 默认为 root | +| timestamp_precision | 时间戳精度 | timestamp_precision = "millisecond" | timestamp_precision = "与 IoTDB 相同的时间戳精度" | 您可以通过查看"iotdb-system.properties"中"timestamp_precision"字段即可 | +| sanitize_tag | 数据库版本 | 无 | sanitize_tag = "0.13/1.0/1.1/1.2/1.3" | | + +```Bash +# Save metrics to an IoTDB Database +[[outputs.iotdb]] + ## Configuration of IoTDB server connection + host = "127.0.0.1" + # port = "6667" + + ## Configuration of authentication + # user = "root" + # password = "root" + + ## Timeout to open a new session. + ## A value of zero means no timeout. + # timeout = "5s" + + ## Configuration of type conversion for 64-bit unsigned int + ## IoTDB currently DOES NOT support unsigned integers (version 13.x). + ## 32-bit unsigned integers are safely converted into 64-bit signed integers by the plugin, + ## however, this is not true for 64-bit values in general as overflows may occur. + ## The following setting allows to specify the handling of 64-bit unsigned integers. + ## Available values are: + ## - "int64" -- convert to 64-bit signed integers and accept overflows + ## - "int64_clip" -- convert to 64-bit signed integers and clip the values on overflow to 9,223,372,036,854,775,807 + ## - "text" -- convert to the string representation of the value + # uint64_conversion = "int64_clip" + + ## Configuration of TimeStamp + ## TimeStamp is always saved in 64bits int. timestamp_precision specifies the unit of timestamp. + ## Available value: + ## "second", "millisecond", "microsecond", "nanosecond"(default) + timestamp_precision = "millisecond" + + ## Handling of tags + ## Tags are not fully supported by IoTDB. + ## A guide with suggestions on how to handle tags can be found here: + ## https://iotdb.apache.org/UserGuide/Master/API/InfluxDB-Protocol.html + ## + ## Available values are: + ## - "fields" -- convert tags to fields in the measurement + ## - "device_id" -- attach tags to the device ID + ## + ## For Example, a metric named "root.sg.device" with the tags `tag1: "private"` and `tag2: "working"` and + ## fields `s1: 100` and `s2: "hello"` will result in the following representations in IoTDB + ## - "fields" -- root.sg.device, s1=100, s2="hello", tag1="private", tag2="working" + ## - "device_id" -- root.sg.device.private.working, s1=100, s2="hello" + # convert_tags_to = "device_id" + ## Handling of unsupported characters + ## Some characters in different versions of IoTDB are not supported in path name + ## A guide with suggetions on valid paths can be found here: + ## for iotdb 0.13.x -> https://iotdb.apache.org/UserGuide/V0.13.x/Reference/Syntax-Conventions.html#identifiers + ## for iotdb 1.x.x and above -> https://iotdb.apache.org/UserGuide/V1.3.x/User-Manual/Syntax-Rule.html#identifier + ## + ## Available values are: + ## - "1.0", "1.1", "1.2", "1.3" -- enclose in `` the world having forbidden character + ## such as @ $ # : [ ] { } ( ) space + ## - "0.13" -- enclose in `` the world having forbidden character + ## such as space + ## + ## Keep this section commented if you don't want to sanitize the path + sanitize_tag = "1.3" +``` + +3. 使用 cpu_iotdb.conf 配置文件运行 Telegraf:运行一段时间后,可以在 IoTDB 中查询到 Telegraf 收集上报的数据 \ No newline at end of file