Skip to content

Commit

Permalink
adjusting snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
thepalbi committed May 2, 2023
1 parent 36f77cf commit 7a17b64
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 27 additions & 11 deletions docs/sources/flow/reference/components/loki.source.heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 `<host>` address to listen to for heroku messages. | `0.0.0.0` | no
`port` | `int` | The `<port>` to listen to for heroku messages. | | yes
### grpc

{{< docs/shared lookup="flow/reference/components/loki-server-grpc.md" source="agent" >}}

## Labels

Expand Down Expand Up @@ -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"}
Expand All @@ -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"
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7a17b64

Please sign in to comment.