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 3f293c0 commit a6e39d1
Show file tree
Hide file tree
Showing 134 changed files with 391 additions and 105 deletions.
15 changes: 8 additions & 7 deletions docs/docs_updated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

var fixTestsFlag = flag.Bool("fix-tests", false, "update the test files with the current generated content")

func TestCompatibleComponentsSectionsUpdated(t *testing.T) {
func TestLinksToTypesSectionsUpdated(t *testing.T) {
for _, name := range component.AllNames() {
t.Run(name, func(t *testing.T) {
runForGenerator(t, generator.NewLinksToTypesGenerator(name))
Expand All @@ -40,6 +40,13 @@ func TestCompatibleComponentsPageUpdated(t *testing.T) {
}

func runForGenerator(t *testing.T, g generator.DocsGenerator) {
if *fixTestsFlag {
err := g.Write()
require.NoError(t, err, "failed to write generated content for: %q", g.Name())
t.Log("updated the docs with generated content", g.Name())
return
}

generated, err := g.Generate()
require.NoError(t, err, "failed to generate: %q", g.Name())

Expand All @@ -51,12 +58,6 @@ func runForGenerator(t *testing.T, g generator.DocsGenerator) {
return
}

if *fixTestsFlag && generated != "" {
err = g.Write()
require.NoError(t, err, "failed to write generated content for: %q", g.Name())
t.Log("updated the docs with generated content", g.Name())
}

actual, err := g.Read()
require.NoError(t, err, "failed to read existing generated docs for %q, try running 'go generate ./docs'", g.Name())
require.Contains(
Expand Down
17 changes: 15 additions & 2 deletions docs/generator/compatible_components_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,22 @@ func listOfComponentsExporting(dataType metadata.Type) string {
}

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

str := ""
for _, comp := range components {
str += fmt.Sprintf(" - [`%[1]s`]({{< relref \"../components/%[1]s.md\" >}})\n", comp)

for _, component := range components {
parts := strings.SplitN(component, ".", 2)
namespace := parts[0]
groups[namespace] = append(groups[namespace], component)
}

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("{{< /collapse >}}\n")
}
return str
}
File renamed without changes.
239 changes: 144 additions & 95 deletions docs/sources/flow/reference/compatibility/_index.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.consul.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.ec2.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.eureka.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.gce.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.http.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@ discovery.http "dynamic_targets" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.ionos.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.kuma.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.linode.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,5 @@ prometheus.remote_write "demo" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.nerve.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.nomad.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ discovery.relabel "keep_backend_only" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ prometheus.remote_write "default" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.triton.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/discovery.uyuni.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/faro.receiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 3 additions & 0 deletions docs/sources/flow/reference/components/local.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ local.file "secret_key" {
is_secret = true
}
```
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/local.file_match.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ Replace the following:

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/loki.echo.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ loki.echo "example" { }

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/loki.process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1708,4 +1708,5 @@ loki.process "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/loki.relabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,5 @@ loki.relabel "keep_error_only" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/loki.source.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,5 @@ loki.source.api "loki_push_api" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,5 @@ loki.relabel "logging_origin" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,5 @@ loki.write "example" {
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.
<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/loki.source.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/loki.source.gelf.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ loki.write "endpoint" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ loki.write "endpoint" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,5 @@ loki.write "local" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ loki.write "endpoint" {

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions docs/sources/flow/reference/components/loki.write.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,5 @@ Any labels that start with `__` will be removed before sending to the endpoint.

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.


<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,6 @@ roleRef:
name: grafana-agent
apiGroup: rbac.authorization.k8s.io
```
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 3 additions & 0 deletions docs/sources/flow/reference/components/module.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@ prometheus.remote_write "grafana_cloud" {
}
}
```
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 3 additions & 0 deletions docs/sources/flow/reference/components/module.git.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,6 @@ module.git "add" {
}
}
```
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
Loading

0 comments on commit a6e39d1

Please sign in to comment.