Skip to content

Commit

Permalink
[pkg/ottl] Add status header to readme (#27896)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth authored Oct 25, 2023
1 parent 6df57dc commit 8a33109
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cmd/githubgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ type DependabotData struct {

func makePriority(status *Status) int {
// not an internal component such as pkg/**, and no distributions:
if len(status.Distributions) == 0 && status.Class != "" {
if (status.Class == "receiver" || status.Class == "processor" || status.Class == "exporter" || status.Class == "connector" || status.Class == "extension" || status.Class == "cmd") &&
len(status.Distributions) == 0 && status.Class != "" {
return 1
}
// start with a score of 2
Expand Down
8 changes: 5 additions & 3 deletions cmd/mdatagen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ func run(ymlPath string) error {
return fmt.Errorf("unable to create output directory %q: %w", codeDir, err)
}
if md.Status != nil {
if err = generateFile(filepath.Join(tmplDir, "status.go.tmpl"),
filepath.Join(codeDir, "generated_status.go"), md); err != nil {
return err
if md.Status.Class != "cmd" && md.Status.Class != "pkg" {
if err = generateFile(filepath.Join(tmplDir, "status.go.tmpl"),
filepath.Join(codeDir, "generated_status.go"), md); err != nil {
return err
}
}

if _, err = os.Stat(filepath.Join(ymlDir, "README.md")); err == nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/mdatagen/metadata-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parent: string
# Required for components (Optional for subcomponents): A high-level view of the development status and use of this component
status:
# Required: The class of the component (For example receiver)
class: <receiver|processor|exporter|connector|extension>
class: <receiver|processor|exporter|connector|extension|cmd|pkg>
# Required: The stability of the component - See https://github.com/open-telemetry/opentelemetry-collector#stability-levels
stability:
development: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension>]
Expand Down
2 changes: 1 addition & 1 deletion cmd/mdatagen/templates/readme.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{- $idx = inc $idx }}
{{- end }}
{{- end}}
{{- if ne $class "cmd" }}
{{- if and (ne $class "cmd") (ne $class "pkg") }}
| Distributions | [{{ stringsJoin .Status.SortedDistributions "], [" }}] |
{{- end }}
{{- if .Status.Warnings }}
Expand Down
2 changes: 1 addition & 1 deletion cmd/mdatagen/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s *Status) validateClass() error {
if s.Class == "" {
return errors.New("missing class")
}
if s.Class != "receiver" && s.Class != "processor" && s.Class != "exporter" && s.Class != "connector" && s.Class != "extension" && s.Class != "cmd" {
if s.Class != "receiver" && s.Class != "processor" && s.Class != "exporter" && s.Class != "connector" && s.Class != "extension" && s.Class != "cmd" && s.Class != "pkg" {
return fmt.Errorf("invalid class: %v", s.Class)
}
return nil
Expand Down
9 changes: 9 additions & 0 deletions pkg/ottl/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# OpenTelemetry Transformation Language
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [alpha]: traces, metrics, logs |
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Apkg%2Fottl%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Apkg%2Fottl) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Apkg%2Fottl%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Apkg%2Fottl) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@kentquirk](https://www.github.com/kentquirk), [@bogdandrutu](https://www.github.com/bogdandrutu), [@evan-bradley](https://www.github.com/evan-bradley) |

[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha
<!-- end autogenerated section -->

The OpenTelemetry Transformation Language is a language for transforming open telemetry data based on the [OpenTelemetry Collector Processing Exploration](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/processing.md).

Expand Down
6 changes: 6 additions & 0 deletions pkg/ottl/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

package ottl // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl"
5 changes: 5 additions & 0 deletions pkg/ottl/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
type: ottl

status:
class: pkg
stability:
alpha: [ traces, metrics, logs ]
codeowners:
active: [TylerHelmuth, kentquirk, bogdandrutu, evan-bradley]

0 comments on commit 8a33109

Please sign in to comment.