diff --git a/Makefile b/Makefile index 3e2d72b2fd..6ea4b3be13 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -298,6 +314,9 @@ else bash ./.github/ISSUE_TEMPLATE/scripts/update-gh-issue-templates.sh endif +validate-metadata: + bash ./tools/validate-metadata + # # Other targets # diff --git a/docs/sources/reference/components/loki/loki.source.api.md b/docs/sources/reference/components/loki/loki.source.api.md index 2c5e32892a..429fc34f33 100644 --- a/docs/sources/reference/components/loki/loki.source.api.md +++ b/docs/sources/reference/components/loki/loki.source.api.md @@ -50,13 +50,7 @@ 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="" >}} 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`. @@ -64,22 +58,18 @@ The `relabel_rules` field can make use of the `rules` export value from a [`loki ## Blocks + 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="" >}} + 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="" >}} +{{< docs/shared lookup="generated/components/loki/source/api/http.md" source="alloy" version="" >}} ### `tls` @@ -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="" >}} ## Component health diff --git a/docs/sources/reference/components/loki/loki.source.awsfirehose.md b/docs/sources/reference/components/loki/loki.source.awsfirehose.md index d3a28ba1e7..016d1dde69 100644 --- a/docs/sources/reference/components/loki/loki.source.awsfirehose.md +++ b/docs/sources/reference/components/loki/loki.source.awsfirehose.md @@ -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. @@ -65,7 +65,7 @@ loki.source.awsfirehose "