Skip to content

Commit

Permalink
Merge branch 'main' into refine-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicecui authored Sep 5, 2024
2 parents 00074ef + 0efd9fa commit fba969b
Show file tree
Hide file tree
Showing 122 changed files with 941 additions and 1,284 deletions.
4 changes: 2 additions & 2 deletions docs/contributor-guide/frontend/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `Frontend` executes requests from clients, and performs some tasks in the cl
, like tenant management, authorization validation, flow control, etc.

The `Frontend` can expose multiple endpoints for reading and writing data in various protocols. You
can refer to [Clients][1] for more details.
can refer to [Protocols][1] for more details.

The following picture shows a typical deployment of GreptimeDB in the cloud. The `Frontend` instances
form a cluster to serve the requests from clients:
Expand All @@ -16,6 +16,6 @@ form a cluster to serve the requests from clients:
- [Table Sharding][2]
- [Distributed Querying][3]

[1]: /user-guide/clients/overview.md
[1]: /user-guide/protocols/overview.md
[2]: ./table-sharding.md
[3]: ./distributed-querying.md
2 changes: 1 addition & 1 deletion docs/db-cloud-shared/clients/otlp-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To send OpenTelemetry Metrics to GreptimeDB through OpenTelemetry SDK libraries,
* URL: `https://<host>/v1/otlp/v1/metrics`
* Headers:
* `X-Greptime-DB-Name`: `<dbname>`
* `Authorization`: `Basic` authentication, which is a Base64 encoded string of `<username>:<password>`. For more information, please refer to [Authentication](https://docs.greptime.com/user-guide/clients/authentication) and [HTTP API](https://docs.greptime.com/user-guide/clients/http-api#authentication)
* `Authorization`: `Basic` authentication, which is a Base64 encoded string of `<username>:<password>`. For more information, please refer to [Authentication](https://docs.greptime.com/user-guide/operations/authentication) and [HTTP API](https://docs.greptime.com/user-guide/protocols/http#authentication)

The request uses binary protobuf to encode the payload, so you need to use packages that support `HTTP/protobuf`. For example, in Node.js, you can use [`exporter-trace-otlp-proto`](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-proto); in Go, you can use [`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp); in Java, you can use [`io.opentelemetry:opentelemetry-exporter-otlp`](https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-exporter-otlp); and in Python, you can use [`opentelemetry-exporter-otlp-proto-http`](https://pypi.org/project/opentelemetry-exporter-otlp-proto-http/).

Expand Down
57 changes: 1 addition & 56 deletions docs/db-cloud-shared/migrate/migrate-from-influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,7 @@ This guide will help you understand the differences between the data models of G

## Data model in difference

While you may already be familiar with [InfluxDB key concepts](https://docs.influxdata.com/influxdb/v2/reference/key-concepts/), the [data model](/user-guide/concepts/data-model.md) of GreptimeDB is something new to explore.
Here are the similarities and differences between the data models of GreptimeDB and InfluxDB:

- Both solutions are [schemaless](/user-guide/ingest-data/overview.md#automatic-schema-generation), eliminating the need to define a schema before writing data.
- In InfluxDB, a point represents a single data record with a measurement, tag set, field set, and a timestamp.
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.

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:

|_time|_measurement|location|scientist|_field|_value|
|---|---|---|---|---|---|
|2019-08-18T00:00:00Z|census|klamath|anderson|bees|23|
|2019-08-18T00:00:00Z|census|portland|mullen|ants|30|
|2019-08-18T00:06:00Z|census|klamath|anderson|bees|28|
|2019-08-18T00:06:00Z|census|portland|mullen|ants|32|

The data mentioned above is formatted as follows in the InfluxDB line protocol:


```shell
census,location=klamath,scientist=anderson bees=23 1566086400000000000
census,location=portland,scientist=mullen ants=30 1566086400000000000
census,location=klamath,scientist=anderson bees=28 1566086760000000000
census,location=portland,scientist=mullen ants=32 1566086760000000000
```

In the GreptimeDB data model, the data is represented as follows in the `census` table:

```sql
+---------------------+----------+-----------+------+------+
| ts | location | scientist | bees | ants |
+---------------------+----------+-----------+------+------+
| 2019-08-18 00:00:00 | klamath | anderson | 23 | NULL |
| 2019-08-18 00:06:00 | klamath | anderson | 28 | NULL |
| 2019-08-18 00:00:00 | portland | mullen | NULL | 30 |
| 2019-08-18 00:06:00 | portland | mullen | NULL | 32 |
+---------------------+----------+-----------+------+------+
```

The schema of the `census` table is as follows:

```sql
+-----------+----------------------+------+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+-----------+----------------------+------+------+---------+---------------+
| location | String | PRI | YES | | TAG |
| scientist | String | PRI | YES | | TAG |
| bees | Float64 | | YES | | FIELD |
| ts | TimestampNanosecond | PRI | NO | | TIMESTAMP |
| ants | Float64 | | YES | | FIELD |
+-----------+----------------------+------+------+---------+---------------+
```
To understand the differences between the data models of InfluxDB and GreptimeDB, please refer to the [Data Model](/user-guide/ingest-data/for-iot/influxdb-line-protocol.md#data-model) in the Ingest Data documentation.

## Database connection information

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ go get go.opentelemetry.io/[email protected] \
```

Once the required packages are installed, write the code to create a metric export object that sends metrics to GreptimeDB in `app.go`.
For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/clients/otlp.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).
For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/protocols/opentelemetry.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).

```go
auth := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", *username, *password)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ do
done
```
For information on the host, database, username, and password required for the InfluxDB API, please refer to the InfluxDB documentation in [GreptimeDB](/user-guide/clients/influxdb-line.md) or [GreptimeCloud](/greptimecloud/integrations/influxdb.md).
For information on the host, database, username, and password required for the InfluxDB API, please refer to the InfluxDB documentation in [GreptimeDB](/user-guide/protocols/influxdb-line-protocol.md) or [GreptimeCloud](/greptimecloud/integrations/influxdb.md).
Congratulations on successfully completing the core section of the demo! You can now run the complete demo by following the instructions in the `README.md` file on the [GitHub repository](https://github.com/GreptimeCloudStarters/quick-start-influxdb-line-protocol).
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
}
```

Once the required packages are installed, write the code to create a metric export object that sends metrics to GreptimeDB. For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/clients/otlp.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).
Once the required packages are installed, write the code to create a metric export object that sends metrics to GreptimeDB. For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/protocols/opentelemetry.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).

```java
String endpoint = String.format("https://%s/v1/otlp/v1/metrics", dbHost);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ do
done
```
For information on the host, database, username, and password required for the MySQL API, please refer to the MySQL documentation in [GreptimeDB](/user-guide/clients/mysql.md) or [GreptimeCloud](/greptimecloud/integrations/mysql.md).
For information on the host, database, username, and password required for the MySQL API, please refer to the MySQL documentation in [GreptimeDB](/user-guide/protocols/mysql.md) or [GreptimeCloud](/greptimecloud/integrations/mysql.md).
Congratulations on successfully completing the core section of the demo! You can now run the complete demo by following the instructions in the `README.md` file on the [GitHub repository](https://github.com/GreptimeCloudStarters/quick-start-mysql).
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ npm install @opentelemetry/[email protected] \
```

Once the required packages are installed,create a new file named `app.ts` and write the code to create a metric export object that sends metrics to GreptimeDB.
For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/clients/otlp.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).
For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/protocols/opentelemetry.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).

```ts
const exporter = new OTLPMetricExporter({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ remote_write:
password: <password>
```
The configuration file above configures Prometheus to scrape metrics from the node exporter and send them to GreptimeDB. For the configuration about `<host>`, `<dbname>`, `<username>`, and `<password>`, please refer to the Prometheus documentation in [GreptimeDB](/user-guide/clients/prometheus.md) or [GreptimeCloud](/greptimecloud/integrations/prometheus/quick-setup.md).
The configuration file above configures Prometheus to scrape metrics from the node exporter and send them to GreptimeDB. For the configuration about `<host>`, `<dbname>`, `<username>`, and `<password>`, please refer to the Prometheus documentation in [GreptimeDB](/user-guide/integrations/prometheus.md) or [GreptimeCloud](/greptimecloud/integrations/prometheus/quick-setup.md).

Finally, start the containers:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pip install -r requirements.txt
```

Once the required packages are installed,create a new file named `main.py` and write the code to create a metric export object that sends metrics to GreptimeDB.
For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/clients/otlp.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).
For the configuration about the exporter, please refer to OTLP integration documentation in [GreptimeDB](/user-guide/protocols/opentelemetry.md) or [GreptimeCloud](/greptimecloud/integrations/otlp.md).

```python
from opentelemetry import metrics
Expand Down
4 changes: 2 additions & 2 deletions docs/faq-and-others/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ GreptimeDB supports SQL and can deal with non-time-series data, especially effic

Yes, you can find our Go SDK here: https://github.com/GreptimeTeam/greptimedb-ingester-go.

Currently, we support MySQL protocol, you can check it out on the [user guide](/user-guide/clients/mysql.md).
Currently, we support MySQL protocol, you can check it out on the [user guide](/user-guide/protocols/mysql.md).

HTTP API is also available, please see [this article](/user-guide/clients/http-api.md) for more information.
HTTP API is also available, please see [this article](/user-guide/protocols/http.md) for more information.

### Can GreptimeDB be used as a Rust alternative to Prometheus in the observable area?

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide will walk you through creating a metric table and a log table, highli

## Connect to GreptimeDB

GreptimeDB supports [multiple protocols](/user-guide/clients/overview.md) for interacting with the database.
GreptimeDB supports [multiple protocols](/user-guide/protocols/overview.md) for interacting with the database.
In this quick start document, we use SQL for simplicity.

If your GreptimeDB instance is running on `127.0.0.1` with the MySQL client default port `4002` or the PostgreSQL client default port `4003`,
Expand Down Expand Up @@ -380,6 +380,6 @@ The `grpc_metrics` table will be created automatically if it does not exist.
You have now experienced the core features of GreptimeDB.
To further explore and utilize GreptimeDB:

- [Visualize data using Grafana](/user-guide/clients/grafana.md)
- [Visualize data using Grafana](/user-guide/integrations/grafana.md)
- [Explore more demos of GreptimeDB](https://github.com/GreptimeTeam/demo-scene/)
- [Read the user guide document to learn more details about GreptimeDB](/user-guide/overview.md)
2 changes: 1 addition & 1 deletion docs/greptimecloud/integrations/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You have the option to connect GreptimeDB with Grafana using one of three data s

Before using the GreptimeDB data source, it is necessary to manually install the GreptimeDB data source plugin.
For more information,
please refer to the [GreptimeDB data source plugin](https://docs.greptime.com/user-guide/clients/grafana##greptimedb-data-source-plugin) document.
please refer to the [GreptimeDB data source plugin](https://docs.greptime.com/user-guide/integrations/grafana##greptimedb-data-source-plugin) document.

Click the Add data source button and select GreptimeDB as the type. Fill in the following URL in the GreptimeDB server URL:

Expand Down
2 changes: 1 addition & 1 deletion docs/greptimecloud/integrations/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ protocol](https://docs.influxdata.com/influxdb/cloud/reference/syntax/line-proto
ingestion API over http. The API and authentication is compatible with [InfluxDB
write protocol
1.x](https://docs.influxdata.com/influxdb/v1.8/guides/write_data/#write-data-using-the-influxdb-api).
Please refer to [InfluxDB client](https://docs.greptime.com/user-guide/clients/influxdb-line) of GreptimeDB for more information.
Please refer to [InfluxDB line protocol](https://docs.greptime.com/user-guide/ingest-data/for-iot/influxdb-line-protocol) of GreptimeDB for more information.

- URL: `https://<host>/v1/influxdb/write?db=<dbname>`
- Username: `<username>`
Expand Down
2 changes: 1 addition & 1 deletion docs/greptimecloud/integrations/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

GreptimeCloud exposes GreptimeDB access in MySQL server-client protocol. Most
standard clients and drivers are compatible and the connection is encrypted with TLS.
Refer to [MySQL client](https://docs.greptime.com/user-guide/clients/mysql) of GreptimeDB for more information.
Refer to [MySQL client](https://docs.greptime.com/user-guide/protocols/mysql) of GreptimeDB for more information.

To connect to GreptimeCloud in MySQL protocol, using information below:

Expand Down
2 changes: 1 addition & 1 deletion docs/greptimecloud/integrations/otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To send OpenTelemetry Metrics to GreptimeDB through OpenTelemetry SDK libraries,
* URL: `https://<host>/v1/otlp/v1/metrics`
* Headers:
* `X-Greptime-DB-Name`: `<dbname>`
* `Authorization`: `Basic` authentication, which is a Base64 encoded string of `<username>:<password>`. For more information, please refer to [Authentication](https://docs.greptime.com/user-guide/clients/authentication) and [HTTP API](https://docs.greptime.com/user-guide/clients/http-api#authentication)
* `Authorization`: `Basic` authentication, which is a Base64 encoded string of `<username>:<password>`. For more information, please refer to [Authentication](https://docs.greptime.com/user-guide/operations/authentication) and [HTTP API](https://docs.greptime.com/user-guide/protocols/http#authentication)

The request uses binary protobuf to encode the payload, so you need to use packages that support `HTTP/protobuf`. For example, in Node.js, you can use [`exporter-trace-otlp-proto`](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-proto); in Go, you can use [`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp); in Java, you can use [`io.opentelemetry:opentelemetry-exporter-otlp`](https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-exporter-otlp); and in Python, you can use [`opentelemetry-exporter-otlp-proto-http`](https://pypi.org/project/opentelemetry-exporter-otlp-proto-http/).

Expand Down
2 changes: 1 addition & 1 deletion docs/greptimecloud/integrations/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GreptimeCloud exposes GreptimeDB access in PostgreSQL v3 wire protocol. Most
standard clients and drivers are compatible at wire protocol level, and the connection is encrypted with TLS.
Note that we don't use Postgres' SQL dialect in GreptimeDB, so there can be some statements
that are unsupported.
For more information, please refer to [Postgresql documentation](https://docs.greptime.com/user-guide/clients/postgresql) of GreptimeDB.
For more information, please refer to [Postgresql documentation](https://docs.greptime.com/user-guide/protocols/postgresql) of GreptimeDB.

To connect to GreptimeCloud in Postgres wire protocol, using information below:

Expand Down
4 changes: 2 additions & 2 deletions docs/greptimecloud/integrations/prometheus/quick-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

GreptimeCloud with GreptimeDB is fully compatible with Prometheus.
This means that you can seamlessly use GreptimeCloud as a replacement for Prometheus.
For more information, please refer to the [Prometheus documentation](https://docs.greptime.com/user-guide/clients/prometheus) in the GreptimeDB user guide.
For more information, please refer to the [Prometheus documentation](https://docs.greptime.com/user-guide/integrations/prometheus) in the GreptimeDB user guide.

## Remote Write and Read

Expand Down Expand Up @@ -42,4 +42,4 @@ git push

## PromQL

GreptimeDB supports PromQL (Prometheus Query Language). This means that you can use GreptimeDB as a drop-in replacement for Prometheus. Please refer to [PromQL](https://docs.greptime.com/user-guide/clients/prometheus#prometheus-query-language) for more details.
GreptimeDB supports PromQL (Prometheus Query Language). This means that you can use GreptimeDB as a drop-in replacement for Prometheus. Please refer to [PromQL](https://docs.greptime.com/user-guide/integrations/prometheus#prometheus-query-language) for more details.
2 changes: 1 addition & 1 deletion docs/greptimecloud/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GreptimeCloud is a cloud service that is powered by fully-managed serverless Gre

## Integrations

Before reading the following content, you need to read [clients](/user-guide/clients/overview.md) first. You can connect to GreptimeCloud using popular database protocols:
You can connect to GreptimeCloud using popular database protocols:

- Prometheus [integration](./integrations/prometheus/quick-setup.md) and [rule management](./integrations/prometheus/rule-management.md)
- [Grafana](./integrations/grafana.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/command-lines.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ greptime frontend start --help
- `--tls-cert-path <TLS_CERT_PATH>`: The TLS public key file path;
- `--tls-key-path <TLS_KEY_PATH>`: The TLS private key file path;
- `--tls-mode <TLS_MODE>`: TLS Mode;
- `--user-provider <USER_PROVIDER>`: You can refer [authentication](/user-guide/clients/authentication.md);
- `--user-provider <USER_PROVIDER>`: You can refer [authentication](/user-guide/operations/authentication.md);

### Flownode subcommand options

Expand Down
Loading

0 comments on commit fba969b

Please sign in to comment.