-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Loki connector | ||
|
||
```{raw} html | ||
<img src="../_static/img/loki.png" class="connector-logo"> | ||
``` | ||
|
||
The Loki connector allows querying log data stored in [Grafana | ||
Loki](https://grafana.com/oss/loki/). This document describes how to configure a | ||
catalog with the Loki connector to run SQL queries against Loki. | ||
|
||
## Requirements | ||
|
||
To connect to Loki, you need: | ||
|
||
- Loki 3.1.0 or higher. | ||
- Network access from the Trino coordinator and workers to Loki. | ||
Port 3100 is the default port. | ||
|
||
## Configuration | ||
|
||
The connector can query log data in Loki. Create a catalog properties file that | ||
specifies the Loki connector by setting the `connector.name` to `loki`. | ||
|
||
For example, to access a database as the `example` catalog, create the file | ||
`etc/catalog/example.properties`. | ||
|
||
```text | ||
connector.name=loki | ||
loki.uri=http://loki.example.com:3100 | ||
``` | ||
|
||
The `loki.uri` property specifies the URI endpoint for the Loki server that | ||
Trino cluster nodes use to access the Loki APIs. | ||
|
||
The optional property `loki.query-timeout` defaults to `10s` and controls the | ||
[duration]() Trino waits for a result from Loki before the specific query | ||
request times out. A minimum of `1s` is required. | ||
|
||
(loki-type-mapping)= | ||
## Type mapping | ||
|
||
Because Trino and Loki each support types that the other does not, this | ||
connector [modifies some types](type-mapping-overview) when reading data. | ||
|
||
### Loki type to Trino type mapping | ||
|
||
The connector maps Loki types to the corresponding Trino types following | ||
this table: | ||
|
||
:::{list-table} Loki type to Trino type mapping | ||
:widths: 40, 60 | ||
:header-rows: 1 | ||
|
||
* - Loki type | ||
- Trino type | ||
* - `tbd` | ||
- `tbd` | ||
::: | ||
|
||
No other types are supported. | ||
|
||
(loki-sql-support)= | ||
## SQL support | ||
|
||
The connector provides read access to data and metadata in Loki. In addition to | ||
the [globally available](sql-globally-available) and [read | ||
operation](sql-read-operations) statements, the connector supports the following | ||
features: | ||
|
||
(loki-query-function)= | ||
#### `query_range(varchar) -> table` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.