Skip to content

Commit

Permalink
test fixing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thampiotr committed Nov 28, 2023
1 parent ca5050a commit 0a384ed
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 62 deletions.
13 changes: 3 additions & 10 deletions component/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/prometheus/prometheus/storage"
)

//TODO(thampiotr): Instead of metadata package reaching into registry, we'll migrate to using a YAML metadata file that
// contains information about all the components. This file will be generated separately from the
// registry and can be used by other tools.
//TODO(thampiotr): Instead of metadata package reaching into registry, we'll migrate to using a YAML schema file that
// contains information about all the available components. This file will be generated separately and
// can be used by other tools.

type Type struct {
Name string
Expand Down Expand Up @@ -123,10 +123,7 @@ func (m Metadata) ExportsType(t Type) bool {
return false
}

var currentComponent = ""

func ForComponent(name string) (Metadata, error) {
currentComponent = name
reg, ok := component.Get(name)
if !ok {
return Metadata{}, fmt.Errorf("could not find component %q", name)
Expand All @@ -150,10 +147,6 @@ func inferMetadata(args component.Arguments, exports component.Exports) Metadata
func hasFieldOfType(obj interface{}, fieldType reflect.Type) bool {
objValue := reflect.ValueOf(obj)

if fieldType.String() == "[]otelcol.Consumer" && currentComponent == "otelcol.receiver.loki" {
fmt.Println("gotcha")
}

// If the object is a pointer, dereference it
for objValue.Kind() == reflect.Ptr {
objValue = objValue.Elem()
Expand Down
1 change: 1 addition & 0 deletions docs/sources/flow/reference/compatibility/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ on the namespace to expand and see more detail.
{{< /collapse >}}

{{< collapse title="prometheus" >}}
- [prometheus.operator.podmonitors]({{< relref "../components/prometheus.operator.podmonitors.md" >}})
- [prometheus.operator.probes]({{< relref "../components/prometheus.operator.probes.md" >}})
- [prometheus.operator.servicemonitors]({{< relref "../components/prometheus.operator.servicemonitors.md" >}})
- [prometheus.receive_http]({{< relref "../components/prometheus.receive_http.md" >}})
Expand Down
1 change: 0 additions & 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,6 @@ Replace the following:

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

- Components that consume [Targets]({{< relref "../compatibility/#targets-consumers" >}})
- Components that consume [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
3 changes: 0 additions & 3 deletions docs/sources/flow/reference/components/local.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,3 @@ local.file "secret_key" {
is_secret = true
}
```
<!-- START GENERATED COMPATIBLE COMPONENTS -->

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

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

<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 0 additions & 3 deletions docs/sources/flow/reference/components/module.http.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,3 @@ export "redis_targets" {
Replace the following:
- `REDIS_ADDR`: The address of your Redis instance.
- `REDIS_PASSWORD_FILE`: The path to a file containing the password for your Redis instance.
<!-- START GENERATED COMPATIBLE COMPONENTS -->

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

<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 0 additions & 3 deletions docs/sources/flow/reference/components/otelcol.auth.basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,3 @@ otelcol.auth.basic "creds" {
```

[otelcol.exporter.otlp]: {{< relref "./otelcol.exporter.otlp.md" >}}
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 0 additions & 3 deletions docs/sources/flow/reference/components/otelcol.auth.bearer.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,3 @@ otelcol.auth.bearer "creds" {

[otelcol.exporter.otlp]: {{< relref "./otelcol.exporter.otlp.md" >}}
[otelcol.exporter.otlphttp]: {{< relref "./otelcol.exporter.otlphttp.md" >}}
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,3 @@ otelcol.auth.headers "creds" {
```

[otelcol.exporter.otlp]: {{< relref "./otelcol.exporter.otlp.md" >}}
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 0 additions & 3 deletions docs/sources/flow/reference/components/otelcol.auth.oauth2.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,3 @@ otelcol.auth.oauth2 "creds" {
```

[otelcol.exporter.otlp]: {{< relref "./otelcol.exporter.otlp.md" >}}
<!-- START GENERATED COMPATIBLE COMPONENTS -->

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

<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,3 @@ otelcol.extension.jaeger_remote_sampling "example" {
}
}
```
<!-- START GENERATED COMPATIBLE COMPONENTS -->

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

<!-- END GENERATED COMPATIBLE COMPONENTS -->
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,3 @@ prometheus.remote_write "default" {
This example assumes that the Secret and ConfigMap have already been created, and that the appropriate field names
exist in their data.

<!-- START GENERATED COMPATIBLE COMPONENTS -->

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

This example assumes that the Secret and ConfigMap have already been created, and that the appropriate field names
exist in their data.
<!-- START GENERATED COMPATIBLE COMPONENTS -->

<!-- END GENERATED COMPATIBLE COMPONENTS -->
3 changes: 0 additions & 3 deletions docs/sources/flow/reference/components/remote.s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,3 @@ remote.s3 "data" {
path = "s3://test-bucket/file.txt"
}
```
<!-- START GENERATED COMPATIBLE COMPONENTS -->

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

<!-- END GENERATED COMPATIBLE COMPONENTS -->

0 comments on commit 0a384ed

Please sign in to comment.