Skip to content
Closed
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
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,22 @@ else
go generate ./internal/tools/docs_generator/
endif

generate-docs-config-args:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
@echo "Generating documentation config arguments for all components..."
@go list -f '{{.Dir}}' $$(go list -f '{{join .Imports " "}}' ./internal/component/all) | while read dir; do \
if [ -f "$$dir/metadata.yml" ]; then \
component_name=$$(echo $$dir | sed 's|.*/internal/component/||'); \
output_dir="docs/sources/shared/generated/components/$$component_name"; \
echo "Generating docs for component: $$component_name"; \
mkdir -p "$$output_dir"; \
go run ./internal/tools/alloygen/ generate "$$dir/metadata.yml" "$$output_dir"; \
fi; \
done
endif

generate-winmanifest:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
Expand All @@ -298,6 +314,9 @@ else
bash ./.github/ISSUE_TEMPLATE/scripts/update-gh-issue-templates.sh
endif

validate-metadata:
bash ./tools/validate-metadata

#
# Other targets
#
Expand Down
22 changes: 6 additions & 16 deletions docs/sources/reference/components/loki/loki.source.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,26 @@ The component starts an HTTP server on the configured port and address with the

You can use the following arguments with `loki.source.api`:

| Name | Type | Description | Default | Required |
| ------------------------ | -------------------- | ------------------------------------------------------- | ---------- | -------- |
| `forward_to` | `list(LogsReceiver)` | List of receivers to send log entries to. | | yes |
| `labels` | `map(string)` | The labels to associate with each received logs record. | `{}` | no |
| `relabel_rules` | `RelabelRules` | Relabeling rules to apply on log entries. | `{}` | no |
| `use_incoming_timestamp` | `bool` | Whether to use the timestamp received from request. | `false` | no |
| `max_send_message_size` | `size` | Maximum size of a request to the push API. | `"100MiB"` | no |
{{< docs/shared lookup="generated/components/loki/source/api/__arguments.md" source="alloy" version="<ALLOY_VERSION>" >}}

The `relabel_rules` field can make use of the `rules` export value from a [`loki.relabel`][loki.relabel] component to apply one or more relabeling rules to log entries before they're forwarded to the list of receivers in `forward_to`.

[loki.relabel]: ../loki.relabel/

## Blocks

<!-- TODO: Add this note to the docgen -->
You can use the following blocks with `loki.source.api`:

| Name | Description | Required |
| --------------------- | -------------------------------------------------- | -------- |
| [`http`][http] | Configures the HTTP server that receives requests. | no |
| `http` > [`tls`][tls] | Configures TLS for the HTTP server. | no |
{{< docs/shared lookup="generated/components/loki/source/api/__blocks.md" source="alloy" version="<ALLOY_VERSION>" >}}

<!-- TODO: Add this note to the docgen -->
The > symbol indicates deeper levels of nesting.
For example, `http` > `tls` refers to a `tls` block defined inside an `http` block.

[http]: #http
[tls]: #tls

### `http`

{{< docs/shared lookup="reference/components/server-http.md" source="alloy" version="<ALLOY_VERSION>" >}}
{{< docs/shared lookup="generated/components/loki/source/api/http.md" source="alloy" version="<ALLOY_VERSION>" >}}

### `tls`

Expand All @@ -89,7 +79,7 @@ The `tls` block configures TLS for the HTTP server.

## Exported fields

`loki.source.api` doesn't export any fields.
{{< docs/shared lookup="generated/components/loki/source/api/__exports.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Component health

Expand Down
63 changes: 24 additions & 39 deletions docs/sources/reference/components/loki/loki.source.awsfirehose.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ The HTTP API exposed is compatible
with the [Data Firehose HTTP Delivery API](https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html).
Since the API model that Data Firehose uses to deliver data over HTTP is generic enough, the same component can be used to receive data from multiple origins:

* [Amazon CloudWatch logs](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-cloudwatch-logs.html)
* [Amazon CloudWatch events](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-cloudwatch-events.html)
* Custom data through [DirectPUT requests](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-sdk.html)
- [Amazon CloudWatch logs](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-cloudwatch-logs.html)
- [Amazon CloudWatch events](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-cloudwatch-events.html)
- Custom data through [DirectPUT requests](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-sdk.html)

The component uses a heuristic to try to decode as much information as possible from each log record, and it falls back to writing the raw records to Loki.
The decoding process goes as follows:

* Data Firehose sends batched requests
* Each record is treated individually
* For each `record` received in each request:
* If the `record` comes from a [CloudWatch logs subscription filter](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#DestinationKinesisExample), it's decoded and each logging event is written to Loki
* All other records are written raw to Loki
- Data Firehose sends batched requests
- Each record is treated individually
- For each `record` received in each request:
- If the `record` comes from a [CloudWatch logs subscription filter](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#DestinationKinesisExample), it's decoded and each logging event is written to Loki
- All other records are written raw to Loki

The component exposes some internal labels, available for relabeling.
The following tables describes internal labels available in records coming from any source.
Expand Down Expand Up @@ -65,7 +65,7 @@ loki.source.awsfirehose "<LABEL>" {

The component starts an HTTP server on the configured port and address with the following endpoints:

* `/awsfirehose/api/v1/push` - accepting `POST` requests compatible with [Data Firehose HTTP Specifications](https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html).
- `/awsfirehose/api/v1/push` - accepting `POST` requests compatible with [Data Firehose HTTP Specifications](https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html).

You can use the [X-Amz-Firehose-Common-Attributes](https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html) header to set extra static labels.
You can configure the header in the **Parameters** section of the Data Firehose delivery stream configuration.
Expand All @@ -88,12 +88,7 @@ Example of the valid `X-Amz-Firehose-Common-Attributes` value with two custom la

You can use the following arguments with `loki.source.awsfirehose`:

| Name | Type | Description | Default | Required |
| ------------------------ | -------------------- | -------------------------------------------------------- | ------- | -------- |
| `forward_to` | `list(LogsReceiver)` | List of receivers to send log entries to. | | yes |
| `access_key` | `secret` | If set, require Data Firehose to provide a matching key. | `""` | no |
| `relabel_rules` | `RelabelRules` | Relabeling rules to apply on log entries. | `{}` | no |
| `use_incoming_timestamp` | `bool` | Whether to use the timestamp received from the request. | `false` | no |
{{< docs/shared lookup="generated/components/loki/source/aws_firehose/__arguments.md" source="alloy" version="<ALLOY_VERSION>" >}}

The `relabel_rules` field can make use of the `rules` export value from a [`loki.relabel`][loki.relabel] component to apply one or more relabeling rules to log entries before they're forwarded to the list of receivers in `forward_to`.

Expand All @@ -103,37 +98,28 @@ The `relabel_rules` field can make use of the `rules` export value from a [`loki

You can use the following blocks with `loki.source.awsfirehose`:

| Name | Description | Required |
| --------------------- | -------------------------------------------------- | -------- |
| [`grpc`][grpc] | Configures the gRPC server that receives requests. | no |
| `gprc` > [`tls`][tls] | Configures TLS for the gRPC server. | no |
| [`http`][http] | Configures the HTTP server that receives requests. | no |
| `http` > [`tls`][tls] | Configures TLS for the HTTP server. | no |
{{< docs/shared lookup="generated/components/loki/source/aws_firehose/__blocks.md" source="alloy" version="<ALLOY_VERSION>" >}}

The > symbol indicates deeper levels of nesting.
For example, `http` > `tls` refers to a `tls` block defined inside an `http` block.

[http]: #http
[grpc]: #grpc
[tls]: #tls

### `grpc`

{{< docs/shared lookup="reference/components/loki-server-grpc.md" source="alloy" version="<ALLOY_VERSION>" >}}
{{< docs/shared lookup="generated/components/loki/source/aws_firehose/grpc.md" source="alloy" version="<ALLOY_VERSION>" >}}

### `http`

{{< docs/shared lookup="reference/components/server-http.md" source="alloy" version="<ALLOY_VERSION>" >}}
{{< docs/shared lookup="generated/components/loki/source/aws_firehose/http.md" source="alloy" version="<ALLOY_VERSION>" >}}

### `tls`

The `tls` block configures TLS for the HTTP and gRPC servers.

{{< docs/shared lookup="reference/components/server-tls-config-block.md" source="alloy" version="<ALLOY_VERSION>" >}}
{{< docs/shared lookup="generated/components/loki/source/aws_firehose/tls.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Exported fields

`loki.source.awsfirehose` doesn't export any fields.
{{< docs/shared lookup="generated/components/loki/source/aws_firehose/__exports.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Component health

Expand All @@ -147,11 +133,11 @@ The following are some of the metrics that are exposed when this component is us
The metrics include labels such as `status_code` where relevant, which you can use to measure request success rates.
{{< /admonition >}}

* `loki_source_awsfirehose_batch_size` (histogram): Size (in units) of the number of records received per request.
* `loki_source_awsfirehose_invalid_static_labels_errors` (counter): Count number of errors while processing Data Firehose static labels.
* `loki_source_awsfirehose_record_errors` (counter): Count of errors while decoding an individual record.
* `loki_source_awsfirehose_records_received` (counter): Count of records received.
* `loki_source_awsfirehose_request_errors` (counter): Count of errors while receiving a request.
- `loki_source_awsfirehose_batch_size` (histogram): Size (in units) of the number of records received per request.
- `loki_source_awsfirehose_invalid_static_labels_errors` (counter): Count number of errors while processing Data Firehose static labels.
- `loki_source_awsfirehose_record_errors` (counter): Count of errors while decoding an individual record.
- `loki_source_awsfirehose_records_received` (counter): Count of records received.
- `loki_source_awsfirehose_request_errors` (counter): Count of errors while receiving a request.

## Example

Expand Down Expand Up @@ -183,8 +169,8 @@ loki.source.awsfirehose "loki_fh_receiver" {

Replace the following:

* _`<USERNAME>`_: Your username.
* _`<PASSWORD_FILE>`_: Your password file.
- _`<USERNAME>`_: Your username.
- _`<PASSWORD_FILE>`_: Your password file.

As another example, if you are receiving records that originated from a CloudWatch logs subscription, you can enrich each received entry by relabeling internal labels.
The following configuration builds upon the one above but keeps the origin log stream and group as `log_stream` and `log_group`, respectively.
Expand Down Expand Up @@ -228,8 +214,8 @@ loki.relabel "logging_origin" {

Replace the following:

* _`<USERNAME>`_: Your username.
* _`<PASSWORD_FILE>`_: Your password file.
- _`<USERNAME>`_: Your username.
- _`<PASSWORD_FILE>`_: Your password file.

<!-- START GENERATED COMPATIBLE COMPONENTS -->

Expand All @@ -239,7 +225,6 @@ Replace the following:

- Components that export [Loki `LogsReceiver`](../../../compatibility/#loki-logsreceiver-exporters)


{{< admonition type="note" >}}
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly.
Refer to the linked documentation for more details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

canonical: https://grafana.com/docs/alloy/latest/reference/components/loki/loki.source.azure_event_hubs/
aliases:
- ../loki.source.azure_event_hubs/ # /docs/alloy/latest/reference/components/loki.source.azure_event_hubs/
Expand Down Expand Up @@ -42,17 +41,7 @@ loki.source.azure_event_hubs "<LABEL>" {

You can use the following arguments with `loki.source.azure_event_hubs`:

| Name | Type | Description | Default | Required |
|-----------------------------|----------------------|-------------------------------------------------------------------------------------|----------------------------------|----------|
| `event_hubs` | `list(string)` | Event Hubs to consume. | | yes |
| `forward_to` | `list(LogsReceiver)` | List of receivers to send log entries to. | | yes |
| `fully_qualified_namespace` | `string` | Event hub namespace. | | yes |
| `assignor` | `string` | The consumer group rebalancing strategy to use. | `"range"` | no |
| `disallow_custom_messages` | `bool` | Whether to ignore messages that don't match the [schema][] for Azure resource logs. | `false` | no |
| `group_id` | `string` | The Kafka consumer group ID. | `"loki.source.azure_event_hubs"` | no |
| `labels` | `map(string)` | The labels to associate with each received event. | `{}` | no |
| `relabel_rules` | `RelabelRules` | Relabeling rules to apply on log entries. | `{}` | no |
| `use_incoming_timestamp` | `bool` | Whether to use the timestamp received from Azure Event Hub. | `false` | no |
{{< docs/shared lookup="generated/components/loki/source/azure_event_hubs/__arguments.md" source="alloy" version="<ALLOY_VERSION>" >}}

The `fully_qualified_namespace` argument must refer to a full `HOST:PORT` that points to your event hub, such as `NAMESPACE.servicebus.windows.net:9093`.
The `assignor` argument must be set to one of `"range"`, `"roundrobin"`, or `"sticky"`.
Expand Down Expand Up @@ -80,31 +69,23 @@ The following internal labels prefixed with `__` are available but are discarded

You can use the following block with `loki.source.azure_event_hubs`:

| Name | Description | Required |
|------------------------------------|----------------------------------------------------|----------|
| [`authentication`][authentication] | Authentication configuration with Azure Event Hub. | yes |

[authentication]: #authentication
{{< docs/shared lookup="generated/components/loki/source/azure_event_hubs/__blocks.md" source="alloy" version="<ALLOY_VERSION>" >}}

### `authentication`

{{< badge text="Required" >}}

The `authentication` block defines the authentication method when communicating with Azure Event Hub.

| Name | Type | Description | Default | Required |
|---------------------|----------------|---------------------------------------------------------------------------|---------|----------|
| `mechanism` | `string` | Authentication mechanism. | | yes |
| `connection_string` | `secret` | Event Hubs ConnectionString for authentication on Azure Cloud. | | no |
| `scopes` | `list(string)` | Access token scopes. Default is `fully_qualified_namespace` without port. | | no |
{{< docs/shared lookup="generated/components/loki/source/azure_event_hubs/authentication.md" source="alloy" version="<ALLOY_VERSION>" >}}

`mechanism` supports the values `"connection_string"` and `"oauth"`.
If `"connection_string"` is used, you must set the `connection_string` attribute.
If `"oauth"` is used, you must configure one of the [supported credential types](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/README.md#credential-types) via environment variables or Azure CLI.

## Exported fields

`loki.source.azure_event_hubs` doesn't export any fields.
`{{< docs/shared lookup="generated/components/loki/source/azure_event_hubs/__exports.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Component health

Expand Down Expand Up @@ -144,7 +125,6 @@ loki.write "example" {

- Components that export [Loki `LogsReceiver`](../../../compatibility/#loki-logsreceiver-exporters)


{{< admonition type="note" >}}
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly.
Refer to the linked documentation for more details.
Expand Down
Loading
Loading