-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
342 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
component: builder | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Add an option to the builder to generate an executable that can execute a text template of distribution documentation | ||
|
||
# One or more tracking issues or pull requests related to the change | ||
issues: [12528] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. | ||
|
||
// Program {{ .Distribution.Name }} is an OpenTelemetry Collector utility to generate docs. | ||
package main | ||
|
||
import ( | ||
_ "embed" | ||
"text/template" | ||
"go.opentelemetry.io/collector/component" | ||
"go.opentelemetry.io/collector/confmap" | ||
{{- range.ConfmapConverters }} | ||
{{.Name}} "{{.Import}}" | ||
{{- end }} | ||
{{- range.ConfmapProviders }} | ||
{{.Name}} "{{.Import}}" | ||
{{- end }} | ||
"{{.Distribution.Module}}/internal" | ||
"go.opentelemetry.io/collector/otelcol" | ||
{{- range .Connectors}} | ||
{{.Name}} "{{.Import}}" | ||
{{- end}} | ||
{{- range .Exporters}} | ||
{{.Name}} "{{.Import}}" | ||
{{- end}} | ||
{{- range .Extensions}} | ||
{{.Name}} "{{.Import}}" | ||
{{- end}} | ||
{{- range .Processors}} | ||
{{.Name}} "{{.Import}}" | ||
{{- end}} | ||
{{- range .Receivers}} | ||
{{.Name}} "{{.Import}}" | ||
{{- end}} | ||
) | ||
|
||
//go:embed md.tmpl | ||
var mdBytes []byte | ||
|
||
type ComponentInfo struct { | ||
Name string | ||
GoMod string | ||
Factory component.Factory | ||
} | ||
|
||
func (c ComponentInfo) URL() string { | ||
return strings.Split(c.GoMod, " ")[0] | ||
} | ||
|
||
func (c ComponentInfo) Version() string { | ||
return strings.Split(c.GoMod, " ")[1] | ||
} | ||
|
||
func main() { | ||
buildInfo := component.BuildInfo{ | ||
Command: "{{ .Distribution.Name }}", | ||
Description: "{{ .Distribution.Description }}", | ||
Version: "{{ .Distribution.Version }}", | ||
} | ||
|
||
|
||
|
||
info := struct{ | ||
BuildInfo component.BuildInfo | ||
Connectors []ComponentInfo | ||
Exporters []ComponentInfo | ||
Extensions []ComponentInfo | ||
Processors []ComponentInfo | ||
Receivers []ComponentInfo | ||
}{ | ||
BuildInfo: buildInfo, | ||
Connectors: []ComponentInfo{ | ||
{{- range .Connectors}} | ||
ComponentInfo{ Name: "{{.Name}}", GoMod: "{{.GoMod}}", Factory: {{.Name}}.NewFactory() }, | ||
{{- end}} | ||
}, | ||
Exporters: []ComponentInfo{ | ||
{{- range .Exporters}} | ||
ComponentInfo{ Name: "{{.Name}}", GoMod: "{{.GoMod}}", Factory: {{.Name}}.NewFactory() }, | ||
{{- end}} | ||
}, | ||
Extensions: []ComponentInfo{ | ||
{{- range .Extensions}} | ||
ComponentInfo{ Name: "{{.Name}}", GoMod: "{{.GoMod}}", Factory: {{.Name}}.NewFactory() }, | ||
{{- end}} | ||
}, | ||
Processors: []ComponentInfo{ | ||
{{- range .Processors}} | ||
ComponentInfo{ Name: "{{.Name}}", GoMod: "{{.GoMod}}", Factory: {{.Name}}.NewFactory() }, | ||
{{- end}} | ||
}, | ||
Receivers: []ComponentInfo{ | ||
{{- range .Receivers}} | ||
ComponentInfo{ Name: "{{.Name}}", GoMod: "{{.GoMod}}", Factory: {{.Name}}.NewFactory() }, | ||
{{- end}} | ||
}, | ||
} | ||
|
||
templateBytes := mdBytes | ||
if len(os.Args) > 1 { | ||
templateFile := os.Args[1] | ||
b, err := os.ReadFile(templateFile) | ||
if err != nil { | ||
panic(err) | ||
} | ||
templateBytes = b | ||
} | ||
|
||
tmpl := template.Must(template.New("").Parse(string(templateBytes))) | ||
err := tmpl.Execute(os.Stdout, info) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# {{ .BuildInfo.Command }} {{ .BuildInfo.Version }} | ||
|
||
{{ .BuildInfo.Description }} | ||
|
||
| Connectors | Version | Traces To Traces | Traces To Metrics | Traces To Logs | Metrics To Traces | Metrics To Logs | Logs To Traces | Logs To Metrics | Logs To Logs | | ||
|:---------------------------------------------------------------|:-----------------|:------------------|:---------------|:------------------|:-----------------|:---------------|:----------------|:-------------| | ||
{{- range .Connectors }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.TracesToTracesStability }}[{{.Factory.TracesToTracesStability}}]{{ end }} | {{ if .Factory.TracesToMetricsStability }}[{{.Factory.TracesToMetricsStability}}]{{ end }} | {{ if .Factory.TracesToLogsStability }}[{{.Factory.TracesToLogsStability}}]{{ end }} | {{ if .Factory.MetricsToTracesStability }}[{{.Factory.MetricsToTracesStability}}]{{ end }} | {{ if .Factory.MetricsToMetricsStability }}[{{.Factory.MetricsToMetricsStability}}]{{ end }} | {{ if .Factory.MetricsToLogsStability }}[{{.Factory.MetricsToLogsStability}}]{{ end }} | {{ if .Factory.LogsToTracesStability }}[{{.Factory.LogsToTracesStability}}]{{ end }} | {{ if .Factory.LogsToMetricsStability }}[{{.Factory.LogsToMetricsStability}}]{{ end }} | {{ if .Factory.LogsToLogsStability }}[{{.Factory.LogsToLogsStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Exporters | Version | Logs | Metrics | Traces | | ||
|:---------------------------------------------------------------|:---------------|:---------------|:---------------| | ||
{{- range .Exporters }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.LogsStability }}[{{.Factory.LogsStability}}]{{ end }} | {{ if .Factory.MetricsStability }}[{{.Factory.MetricsStability}}]{{ end }} | {{ if .Factory.TracesStability }}[{{.Factory.TracesStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Extensions | Version | Stability | | ||
|:---------------------------------------------------------------|:---------------| | ||
{{- range .Extensions }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.Stability }}[{{.Factory.Stability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Processors | Version | Logs | Metrics | Traces | | ||
|:---------------------------------------------------------------|:---------------|:---------------|:---------------| | ||
{{- range .Processors }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.LogsStability }}[{{.Factory.LogsStability}}]{{ end }} | {{ if .Factory.MetricsStability }}[{{.Factory.MetricsStability}}]{{ end }} | {{ if .Factory.TracesStability }}[{{.Factory.TracesStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Receivers | Version | Logs | Metrics | Traces | | ||
|:---------------------------------------------------------------|:---------------|:---------------|:---------------| | ||
{{- range .Receivers }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.LogsStability }}[{{.Factory.LogsStability}}]{{ end }} | {{ if .Factory.MetricsStability }}[{{.Factory.MetricsStability}}]{{ end }} | {{ if .Factory.TracesStability }}[{{.Factory.TracesStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
[Development]: https://github.com/open-telemetry/opentelemetry-collector#development | ||
[Alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha | ||
[Beta]: https://github.com/open-telemetry/opentelemetry-collector#beta | ||
[Stable]: https://github.com/open-telemetry/opentelemetry-collector#stable | ||
[Deprecated]: https://github.com/open-telemetry/opentelemetry-collector#deprecated | ||
[Unmaintained]: https://github.com/open-telemetry/opentelemetry-collector#unmaintained |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# {{ .BuildInfo.Command }} {{ .BuildInfo.Version }} | ||
|
||
{{ .BuildInfo.Description }} | ||
|
||
| Connectors | Version | Traces To Traces | Traces To Metrics | Traces To Logs | Metrics To Traces | Metrics To Logs | Logs To Traces | Logs To Metrics | Logs To Logs | | ||
|:---------------------------------------------------------------|:-----------------|:------------------|:---------------|:------------------|:-----------------|:---------------|:----------------|:-------------| | ||
{{- range .Connectors }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.TracesToTracesStability }}[{{.Factory.TracesToTracesStability}}]{{ end }} | {{ if .Factory.TracesToMetricsStability }}[{{.Factory.TracesToMetricsStability}}]{{ end }} | {{ if .Factory.TracesToLogsStability }}[{{.Factory.TracesToLogsStability}}]{{ end }} | {{ if .Factory.MetricsToTracesStability }}[{{.Factory.MetricsToTracesStability}}]{{ end }} | {{ if .Factory.MetricsToMetricsStability }}[{{.Factory.MetricsToMetricsStability}}]{{ end }} | {{ if .Factory.MetricsToLogsStability }}[{{.Factory.MetricsToLogsStability}}]{{ end }} | {{ if .Factory.LogsToTracesStability }}[{{.Factory.LogsToTracesStability}}]{{ end }} | {{ if .Factory.LogsToMetricsStability }}[{{.Factory.LogsToMetricsStability}}]{{ end }} | {{ if .Factory.LogsToLogsStability }}[{{.Factory.LogsToLogsStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Exporters | Version | Logs | Metrics | Traces | | ||
|:---------------------------------------------------------------|:---------------|:---------------|:---------------| | ||
{{- range .Exporters }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.LogsStability }}[{{.Factory.LogsStability}}]{{ end }} | {{ if .Factory.MetricsStability }}[{{.Factory.MetricsStability}}]{{ end }} | {{ if .Factory.TracesStability }}[{{.Factory.TracesStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Extensions | Version | Stability | | ||
|:---------------------------------------------------------------|:---------------| | ||
{{- range .Extensions }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.Stability }}[{{.Factory.Stability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Processors | Version | Logs | Metrics | Traces | | ||
|:---------------------------------------------------------------|:---------------|:---------------|:---------------| | ||
{{- range .Processors }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.LogsStability }}[{{.Factory.LogsStability}}]{{ end }} | {{ if .Factory.MetricsStability }}[{{.Factory.MetricsStability}}]{{ end }} | {{ if .Factory.TracesStability }}[{{.Factory.TracesStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
| Receivers | Version | Logs | Metrics | Traces | | ||
|:---------------------------------------------------------------|:---------------|:---------------|:---------------| | ||
{{- range .Receivers }} | ||
| [{{ .Factory.Type }}]({{ .URL }}) | {{.Version}} | {{ if .Factory.LogsStability }}[{{.Factory.LogsStability}}]{{ end }} | {{ if .Factory.MetricsStability }}[{{.Factory.MetricsStability}}]{{ end }} | {{ if .Factory.TracesStability }}[{{.Factory.TracesStability}}]{{ end }} | | ||
{{- end }} | ||
|
||
[Development]: https://github.com/open-telemetry/opentelemetry-collector#development | ||
[Alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha | ||
[Beta]: https://github.com/open-telemetry/opentelemetry-collector#beta | ||
[Stable]: https://github.com/open-telemetry/opentelemetry-collector#stable | ||
[Deprecated]: https://github.com/open-telemetry/opentelemetry-collector#deprecated | ||
[Unmaintained]: https://github.com/open-telemetry/opentelemetry-collector#unmaintained |