From 7a17b64828471a8a931970e4aadae172bd2238ae Mon Sep 17 00:00:00 2001 From: Pablo Balbi Date: Tue, 2 May 2023 12:54:12 -0300 Subject: [PATCH] adjusting snippets --- .../components/loki.source.gcplog.md | 2 +- .../components/loki.source.heroku.md | 38 +++++++++++++------ .../reference/components/loki-server-grpc.md | 2 +- .../reference/components/loki-server-http.md | 2 +- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/docs/sources/flow/reference/components/loki.source.gcplog.md b/docs/sources/flow/reference/components/loki.source.gcplog.md index aaca5df2a042..32132aca4a73 100644 --- a/docs/sources/flow/reference/components/loki.source.gcplog.md +++ b/docs/sources/flow/reference/components/loki.source.gcplog.md @@ -90,7 +90,7 @@ Name | Type | Description ------------------------ |---------------|-----------------------------------------------------------------| ------- | -------- `http` | [HTTP][] | Configures the HTTP server that receives requests. | | no `grpc` | [gRPC][] | Configures the gRPC server that receives requests. | | no - `graceful_shutdown_timeout` | `duration` | Timeout for server's graceful shutdown. | "30s" | no + `graceful_shutdown_timeout` | `duration` | Timeout for servers graceful shutdown. | "30s" | no `push_timeout` | `duration` | Sets a maximum processing time for each incoming GCP log entry. | `"0s"` | no `labels` | `map(string)` | Additional labels to associate with incoming entries. | `"{}"` | no `use_incoming_timestamp` | `bool` | Whether to use the incoming entry timestamp. | `false` | no diff --git a/docs/sources/flow/reference/components/loki.source.heroku.md b/docs/sources/flow/reference/components/loki.source.heroku.md index 17946b08056b..fa37d67af43f 100644 --- a/docs/sources/flow/reference/components/loki.source.heroku.md +++ b/docs/sources/flow/reference/components/loki.source.heroku.md @@ -41,6 +41,7 @@ Name | Type | Description | Defau `labels` | `map(string)` | The labels to associate with each received Heroku record. | `{}` | no `forward_to` | `list(LogsReceiver)` | List of receivers to send log entries to. | | yes `relabel_rules` | `RelabelRules` | Relabeling rules to apply on log entries. | `{}` | no +`graceful_shutdown_timeout` | `duration` | Timeout for servers graceful shutdown. | "30s" | no The `relabel_rules` field can make use of the `rules` export value from a `loki.relabel` component to apply one or more relabeling rules to log entries @@ -52,19 +53,19 @@ The following blocks are supported inside the definition of `loki.source.heroku` Hierarchy | Name | Description | Required --------- | ---- | ----------- | -------- -listener | [listener] | Configures a listener for Heroku messages. | yes +`http` | [HTTP][] | Configures the HTTP server that receives requests. | | no +`grpc` | [gRPC][] | Configures the gRPC server that receives requests. | | no -[listener]: #listener-block +[http]: #http +[grpc]: #grpc -### listener block +### http -The `listener` block defines the listen address and port where the listener -expects Heroku messages to be sent to. +{{< docs/shared lookup="flow/reference/components/loki-server-grpc.md" source="agent" >}} -Name | Type | Description | Default | Required ------------------------- | ------------- | ----------- | ------- | -------- -`address` | `string` | The `` address to listen to for heroku messages. | `0.0.0.0` | no -`port` | `int` | The `` to listen to for heroku messages. | | yes +### grpc + +{{< docs/shared lookup="flow/reference/components/loki-server-grpc.md" source="agent" >}} ## Labels @@ -105,9 +106,9 @@ This example listens for Heroku messages over TCP in the specified port and forw ```river loki.source.heroku "local" { - listener { + http { address = "0.0.0.0" - port = 8080 + port = 4040 } use_incoming_timestamp = true labels = {component = "loki.source.heroku"} @@ -121,3 +122,18 @@ loki.write "local" { } ``` +When using the default `http` block settings, the server listen for new connection on port `8080`. + +```river +loki.source.heroku "local" { + use_incoming_timestamp = true + labels = {component = "loki.source.heroku"} + forward_to = [loki.write.local.receiver] +} + +loki.write "local" { + endpoint { + url = "loki:3100/api/v1/push" + } +} +``` diff --git a/docs/sources/shared/flow/reference/components/loki-server-grpc.md b/docs/sources/shared/flow/reference/components/loki-server-grpc.md index e00a4a1f128a..471fc4ff0e89 100644 --- a/docs/sources/shared/flow/reference/components/loki-server-grpc.md +++ b/docs/sources/shared/flow/reference/components/loki-server-grpc.md @@ -4,7 +4,7 @@ aliases: headless: true --- -The `grpc` configures the gRPC server. +The `grpc` block configures the gRPC server. The following arguments can be used to configure the `grpc` block. Any omitted fields take their default values. diff --git a/docs/sources/shared/flow/reference/components/loki-server-http.md b/docs/sources/shared/flow/reference/components/loki-server-http.md index 64b60b616385..761887f9a4ea 100644 --- a/docs/sources/shared/flow/reference/components/loki-server-http.md +++ b/docs/sources/shared/flow/reference/components/loki-server-http.md @@ -4,7 +4,7 @@ aliases: headless: true --- -The `http` configures the HTTP server. +The `http` block configures the HTTP server. The following arguments can be used to configure the `http` block. Any omitted fields take their default values.