Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
thampiotr committed Nov 17, 2023
1 parent a6e39d1 commit aaa4d75
Show file tree
Hide file tree
Showing 86 changed files with 214 additions and 197 deletions.
5 changes: 2 additions & 3 deletions docs/generator/compatible_components_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ func listOfComponentsExporting(dataType metadata.Type) string {
}

func listOfLinksToComponents(components []string) string {
groups := make(map[string][]string)

str := ""
groups := make(map[string][]string)

for _, component := range components {
parts := strings.SplitN(component, ".", 2)
Expand All @@ -87,7 +86,7 @@ func listOfLinksToComponents(components []string) string {
for namespace, components := range groups {
str += fmt.Sprintf("\n{{< collapse title=%q >}}\n", namespace)
for _, component := range components {
str += fmt.Sprintf("- [`%[1]s`]({{< relref \"../components/%[1]s.md\" >}})\n", component)
str += fmt.Sprintf("- [%[1]s]({{< relref \"../components/%[1]s.md\" >}})\n", component)
}
str += fmt.Sprintf("{{< /collapse >}}\n")
}
Expand Down
22 changes: 20 additions & 2 deletions docs/generator/links_to_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package generator
import (
"fmt"
"github.com/grafana/agent/component/metadata"
"regexp"
"strings"
)

type LinksToTypesGenerator struct {
Expand Down Expand Up @@ -74,7 +76,11 @@ func outputComponentsSection(name string, meta metadata.Metadata) string {
section := ""
for _, outputDataType := range meta.Exports {
if list := allComponentsThatAccept(outputDataType); len(list) > 0 {
section += fmt.Sprintf("- Components that accept [%s]({{< relref \"../compatibility\" >}})\n", outputDataType.Name)
section += fmt.Sprintf(
"- Components that accept [%s]({{< relref \"../compatibility/%s\" >}})\n",
outputDataType.Name,
anchorFor(outputDataType.Name, "consumers"),
)
}
}
if section != "" {
Expand All @@ -87,11 +93,23 @@ func acceptingComponentsSection(componentName string, meta metadata.Metadata) st
section := ""
for _, acceptedDataType := range meta.Accepts {
if list := allComponentsThatExport(acceptedDataType); len(list) > 0 {
section += fmt.Sprintf("- Components that export [%s]({{< relref \"../compatibility\" >}})\n", acceptedDataType.Name)
section += fmt.Sprintf(
"- Components that export [%s]({{< relref \"../compatibility/%s\" >}})\n",
acceptedDataType.Name,
anchorFor(acceptedDataType.Name, "exporters"),
)
}
}
if section != "" {
section = fmt.Sprintf("`%s` can accept arguments from the following components:\n\n", componentName) + section + "\n"
}
return section
}

func anchorFor(parts ...string) string {
for i, s := range parts {
reg := regexp.MustCompile("[^a-z0-9-_]+")
parts[i] = reg.ReplaceAllString(strings.ReplaceAll(strings.ToLower(s), " ", "-"), "")
}
return "#" + strings.Join(parts, "-")
}
204 changes: 102 additions & 102 deletions docs/sources/flow/reference/compatibility/_index.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Replace the following:

`discovery.azure` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.consul.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Replace the following:

`discovery.consul` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Replace the following:

`discovery.consulagent` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Replace the following:

`discovery.digitalocean` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Replace the following:

`discovery.dns` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Replace the following:

`discovery.docker` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Replace the following:

`discovery.dockerswarm` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.ec2.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Replace the following:

`discovery.ec2` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.eureka.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Replace the following:

`discovery.eureka` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Replace the following:

`discovery.file` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.gce.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Replace the following:

`discovery.gce` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Replace the following:

`discovery.hetzner` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.http.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ discovery.http "dynamic_targets" {

`discovery.http` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.ionos.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Replace the following:

`discovery.ionos` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Replace the following:

`discovery.kubelet` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ Replace the following:

`discovery.kubernetes` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.kuma.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Replace the following:

`discovery.kuma` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Replace the following:

`discovery.lightsail` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.linode.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ prometheus.remote_write "demo" {

`discovery.linode` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Replace the following:

`discovery.marathon` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.nerve.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Replace the following:

`discovery.nerve` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.nomad.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Replace the following:

`discovery.nomad` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Replace the following:

`discovery.openstack` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Replace the following:

`discovery.puppetdb` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
4 changes: 2 additions & 2 deletions docs/sources/flow/reference/components/discovery.relabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ discovery.relabel "keep_backend_only" {

`discovery.relabel` can accept arguments from the following components:

- Components that export [Targets]({{< relref "../compatibility" >}})
- Components that export [Targets]({{< relref "../compatibility/#targets-exporters" >}})

`discovery.relabel` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Replace the following:

`discovery.scaleway` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ prometheus.remote_write "default" {

`discovery.serverset` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.triton.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Replace the following:

`discovery.triton` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/discovery.uyuni.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Replace the following:

`discovery.uyuni` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/faro.receiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Replace the following:

`faro.receiver` can accept arguments from the following components:

- Components that export [Loki `LogsReceiver`]({{< relref "../compatibility" >}})
- Components that export [Loki `LogsReceiver`]({{< relref "../compatibility/#loki-logsreceiver-exporters" >}})


Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/flow/reference/components/local.file_match.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ Replace the following:

`local.file_match` can accept arguments from the following components:

- Components that export [Targets]({{< relref "../compatibility" >}})
- Components that export [Targets]({{< relref "../compatibility/#targets-exporters" >}})

`local.file_match` exports can be consumed by the following components:

- Components that accept [Targets]({{< relref "../compatibility" >}})
- Components that accept [Targets]({{< relref "../compatibility/#targets-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/loki.echo.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ loki.echo "example" { }

`loki.echo` exports can be consumed by the following components:

- Components that accept [Loki `LogsReceiver`]({{< relref "../compatibility" >}})
- Components that accept [Loki `LogsReceiver`]({{< relref "../compatibility/#loki-logsreceiver-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
4 changes: 2 additions & 2 deletions docs/sources/flow/reference/components/loki.process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1700,11 +1700,11 @@ loki.process "local" {

`loki.process` can accept arguments from the following components:

- Components that export [Loki `LogsReceiver`]({{< relref "../compatibility" >}})
- Components that export [Loki `LogsReceiver`]({{< relref "../compatibility/#loki-logsreceiver-exporters" >}})

`loki.process` exports can be consumed by the following components:

- Components that accept [Loki `LogsReceiver`]({{< relref "../compatibility" >}})
- Components that accept [Loki `LogsReceiver`]({{< relref "../compatibility/#loki-logsreceiver-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
4 changes: 2 additions & 2 deletions docs/sources/flow/reference/components/loki.relabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ loki.relabel "keep_error_only" {

`loki.relabel` can accept arguments from the following components:

- Components that export [Loki `LogsReceiver`]({{< relref "../compatibility" >}})
- Components that export [Loki `LogsReceiver`]({{< relref "../compatibility/#loki-logsreceiver-exporters" >}})

`loki.relabel` exports can be consumed by the following components:

- Components that accept [Loki `LogsReceiver`]({{< relref "../compatibility" >}})
- Components that accept [Loki `LogsReceiver`]({{< relref "../compatibility/#loki-logsreceiver-consumers" >}})

Note that connecting some components may not be feasible or components may require further configuration to make the connection work correctly. Please refer to the linked documentation for more details.

Expand Down
Loading

0 comments on commit aaa4d75

Please sign in to comment.