From 9b146b6678ddc0a382f38d02f3fa2598e01baf07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=97=AD?= <22351293@zju.edu.cn> Date: Fri, 18 Oct 2024 18:35:42 +0800 Subject: [PATCH] =?UTF-8?q?Resolve=20"=E8=A1=A5=E5=85=A8=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AF=B9=E8=B1=A1=E6=96=87=E6=A1=A3"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/export/doc/en/inputs/apache.md | 22 ++++++++++++++++ .../export/doc/en/inputs/elasticsearch.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/mongodb.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/mysql.md | 19 ++++++++++++++ internal/export/doc/en/inputs/nginx.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/nsq.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/oracle.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/postgresql.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/rabbitmq.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/redis.md | 21 ++++++++++++++++ internal/export/doc/en/inputs/sqlserver.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/apache.md | 21 ++++++++++++++++ .../export/doc/zh/inputs/elasticsearch.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/mongodb.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/mysql.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/nginx.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/nsq.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/oracle.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/postgresql.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/rabbitmq.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/redis.md | 21 ++++++++++++++++ internal/export/doc/zh/inputs/sqlserver.md | 21 ++++++++++++++++ internal/export/measurements_meta.go | 11 +++++--- .../plugins/inputs/apache/customer_object.go | 22 ++++++++-------- internal/plugins/inputs/apache/input.go | 4 ++- .../inputs/elasticsearch/customer_object.go | 22 ++++++++-------- .../plugins/inputs/mongodb/customer_object.go | 22 ++++++++-------- .../plugins/inputs/mysql/customer_object.go | 22 ++++++++-------- .../plugins/inputs/nginx/customer_object.go | 22 ++++++++-------- .../plugins/inputs/nsq/customer_object.go | 22 ++++++++-------- .../plugins/inputs/oracle/customer_object.go | 22 ++++++++-------- .../inputs/postgresql/customer_object.go | 20 +++++++-------- .../inputs/rabbitmq/customer_object.go | 22 ++++++++-------- .../plugins/inputs/redis/customer_object.go | 25 ++++++++++--------- .../inputs/sqlserver/customer_object.go | 22 ++++++++-------- 35 files changed, 594 insertions(+), 125 deletions(-) diff --git a/internal/export/doc/en/inputs/apache.md b/internal/export/doc/en/inputs/apache.md index c5f361e9a0..0e72898f61 100644 --- a/internal/export/doc/en/inputs/apache.md +++ b/internal/export/doc/en/inputs/apache.md @@ -96,6 +96,28 @@ For all of the following data collections, the global election tags will added a {{$m.FieldsMarkdownTable}} {{ end }} + +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Log Collection {#logging} To collect the Apache log, open `files` in {{.InputName}}.conf and write to the absolute path of the Apache log file. For example: diff --git a/internal/export/doc/en/inputs/elasticsearch.md b/internal/export/doc/en/inputs/elasticsearch.md index df73526e92..2ce07c0511 100644 --- a/internal/export/doc/en/inputs/elasticsearch.md +++ b/internal/export/doc/en/inputs/elasticsearch.md @@ -174,6 +174,27 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Logging {#logging} diff --git a/internal/export/doc/en/inputs/mongodb.md b/internal/export/doc/en/inputs/mongodb.md index d0dcfb174a..a4f610c523 100644 --- a/internal/export/doc/en/inputs/mongodb.md +++ b/internal/export/doc/en/inputs/mongodb.md @@ -210,6 +210,27 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Mongod Log Collection {#logging} Annotate the configuration file `# enable_mongod_log = false` and change `false` to `true`. Other configuration options for mongod log are in `[inputs.mongodb.log]`, and the commented configuration is very default. If the path correspondence is correct, no configuration is needed. After starting Datakit, you will see a collection measurement named `mongod_log`. diff --git a/internal/export/doc/en/inputs/mysql.md b/internal/export/doc/en/inputs/mysql.md index dd6bc60df6..a5c27c2c16 100644 --- a/internal/export/doc/en/inputs/mysql.md +++ b/internal/export/doc/en/inputs/mysql.md @@ -277,7 +277,26 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} ## Log {#logging} diff --git a/internal/export/doc/en/inputs/nginx.md b/internal/export/doc/en/inputs/nginx.md index 4027ad3c8a..753114dd92 100644 --- a/internal/export/doc/en/inputs/nginx.md +++ b/internal/export/doc/en/inputs/nginx.md @@ -135,6 +135,27 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Log {#logging} To collect NGINX logs, open `files` in {{.InputName}}.conf and write to the absolute path of the NGINX log file. For example: diff --git a/internal/export/doc/en/inputs/nsq.md b/internal/export/doc/en/inputs/nsq.md index ae76c7d10f..1fc5673967 100644 --- a/internal/export/doc/en/inputs/nsq.md +++ b/internal/export/doc/en/inputs/nsq.md @@ -81,3 +81,24 @@ For all of the following data collections, the global election tags will added a {{$m.FieldsMarkdownTable}} {{ end }} + +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} \ No newline at end of file diff --git a/internal/export/doc/en/inputs/oracle.md b/internal/export/doc/en/inputs/oracle.md index 36688a3788..1765c906e1 100644 --- a/internal/export/doc/en/inputs/oracle.md +++ b/internal/export/doc/en/inputs/oracle.md @@ -266,6 +266,27 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Long running queries {#slow} Datakit could reports the SQLs, those executed time exceeded the threshold time defined by user, to Guance Cloud, displays in the `Logs` side bar, the source name is `oracle_log`. diff --git a/internal/export/doc/en/inputs/postgresql.md b/internal/export/doc/en/inputs/postgresql.md index dabe9d6a80..8aafb62198 100644 --- a/internal/export/doc/en/inputs/postgresql.md +++ b/internal/export/doc/en/inputs/postgresql.md @@ -73,6 +73,27 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Log Collection {#logging} - PostgreSQL logs are output to `stderr` by default. To open file logs, configure them in postgresql's configuration file `/etc/postgresql//main/postgresql.conf` as follows: diff --git a/internal/export/doc/en/inputs/rabbitmq.md b/internal/export/doc/en/inputs/rabbitmq.md index 632928f50e..c230ebb926 100644 --- a/internal/export/doc/en/inputs/rabbitmq.md +++ b/internal/export/doc/en/inputs/rabbitmq.md @@ -100,6 +100,27 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Log Collection {#logging} ???+ attention diff --git a/internal/export/doc/en/inputs/redis.md b/internal/export/doc/en/inputs/redis.md index 8402d2e3ab..63029268e7 100644 --- a/internal/export/doc/en/inputs/redis.md +++ b/internal/export/doc/en/inputs/redis.md @@ -139,6 +139,27 @@ For all of the following data collections, the global election tags will added a {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- field list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Logging {#logging} diff --git a/internal/export/doc/en/inputs/sqlserver.md b/internal/export/doc/en/inputs/sqlserver.md index d6a199f3db..d3de24c568 100644 --- a/internal/export/doc/en/inputs/sqlserver.md +++ b/internal/export/doc/en/inputs/sqlserver.md @@ -122,6 +122,27 @@ For all of the following data collections, the global election tags will be adde {{ end }} {{ end }} +## Custom Object {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- tag + +{{$m.TagsMarkdownTable}} + +- Metric list + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## Logging {#logging} Following measurements are collected as logs with the level of `info`. diff --git a/internal/export/doc/zh/inputs/apache.md b/internal/export/doc/zh/inputs/apache.md index 287d01fc26..b931e7f434 100644 --- a/internal/export/doc/zh/inputs/apache.md +++ b/internal/export/doc/zh/inputs/apache.md @@ -100,6 +100,27 @@ $ sudo apachectl restart {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志采集 {#logging} 如需采集 Apache 的日志,可在 {{.InputName}}.conf 中 将 `files` 打开,并写入 Apache 日志文件的绝对路径。比如: diff --git a/internal/export/doc/zh/inputs/elasticsearch.md b/internal/export/doc/zh/inputs/elasticsearch.md index 0a85f24357..23d9a50b80 100644 --- a/internal/export/doc/zh/inputs/elasticsearch.md +++ b/internal/export/doc/zh/inputs/elasticsearch.md @@ -175,6 +175,27 @@ PUT _plugins/_security/api/roles/monitor {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志 {#logging} diff --git a/internal/export/doc/zh/inputs/mongodb.md b/internal/export/doc/zh/inputs/mongodb.md index 56e65622c5..4c92f6515c 100644 --- a/internal/export/doc/zh/inputs/mongodb.md +++ b/internal/export/doc/zh/inputs/mongodb.md @@ -210,6 +210,27 @@ mongo --tls --host --tlsCAFile --tlsCerti {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志采集 {#logging} 去注释配置文件中 `# enable_mongod_log = false` 然后将 `false` 改为 `true`,其他关于 mongod log 配置选项在 `[inputs.mongodb.log]` 中,注释掉的配置极为默认配置,如果路径对应正确将无需任何配置启动 Datakit 后将会看到指标名为 `mongod_log` 的采集指标集。 diff --git a/internal/export/doc/zh/inputs/mysql.md b/internal/export/doc/zh/inputs/mysql.md index b2b708872c..8926cc0972 100644 --- a/internal/export/doc/zh/inputs/mysql.md +++ b/internal/export/doc/zh/inputs/mysql.md @@ -278,6 +278,27 @@ group_replication = true {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 字段列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志 {#logging} [:octicons-tag-24: Version-1.4.6](../datakit/changelog.md#cl-1.4.6) diff --git a/internal/export/doc/zh/inputs/nginx.md b/internal/export/doc/zh/inputs/nginx.md index 120f585423..64943800e2 100644 --- a/internal/export/doc/zh/inputs/nginx.md +++ b/internal/export/doc/zh/inputs/nginx.md @@ -134,6 +134,27 @@ server { {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志 {#logging} 如需采集 NGINX 的日志,可在 {{.InputName}}.conf 中 将 `files` 打开,并写入 NGINX 日志文件的绝对路径。比如: diff --git a/internal/export/doc/zh/inputs/nsq.md b/internal/export/doc/zh/inputs/nsq.md index 98833e80cc..0d341705ea 100644 --- a/internal/export/doc/zh/inputs/nsq.md +++ b/internal/export/doc/zh/inputs/nsq.md @@ -82,3 +82,24 @@ monitor : {{$m.FieldsMarkdownTable}} {{ end }} + +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} \ No newline at end of file diff --git a/internal/export/doc/zh/inputs/oracle.md b/internal/export/doc/zh/inputs/oracle.md index 7e4dcbc001..03e2357f2c 100644 --- a/internal/export/doc/zh/inputs/oracle.md +++ b/internal/export/doc/zh/inputs/oracle.md @@ -269,6 +269,27 @@ apt-get install -y libaio-dev libaio1 {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 慢查询支持 {#slow} Datakit 可以将执行超过用户自定义时间的 SQL 语句报告给观测云,在日志中显示,来源名是 `oracle_log`。 diff --git a/internal/export/doc/zh/inputs/postgresql.md b/internal/export/doc/zh/inputs/postgresql.md index 55684552f6..83345f35a1 100644 --- a/internal/export/doc/zh/inputs/postgresql.md +++ b/internal/export/doc/zh/inputs/postgresql.md @@ -72,6 +72,27 @@ grant SELECT ON pg_stat_database to datakit; {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志 {#logging} - PostgreSQL 日志默认是输出至 `stderr`,如需开启文件日志,可在 PostgreSQL 的配置文件 `/etc/postgresql//main/postgresql.conf` , 进行如下配置: diff --git a/internal/export/doc/zh/inputs/rabbitmq.md b/internal/export/doc/zh/inputs/rabbitmq.md index f6dac08b75..a9b3835f27 100644 --- a/internal/export/doc/zh/inputs/rabbitmq.md +++ b/internal/export/doc/zh/inputs/rabbitmq.md @@ -99,6 +99,27 @@ RabbitMQ 采集器是通过插件 `rabbitmq-management` 采集数据监控 Rabbi {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志 {#logging} diff --git a/internal/export/doc/zh/inputs/redis.md b/internal/export/doc/zh/inputs/redis.md index decc2ae96e..b236f4c44f 100644 --- a/internal/export/doc/zh/inputs/redis.md +++ b/internal/export/doc/zh/inputs/redis.md @@ -134,6 +134,27 @@ yum install -y redis {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 字段列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志 {#logging} diff --git a/internal/export/doc/zh/inputs/sqlserver.md b/internal/export/doc/zh/inputs/sqlserver.md index d34a154929..bff3ae2ebe 100644 --- a/internal/export/doc/zh/inputs/sqlserver.md +++ b/internal/export/doc/zh/inputs/sqlserver.md @@ -123,6 +123,27 @@ GO {{ end }} {{ end }} +## 自定义对象 {#object} + +{{ range $i, $m := .Measurements }} + +{{if eq $m.Type "custom_object"}} + +### `{{$m.Name}}` + +{{$m.Desc}} + +- 标签 + +{{$m.TagsMarkdownTable}} + +- 指标列表 + +{{$m.FieldsMarkdownTable}} +{{end}} + +{{ end }} + ## 日志 {#logging} 以下指标集均以日志形式收集,所有日志等级均为 `info`。 diff --git a/internal/export/measurements_meta.go b/internal/export/measurements_meta.go index 395189d3af..3349aa84a9 100644 --- a/internal/export/measurements_meta.go +++ b/internal/export/measurements_meta.go @@ -9,6 +9,7 @@ import ( "encoding/json" "fmt" + "github.com/GuanceCloud/cliutils/point" cp "gitlab.jiagouyun.com/cloudcare-tools/datakit/internal/colorprint" "gitlab.jiagouyun.com/cloudcare-tools/datakit/internal/git" "gitlab.jiagouyun.com/cloudcare-tools/datakit/internal/plugins/inputs" @@ -89,11 +90,14 @@ func exportMetaInfo(ipts map[string]inputs.Creator) ([]byte, error) { } switch tmp.Type { - case "logging", "tracing", "network": + case point.Logging.String(), + point.Tracing.String(), + point.Network.String(): l.Warnf("ignore %s from %s", tmp.Type, k) continue - case "object": + case point.Object.String(), + point.CustomObject.String(): if _, ok := defaultMetaInfo.ObjectMetaInfo[tmp.Name]; ok { if defaultMetaInfo.ObjectMetaInfo[tmp.Name].From == k { l.Warnf("original object measurement %q, current measurement %q, measurement type: %q, measurement name: %q", @@ -113,7 +117,8 @@ func exportMetaInfo(ipts map[string]inputs.Creator) ([]byte, error) { From: k, } - case "metric", "": + case point.Metric.String(), "": // not specified, default to metric + if _, ok := defaultMetaInfo.MetricMetaInfo[tmp.Name]; ok { if defaultMetaInfo.MetricMetaInfo[tmp.Name].From == k { l.Warnf("original metric measurement %q, current measurement %q, measurement type: %q, measurement name: %q", diff --git a/internal/plugins/inputs/apache/customer_object.go b/internal/plugins/inputs/apache/customer_object.go index 6c84aaa7f4..bb2624658e 100644 --- a/internal/plugins/inputs/apache/customer_object.go +++ b/internal/plugins/inputs/apache/customer_object.go @@ -41,42 +41,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current Apache uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of Apache", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on Apache(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the Apache", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/apache/input.go b/internal/plugins/inputs/apache/input.go index 4bcf417932..1447c626ab 100644 --- a/internal/plugins/inputs/apache/input.go +++ b/internal/plugins/inputs/apache/input.go @@ -99,7 +99,9 @@ func (*Input) Catalog() string { return inputName } func (*Input) AvailableArchs() []string { return datakit.AllOSWithElection } -func (*Input) SampleMeasurement() []inputs.Measurement { return []inputs.Measurement{&Measurement{}} } +func (*Input) SampleMeasurement() []inputs.Measurement { + return []inputs.Measurement{&Measurement{}} +} func (*Input) PipelineConfig() map[string]string { return map[string]string{"apache": pipeline} } diff --git a/internal/plugins/inputs/elasticsearch/customer_object.go b/internal/plugins/inputs/elasticsearch/customer_object.go index a043ac48c4..ea85571759 100644 --- a/internal/plugins/inputs/elasticsearch/customer_object.go +++ b/internal/plugins/inputs/elasticsearch/customer_object.go @@ -40,42 +40,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current Elasticsearch uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of Elasticsearch", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on Elasticsearch(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the Elasticsearch", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/mongodb/customer_object.go b/internal/plugins/inputs/mongodb/customer_object.go index cb0a34eb88..0ad1126358 100644 --- a/internal/plugins/inputs/mongodb/customer_object.go +++ b/internal/plugins/inputs/mongodb/customer_object.go @@ -40,42 +40,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current Mongodb uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of Mongodb", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on Mongodb(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the Mongodb", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/mysql/customer_object.go b/internal/plugins/inputs/mysql/customer_object.go index 4ed254db1f..6f5735d88f 100644 --- a/internal/plugins/inputs/mysql/customer_object.go +++ b/internal/plugins/inputs/mysql/customer_object.go @@ -41,42 +41,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current MySQL uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of MySQL", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on MySQL(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the MySQl", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/nginx/customer_object.go b/internal/plugins/inputs/nginx/customer_object.go index fe1e092be3..308cb4f3c9 100644 --- a/internal/plugins/inputs/nginx/customer_object.go +++ b/internal/plugins/inputs/nginx/customer_object.go @@ -41,42 +41,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current Nginx uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of Nginx", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on Nginx(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the Nginx", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/nsq/customer_object.go b/internal/plugins/inputs/nsq/customer_object.go index f074b06051..dff0fd1bce 100644 --- a/internal/plugins/inputs/nsq/customer_object.go +++ b/internal/plugins/inputs/nsq/customer_object.go @@ -40,42 +40,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current Nsq uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of Nsq", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on Nsq(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the Nsq", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/oracle/customer_object.go b/internal/plugins/inputs/oracle/customer_object.go index 433afc7a3a..c7c8361fa6 100644 --- a/internal/plugins/inputs/oracle/customer_object.go +++ b/internal/plugins/inputs/oracle/customer_object.go @@ -41,42 +41,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current Oracle uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of Oracle", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on Oracle(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the Oracle", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/postgresql/customer_object.go b/internal/plugins/inputs/postgresql/customer_object.go index d27ad28c0b..be74975df5 100644 --- a/internal/plugins/inputs/postgresql/customer_object.go +++ b/internal/plugins/inputs/postgresql/customer_object.go @@ -33,31 +33,31 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current PostgreSQL uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of PostgreSQL", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on PostgreSQL(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ @@ -68,7 +68,7 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/rabbitmq/customer_object.go b/internal/plugins/inputs/rabbitmq/customer_object.go index 9b27543428..92a7bef238 100644 --- a/internal/plugins/inputs/rabbitmq/customer_object.go +++ b/internal/plugins/inputs/rabbitmq/customer_object.go @@ -41,42 +41,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current RabbitMQ uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of RabbitMQ", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on RabbitMQ(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the RabbitMQ", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/redis/customer_object.go b/internal/plugins/inputs/redis/customer_object.go index 8b6aaf96bb..7fe1f9c3a3 100644 --- a/internal/plugins/inputs/redis/customer_object.go +++ b/internal/plugins/inputs/redis/customer_object.go @@ -40,42 +40,43 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current Redis uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of Redis", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on Redis(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the Redis", }, "host": &inputs.TagInfo{ - Desc: "The server host address", + Desc: "Connection name(domain) host address", }, + "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, } diff --git a/internal/plugins/inputs/sqlserver/customer_object.go b/internal/plugins/inputs/sqlserver/customer_object.go index 8d8553ca03..a645fb425d 100644 --- a/internal/plugins/inputs/sqlserver/customer_object.go +++ b/internal/plugins/inputs/sqlserver/customer_object.go @@ -41,42 +41,42 @@ func (m *customerObjectMeasurement) Info() *inputs.MeasurementInfo { //nolint:fu "uptime": &inputs.FieldInfo{ DataType: inputs.Int, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.DurationSecond, + Desc: "Current SQLServer uptime", }, "display_name": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Displayed name in UI", }, "version": &inputs.FieldInfo{ DataType: inputs.String, Type: inputs.Gauge, - Unit: inputs.SizeByte, - Desc: "", + Unit: inputs.UnknownUnit, + Desc: "Current version of SQLServer", }, }, Tags: map[string]interface{}{ "name": &inputs.TagInfo{ - Desc: "", + Desc: "Object uniq ID", }, - "status": &inputs.TagInfo{ - Desc: "", + "col_co_status": &inputs.TagInfo{ + Desc: "Current status of collector on SQLServer(`OK/NotOK`)", }, "ip": &inputs.TagInfo{ - Desc: "", + Desc: "Connection IP of the SQLServer", }, "host": &inputs.TagInfo{ Desc: "The server host address", }, "reason": &inputs.TagInfo{ - Desc: "", + Desc: "If status not ok, we'll get some reasons about the status", }, }, }