Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/user-guide/ingest-data/for-iot/emqx.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
keywords: [EMQX, MQTT broker, IoT, real-time messaging, data integration, data ingestion]
description: Overview of integrating GreptimeDB with EMQX, an open-source MQTT broker for IoT and real-time messaging applications.
description: Overview of integrating GreptimeDB with EMQX, an MQTT broker for IoT and real-time messaging applications.
---

# EMQX

[EMQX](https://www.emqx.io/) is an open-source, highly scalable, and feature-rich MQTT broker designed for IoT and real-time messaging applications. It supports various protocols, including MQTT (3.1, 3.1.1, and 5.0), HTTP, QUIC, and WebSocket.
[EMQX](https://www.emqx.com/) is a highly scalable MQTT broker designed for IoT and real-time messaging applications. It supports various protocols, including MQTT (3.1, 3.1.1, and 5.0), HTTP, QUIC, and WebSocket.

GreptimeDB can be used as a data system for EMQX. To learn how to integrate GreptimeDB with EMQX, please refer to [Ingest MQTT Data into GreptimeDB](https://docs.emqx.com/en/emqx/latest/data-integration/data-bridge-greptimedb.html).
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ curl 'http://localhost:4000/v1/influxdb/write?db=public&u=<username>&p=<password

### Telegraf

The following examples are tested with Telegraf v1.40.3.

GreptimeDB's support for the [InfluxDB line protocol](../for-iot/influxdb-line-protocol.md) ensures its compatibility with Telegraf.
To configure Telegraf, simply add GreptimeDB URL into Telegraf configurations:
To configure Telegraf, simply add GreptimeDB URL into Telegraf configurations.
The database set in `bucket` or `database` must exist before Telegraf writes to it. Create it with `CREATE DATABASE <db-name>;`, or use `public`.

<Tabs>

Expand All @@ -158,6 +161,8 @@ To configure Telegraf, simply add GreptimeDB URL into Telegraf configurations:
database = "<db-name>"
username = "<greptime_user>"
password = "<greptimedb_password>"
## GreptimeDB does not support creating databases through the InfluxDB API
skip_database_creation = true
```

</TabItem>
Expand All @@ -178,7 +183,7 @@ In GreptimeDB, it is represented as a row of data in the time-series table,
where the table name aligns with the measurement,
and the columns are divided into three types: Tag, Field, and Timestamp.
- GreptimeDB uses `TimestampNanosecond` as the data type for timestamp data from the [InfluxDB line protocol API](/user-guide/ingest-data/for-iot/influxdb-line-protocol.md).
- GreptimeDB uses `Float64` as the data type for numeric data from the InfluxDB line protocol API.
- GreptimeDB maps InfluxDB field types as follows: floats to `Float64`, integers (`i` suffix) to `Int64`, unsigned integers (`u` suffix) to `UInt64`, strings to `String`, and booleans to `Boolean`.

Consider the following [sample data](https://docs.influxdata.com/influxdb/v2/reference/key-concepts/data-elements/#sample-data) borrowed from InfluxDB docs as an example:

Expand Down
6 changes: 6 additions & 0 deletions docs/user-guide/ingest-data/for-observability/alloy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: Instructions on integrating GreptimeDB with Grafana Alloy for Prome
[Grafana Alloy](https://grafana.com/docs/alloy/latest/) is an observability data pipeline for OpenTelemetry (OTel), Prometheus, Pyroscope, Loki, and many other metrics, logs, traces, and profiling tools.
You can integrate GreptimeDB as a data sink for Alloy.

The examples on this page are tested with Grafana Alloy v1.22.0.

## Prometheus Remote Write

Configure GreptimeDB as remote write target:
Expand Down Expand Up @@ -63,6 +65,8 @@ otelcol.auth.basic "credentials" {
- `GREPTIME_DB`: GreptimeDB database name, default is `public`.
- `GREPTIME_USERNAME` and `GREPTIME_PASSWORD`: The [authentication credentials](/user-guide/deployments-administration/authentication/static.md) for GreptimeDB.

If authentication is disabled in GreptimeDB, remove the `otelcol.auth.basic` block and the `auth` attribute of the exporter. Alloy rejects the configuration when the credentials are empty.

For details on the metrics data model transformation from OpenTelemetry to GreptimeDB, refer to the [Data Model](/user-guide/ingest-data/for-observability/opentelemetry.md#data-model) section in the OpenTelemetry guide.

### Logs
Expand Down Expand Up @@ -125,6 +129,8 @@ otelcol.exporter.otlphttp "greptimedb_logs" {
- `GREPTIME_USERNAME` and `GREPTIME_PASSWORD`: The [authentication credentials](/user-guide/deployments-administration/authentication/static.md) for GreptimeDB.
- `X-Greptime-Log-Extract-Keys`: Keys extracted from OTLP log attributes. See the [OTLP/HTTP API documentation](/user-guide/ingest-data/for-observability/opentelemetry.md#otlphttp-api-1) for details.

If authentication is disabled in GreptimeDB, remove the `otelcol.auth.basic` block and the `auth` attribute of the exporter. Alloy rejects the configuration when the credentials are empty.

For details on the log data model transformation from OpenTelemetry to GreptimeDB, refer to the [Data Model](/user-guide/ingest-data/for-observability/opentelemetry.md#data-model-1) section in the OpenTelemetry guide.

## Loki
Expand Down
22 changes: 12 additions & 10 deletions docs/user-guide/ingest-data/for-observability/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ We will see the following results:

```
mysql> SELECT * FROM es_test;
+------+------+----------------------------+
| age | name | greptime_timestamp |
+------+------+----------------------------+
| 30 | John | 2025-01-15 08:26:06.516665 |
| 25 | Jane | 2025-01-15 08:26:06.521510 |
+------+------+----------------------------+
+----------------------------+------+------+
| greptime_timestamp | age | name |
+----------------------------+------+------+
| 2025-01-15 08:26:06.516665 | 30 | John |
| 2025-01-15 08:26:06.521510 | 25 | Jane |
+----------------------------+------+------+
2 rows in set (0.13 sec)
```

Expand Down Expand Up @@ -159,6 +159,8 @@ Please pay attention to the following GreptimeDB-related configurations:

### Telegraf

The following example is tested with Telegraf v1.40.3.

If you are using [Telegraf](https://github.com/influxdata/telegraf) to collect logs, you can use its Elasticsearch plugin to write data to GreptimeDB, as shown below:

```toml
Expand All @@ -174,12 +176,12 @@ If you are using [Telegraf](https://github.com/influxdata/telegraf) to collect l
namepass = ["tail"]

[outputs.elasticsearch.headers]
"X-GREPTIME-DB-NAME" = "public"
"X-GREPTIME-PIPELINE-NAME" = "greptime_identity"
"X-GREPTIME-DB-NAME" = ["public"]
"X-GREPTIME-PIPELINE-NAME" = ["greptime_identity"]

[[inputs.tail]]
files = ["/tmp/test.log"]
from_beginning = true
initial_read_offset = "beginning"
data_format = "value"
data_type = "string"
character_encoding = "utf-8"
Expand All @@ -194,4 +196,4 @@ Please pay attention to the following GreptimeDB-related configurations:

- `index_name`: Specifies the table name that will be written to.

- `outputs.elasticsearch.header`: Specifies the HTTP Header for writing, where the example above specifies two parameters: `X-GREPTIME-DB-NAME` and `X-GREPTIME-PIPELINE-NAME`.
- `outputs.elasticsearch.headers`: Specifies the HTTP Header for writing, where the example above specifies two parameters: `X-GREPTIME-DB-NAME` and `X-GREPTIME-PIPELINE-NAME`.
14 changes: 8 additions & 6 deletions docs/user-guide/ingest-data/for-observability/fluent-bit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ description: Instructions on integrating GreptimeDB with Fluent bit for Promethe

You can forward Fluent Bit data to GreptimeDB. This document describes how to configure Fluent Bit to send logs, metrics, and traces to GreptimeDB.

The examples on this page are tested with Fluent Bit v5.2.0.

## HTTP

Using Fluent Bit's [HTTP Output Plugin](https://docs.fluentbit.io/manual/pipeline/outputs/http), you can send logs to GreptimeDB.
Expand Down Expand Up @@ -65,7 +67,7 @@ Use a separate output for each signal because GreptimeDB uses signal-specific he
Log_response_payload True
Tls Off
Tls.verify Off
Header X-Greptime-DB-Name "<dbname>"
Header X-Greptime-DB-Name <dbname>

# Only for logs
[OUTPUT]
Expand All @@ -78,9 +80,9 @@ Use a separate output for each signal because GreptimeDB uses signal-specific he
Log_response_payload True
Tls Off
Tls.verify Off
Header X-Greptime-Log-Table-Name "<log_table_name>"
Header X-Greptime-Pipeline-Name "<pipeline_name>"
Header X-Greptime-DB-Name "<dbname>"
Header X-Greptime-Log-Table-Name <log_table_name>
Header X-Greptime-Pipeline-Name <pipeline_name>
Header X-Greptime-DB-Name <dbname>

# Only for traces
[OUTPUT]
Expand All @@ -93,8 +95,8 @@ Use a separate output for each signal because GreptimeDB uses signal-specific he
Log_response_payload True
Tls Off
Tls.verify Off
Header X-Greptime-Pipeline-Name "greptime_trace_v1"
Header X-Greptime-DB-Name "<dbname>"
Header X-Greptime-Pipeline-Name greptime_trace_v1
Header X-Greptime-DB-Name <dbname>
```

- `Metrics_uri`, `Logs_uri`, and `Traces_uri`: The endpoints for metrics, logs, and traces.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ remote_write:
```

Set `send_native_histograms: true` explicitly. Selecting the v2 message format alone
does not enable native histogram sending. See the
does not enable native histogram sending. Prometheus scrapes native histograms only
when `scrape_native_histograms: true` is set in the global or scrape config. See the
[Prometheus native histogram documentation](https://prometheus.io/docs/specs/native_histograms/#remote-write--remote-read).

Query native histograms with GreptimeDB's PromQL API. Prometheus Remote Read
Expand Down
6 changes: 6 additions & 0 deletions docs/user-guide/ingest-data/for-observability/splunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ Vector concatenates batched events with no separator, so on the raw endpoint a w
The [`splunk_hec` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/splunkhecexporter/README.md) is configured the same way:

```yaml
receivers:
otlp:
protocols:
grpc:
http:

exporters:
splunk_hec:
endpoint: "http://localhost:4000/v1/splunk/services/collector"
Expand Down
20 changes: 12 additions & 8 deletions docs/user-guide/ingest-data/for-observability/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Instructions for integrating Vector with GreptimeDB, including conf
# Vector

:::tip NOTE
This document is based on Vector v0.49.0. All example configurations below are based on this version. Please adjust the host and port configurations for each sink according to your actual GreptimeDB instance. All port values below are defaults.
This document is based on Vector v0.62.0. All example configurations below are based on this version. Please adjust the host and port configurations for each sink according to your actual GreptimeDB instance. All port values below are defaults.
:::

Vector is a high-performance observability data pipeline. It natively supports GreptimeDB as a metrics data receiver. Through Vector, you can receive metrics data from various sources including Prometheus, OpenTelemetry, StatsD, etc. GreptimeDB can serve as a sink component for Vector to receive metrics data.
Expand Down Expand Up @@ -50,15 +50,15 @@ For more requirements, please visit [Vector GreptimeDB Configuration](https://ve
The following rules are used when storing Vector metrics into GreptimeDB:

- Use `<metric namespace>_<metric name>` as the table name in GreptimeDB, for example, `host_cpu_seconds_total`;
- Use the timestamp of the metric as the time index of GreptimeDB, the column name is `ts`;
- Use the timestamp of the metric as the time index of GreptimeDB. The column name is `greptime_timestamp` when `new_naming = true`, as in the example above, or `ts` otherwise;
- Use the tags of the metric as GreptimeDB tags;
- For Vector metrics which have multiple subtypes:
- For Counter and Gauge metrics, the values are stored in the `val` column;
- For Set metrics, the number of data points are stored in the `val` column;
- For Counter and Gauge metrics, the values are stored in the `greptime_value` column (`val` when `new_naming` is false);
- For Set metrics, the number of data points are stored in the `greptime_value` column (`val` when `new_naming` is false);
- For Distribution metrics, the values of each percentile are stored in the `pxx` column, where xx is the percentile, and the `min/max/avg/sum/count` columns are also stored;
- For AggregatedHistogram metrics, the values of each bucket are stored in the `bxx` column, where xx is the upper limit of the bucket, and the `sum/count` columns are also stored;
- For AggregatedSummary metrics, the values of each percentile are stored in the `pxx` column, where xx is the percentile, and the `sum/count` columns are also stored;
- For Sketch metrics, the values of each percentile are stored in the `pxx` column, where xx is the percentile, and the `min/max/avg/sum` columns are also stored;
- For Sketch metrics, the values of each percentile are stored in the `pxx` column, where xx is the percentile, and the `count/min/max/avg/sum` columns are also stored;

### Using InfluxDB Line Protocol Format

Expand All @@ -75,18 +75,20 @@ type = "internal_metrics"
[sinks.my_sink_id]
type = "influxdb_metrics"
inputs = [ "my_source_id" ]
version = "2"
bucket = "public"
endpoint = "http://<host>:4000/v1/influxdb"
org = ""
token = ""
```

The above configuration uses v2 version of InfluxDB line protocol. Vector determines the InfluxDB protocol version based on fields in the TOML configuration, so please ensure the configuration contains `bucket`, `org`, and `token` fields. Specific field explanations:
The above configuration uses v2 of the InfluxDB line protocol, selected by `version = "2"`. Specific field explanations:

- `type`: Value for InfluxDB line protocol is `influxdb_metrics`.
- `version`: InfluxDB API version. Required since Vector v0.60.0.
- `bucket`: Database name in GreptimeDB.
- `org`: Organization name in GreptimeDB (needs to be empty).
- `token`: Token for authentication (needs to be empty). Since Influx line protocol token has special format and must start with `Token `, this differs from GreptimeDB's authentication method and is currently not compatible. If using GreptimeDB instance with authentication, please use `greptimedb_metrics`.
- `token`: GreptimeDB credentials in the form `<username>:<password>`. Leave it empty when authentication is disabled.

For more details, please refer to [InfluxDB Line Protocol documentation](../for-iot/influxdb-line-protocol.md) to learn how to write data to GreptimeDB using InfluxDB Line Protocol.

Expand All @@ -105,7 +107,9 @@ type = "prometheus_remote_write"
inputs = [ "my_source_id" ]
endpoint = "http://<host>:4000/v1/prometheus/write?db=<dbname>"
compression = "snappy"
auth = { strategy = "basic", username = "<username>", password = "<password>" }
auth = { strategy = "basic", user = "<username>", password = "<password>" }
# The write endpoint accepts only POST, so send the GET health check to /v1/health instead.
healthcheck.uri = "http://<host>:4000/v1/health"
```

## Writing Logs Data
Expand Down
4 changes: 1 addition & 3 deletions docs/user-guide/traces/read-write.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ instance, which will listen on ports `4317` (gRPC) and `4318` (HTTP):
```shell
docker run --rm \
--network host \
-p 4317:4317 \
-p 4318:4318 \
-v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml \
otel/opentelemetry-collector-contrib:0.159.0
otel/opentelemetry-collector-contrib:0.165.0
```

The content of the `config.yaml` file is as follows:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
keywords: [EMQX, MQTT 消息服务器, 物联网, 实时通信, 数据集成, 数据桥接]
description: EMQX 是一款开源的大规模分布式 MQTT 消息服务器,专为物联网和实时通信应用而设计。了解如何将 GreptimeDB 集成到 EMQX 中。
description: EMQX 是一款大规模分布式 MQTT 消息服务器,专为物联网和实时通信应用而设计。了解如何将 GreptimeDB 集成到 EMQX 中。
---

# EMQX

[EMQX](https://www.emqx.io/) 是一款开源的大规模分布式 MQTT 消息服务器,专为物联网和实时通信应用而设计。EMQX 支持多种协议,包括 MQTT (3.1、3.1.1 和 5.0)、HTTP、QUIC 和 WebSocket 等,保证各种网络环境和硬件设备的可访问性。
[EMQX](https://www.emqx.com/) 是一款大规模分布式 MQTT 消息服务器,专为物联网和实时通信应用而设计。EMQX 支持多种协议,包括 MQTT (3.1、3.1.1 和 5.0)、HTTP、QUIC 和 WebSocket 等,保证各种网络环境和硬件设备的可访问性。

GreptimeDB 可以作为 EMQX 的数据系统。请参考[将 MQTT 数据写入 GreptimeDB](https://docs.emqx.com/zh/emqx/latest/data-integration/data-bridge-greptimedb.html) 了解如何将 GreptimeDB 集成到 EMQX 中。
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ curl 'http://localhost:4000/v1/influxdb/write?db=public&u=<username>&p=<password

### Telegraf

以下示例已在 Telegraf v1.40.3 上测试。

GreptimeDB 支持 [InfluxDB 行协议](../for-iot/influxdb-line-protocol.md)也意味着 GreptimeDB 与 Telegraf 兼容。
要配置 Telegraf,只需将 GreptimeDB 的 URL 添加到 Telegraf 配置中:
要配置 Telegraf,只需将 GreptimeDB 的 URL 添加到 Telegraf 配置中。
`bucket` 或 `database` 指定的数据库需要事先存在,可以用 `CREATE DATABASE <db-name>;` 创建,或使用 `public`。

<Tabs>

Expand All @@ -158,6 +161,8 @@ GreptimeDB 支持 [InfluxDB 行协议](../for-iot/influxdb-line-protocol.md)也
database = "<db-name>"
username = "<greptime_user>"
password = "<greptimedb_password>"
## GreptimeDB does not support creating databases through the InfluxDB API
skip_database_creation = true
```

</TabItem>
Expand All @@ -178,7 +183,7 @@ GreptimeDB 的[数据模型](/user-guide/concepts/data-model.md) 是值得了解
在 GreptimeDB 中,它被表示为时间序列表中的一行数据。
表名对应于 measurement,列由三种类型组成:Tag、Field 和 Timestamp。
- GreptimeDB 使用 `TimestampNanosecond` 作为来自 [InfluxDB 行协议 API](/user-guide/ingest-data/for-iot/influxdb-line-protocol.md) 的时间戳数据类型。
- GreptimeDB 使用 `Float64` 作为来自 InfluxDB 行协议 API 的数值数据类型。
- GreptimeDB 按以下规则映射 InfluxDB 字段类型:浮点数映射为 `Float64`,整数(`i` 后缀)映射为 `Int64`,无符号整数(`u` 后缀)映射为 `UInt64`,字符串映射为 `String`,布尔值映射为 `Boolean`。

以 InfluxDB 文档中的[示例数据](https://docs.influxdata.com/influxdb/v2/reference/key-concepts/data-elements/#sample-data)为例:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: 介绍了如何将 GreptimeDB 配置为 Grafana Alloy 的数据接
[Grafana Alloy](https://grafana.com/docs/alloy/latest/) 是一个用于 OpenTelemetry (OTel)、Prometheus、Pyroscope、Loki 等其他指标、日志、追踪和分析工具的可观测性数据管道。
你可以将 GreptimeDB 集成为 Alloy 的数据接收端。

本文示例已在 Grafana Alloy v1.22.0 上测试。

## Prometheus Remote Write

将 GreptimeDB 配置为远程写入目标:
Expand Down Expand Up @@ -63,6 +65,8 @@ otelcol.auth.basic "credentials" {
- `GREPTIME_DB`: GreptimeDB 数据库名称,默认是 `public`。
- `GREPTIME_USERNAME` 和 `GREPTIME_PASSWORD`: GreptimeDB 的[鉴权认证信息](/user-guide/deployments-administration/authentication/static.md)。

GreptimeDB 未开启认证时,删除 `otelcol.auth.basic` 块和 exporter 中的 `auth` 属性。凭据为空时 Alloy 会拒绝加载该配置。

有关从 OpenTelemetry 到 GreptimeDB 的指标数据模型转换的详细信息,请参阅 OpenTelemetry 指南中的[数据模型](/user-guide/ingest-data/for-observability/opentelemetry.md#数据模型)部分。

### 日志
Expand Down Expand Up @@ -125,6 +129,8 @@ otelcol.exporter.otlphttp "greptimedb_logs" {
- `GREPTIME_USERNAME` 和 `GREPTIME_PASSWORD`: GreptimeDB 的[鉴权认证信息](/user-guide/deployments-administration/authentication/static.md)。
- `X-Greptime-Log-Extract-Keys`: 从 OTLP 日志属性中提取的键。详情请参阅 [OTLP/HTTP API 文档](/user-guide/ingest-data/for-observability/opentelemetry.md#otlphttp-api-1)。

GreptimeDB 未开启认证时,删除 `otelcol.auth.basic` 块和 exporter 中的 `auth` 属性。凭据为空时 Alloy 会拒绝加载该配置。

有关从 OpenTelemetry 到 GreptimeDB 的日志数据模型转换的详细信息,请参阅 OpenTelemetry 指南中的[数据模型](/user-guide/ingest-data/for-observability/opentelemetry.md#数据模型-1)部分。

## Loki
Expand Down
Loading
Loading