Skip to content

Commit

Permalink
[chore] add codeowners to metadata (open-telemetry#24404)
Browse files Browse the repository at this point in the history
**Description:**
This is a minute set of changes, adding codeowners to every component
and additional folders as designed by the CODEOWNERS file.

Notable changes are renames:
extension/encodingextension/metadata.yml ->
extension/encodingextension/metadata.yaml
cmd/mdatagen/metadata.yaml -> cmd/mdatagen/metadata-sample.yaml

**Link to tracking Issue:**
This is step 2 of open-telemetry#23367

**Testing:**
I have used a tool I created to regenerate CODEOWNERS from this file.
  • Loading branch information
atoulme committed Jul 24, 2023
1 parent d95d199 commit 8a4348c
Show file tree
Hide file tree
Showing 412 changed files with 839 additions and 156 deletions.
6 changes: 6 additions & 0 deletions cmd/configschema/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: configschema

status:
class: cmd
codeowners:
active: [mx-psi, dmitryax, pmcollins]
2 changes: 1 addition & 1 deletion cmd/mdatagen/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

// Generate a test metrics builder from a sample metrics set covering all configuration options.
//go:generate mdatagen metadata.yaml
//go:generate mdatagen metadata-sample.yaml

package main
2 changes: 1 addition & 1 deletion cmd/mdatagen/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func Test_loadMetadata(t *testing.T) {
wantErr string
}{
{
name: "metadata.yaml",
name: "metadata-sample.yaml",
want: metadata{
Type: "file",
SemConvVersion: "1.9.0",
Expand Down
18 changes: 12 additions & 6 deletions cmd/mdatagen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ func run(ymlPath string) error {
return err
}

if err = inlineReplace(
filepath.Join(tmplDir, "readme.md.tmpl"),
filepath.Join(ymlDir, "README.md"),
md, statusStart, statusEnd); err != nil {
return err
if _, err = os.Stat(filepath.Join(ymlDir, "README.md")); err == nil {
if err = inlineReplace(
filepath.Join(tmplDir, "readme.md.tmpl"),
filepath.Join(ymlDir, "README.md"),
md, statusStart, statusEnd); err != nil {
return err
}
}
}
if len(md.Metrics) == 0 && len(md.ResourceAttributes) == 0 {
Expand Down Expand Up @@ -143,7 +145,11 @@ func templatize(tmplFile string, md metadata) *template.Template {
"userLinks": func(elems []string) []string {
result := make([]string, len(elems))
for i, elem := range elems {
result[i] = fmt.Sprintf("[@%s](https://www.github.com/%s)", elem, elem)
if elem == "open-telemetry/collector-approvers" {
result[i] = "[@open-telemetry/collector-approvers](https://github.com/orgs/open-telemetry/teams/collector-approvers)"
} else {
result[i] = fmt.Sprintf("[@%s](https://www.github.com/%s)", elem, elem)
}
}
return result
},
Expand Down
105 changes: 105 additions & 0 deletions cmd/mdatagen/metadata-sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Sample metric metadata file with all available configurations.

type: file

sem_conv_version: 1.9.0

status:
class: receiver
stability:
development: [logs]
beta: [traces]
stable: [metrics]
distributions: [contrib]
warnings:
- Any additional information that should be brought to the consumer's attention

resource_attributes:
string.resource.attr:
description: Resource attribute with any string value.
type: string
enabled: true

string.enum.resource.attr:
description: Resource attribute with a known set of string values.
type: string
enum: [one, two]
enabled: true

optional.resource.attr:
description: Explicitly disabled ResourceAttribute.
type: string
enabled: false

slice.resource.attr:
description: Resource attribute with a slice value.
type: slice
enabled: true

map.resource.attr:
description: Resource attribute with a map value.
type: map
enabled: true

attributes:
string_attr:
description: Attribute with any string value.
type: string

overridden_int_attr:
name_override: state
description: Integer attribute with overridden name.
type: int

enum_attr:
description: Attribute with a known set of string values.
type: string
enum: [red, green, blue]

boolean_attr:
description: Attribute with a boolean value.
type: bool

slice_attr:
description: Attribute with a slice value.
type: slice

map_attr:
description: Attribute with a map value.
type: map

metrics:
default.metric:
enabled: true
description: Monotonic cumulative sum int metric enabled by default.
extended_documentation: The metric will be become optional soon.
unit: s
sum:
value_type: int
monotonic: true
aggregation: cumulative
attributes: [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr]
warnings:
if_enabled_not_set: This metric will be disabled by default soon.

optional.metric:
enabled: false
description: "[DEPRECATED] Gauge double metric disabled by default."
unit: 1
gauge:
value_type: double
attributes: [string_attr, boolean_attr]
warnings:
if_configured: This metric is deprecated and will be removed soon.

default.metric.to_be_removed:
enabled: true
description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default."
extended_documentation: The metric will be will be removed soon.
unit: s
sum:
value_type: double
monotonic: false
aggregation: delta
warnings:
if_enabled: This metric is deprecated and will be removed soon.
107 changes: 4 additions & 103 deletions cmd/mdatagen/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,105 +1,6 @@
# Sample metric metadata file with all available configurations.

type: file

sem_conv_version: 1.9.0
type: mdatagen

status:
class: receiver
stability:
development: [logs]
beta: [traces]
stable: [metrics]
distributions: [contrib]
warnings:
- Any additional information that should be brought to the consumer's attention

resource_attributes:
string.resource.attr:
description: Resource attribute with any string value.
type: string
enabled: true

string.enum.resource.attr:
description: Resource attribute with a known set of string values.
type: string
enum: [one, two]
enabled: true

optional.resource.attr:
description: Explicitly disabled ResourceAttribute.
type: string
enabled: false

slice.resource.attr:
description: Resource attribute with a slice value.
type: slice
enabled: true

map.resource.attr:
description: Resource attribute with a map value.
type: map
enabled: true

attributes:
string_attr:
description: Attribute with any string value.
type: string

overridden_int_attr:
name_override: state
description: Integer attribute with overridden name.
type: int

enum_attr:
description: Attribute with a known set of string values.
type: string
enum: [red, green, blue]

boolean_attr:
description: Attribute with a boolean value.
type: bool

slice_attr:
description: Attribute with a slice value.
type: slice

map_attr:
description: Attribute with a map value.
type: map

metrics:
default.metric:
enabled: true
description: Monotonic cumulative sum int metric enabled by default.
extended_documentation: The metric will be become optional soon.
unit: s
sum:
value_type: int
monotonic: true
aggregation: cumulative
attributes: [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr]
warnings:
if_enabled_not_set: This metric will be disabled by default soon.

optional.metric:
enabled: false
description: "[DEPRECATED] Gauge double metric disabled by default."
unit: 1
gauge:
value_type: double
attributes: [string_attr, boolean_attr]
warnings:
if_configured: This metric is deprecated and will be removed soon.

default.metric.to_be_removed:
enabled: true
description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default."
extended_documentation: The metric will be will be removed soon.
unit: s
sum:
value_type: double
monotonic: false
aggregation: delta
warnings:
if_enabled: This metric is deprecated and will be removed soon.
class: cmd
codeowners:
active: [dmitryax]
2 changes: 2 additions & 0 deletions cmd/mdatagen/templates/status.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

package {{ .Package }}

{{- if .Status.Stability }}
import (
"go.opentelemetry.io/collector/component"
)
{{- end }}

const (
Type = "{{ .Type }}"
Expand Down
6 changes: 4 additions & 2 deletions cmd/mdatagen/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ func (md *metadata) validateStatus() error {
if err := md.Status.validateClass(); err != nil {
errs = multierr.Append(errs, err)
}
if err := md.Status.validateStability(); err != nil {
errs = multierr.Append(errs, err)
if md.Parent == "" {
if err := md.Status.validateStability(); err != nil {
errs = multierr.Append(errs, err)
}
}
return errs
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/opampsupervisor/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: opampsupervisor

status:
class: cmd
codeowners:
active: [evan-bradley, atoulme, tigrannajaryan]
6 changes: 6 additions & 0 deletions cmd/otelcontribcol/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: otelcontribcol

status:
class: cmd
codeowners:
active: []
6 changes: 6 additions & 0 deletions cmd/oteltestbedcol/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: oteltestbedcol

status:
class: cmd
codeowners:
active: []
1 change: 1 addition & 0 deletions cmd/telemetrygen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| Stability | [alpha]: traces |
| | [development]: metrics, logs |
| Issues | ![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Acmd%2Ftelemetrygen%20&label=open&color=orange&logo=opentelemetry) ![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Acmd%2Ftelemetrygen%20&label=closed&color=blue&logo=opentelemetry) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@mx-psi](https://www.github.com/mx-psi), [@codeboten](https://www.github.com/codeboten) |

[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha
[development]: https://github.com/open-telemetry/opentelemetry-collector#development
Expand Down
2 changes: 2 additions & 0 deletions cmd/telemetrygen/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ status:
stability:
alpha: [traces]
development: [metrics, logs]
codeowners:
active: [mx-psi, codeboten]
3 changes: 3 additions & 0 deletions confmap/provider/s3provider/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
status:
codeowners:
active: [Aneurysm9]
1 change: 1 addition & 0 deletions connector/countconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
| ------------- |-----------|
| Distributions | [contrib], [sumo] |
| Issues | ![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aconnector%2Fcount%20&label=open&color=orange&logo=opentelemetry) ![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aconnector%2Fcount%20&label=closed&color=blue&logo=opentelemetry) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski), [@jpkrohling](https://www.github.com/jpkrohling) |

[development]: https://github.com/open-telemetry/opentelemetry-collector#development
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
Expand Down
2 changes: 2 additions & 0 deletions connector/countconnector/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ status:
stability:
development: [traces_to_metrics, metrics_to_metrics, logs_to_metrics]
distributions: [contrib, sumo]
codeowners:
active: [djaglowski, jpkrohling]
1 change: 1 addition & 0 deletions connector/routingconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| ------------- |-----------|
| Distributions | [contrib] |
| Issues | ![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aconnector%2Frouting%20&label=open&color=orange&logo=opentelemetry) ![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aconnector%2Frouting%20&label=closed&color=blue&logo=opentelemetry) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jpkrohling](https://www.github.com/jpkrohling), [@kovrus](https://www.github.com/kovrus), [@mwear](https://www.github.com/mwear) |

[development]: https://github.com/open-telemetry/opentelemetry-collector#development
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
Expand Down
2 changes: 2 additions & 0 deletions connector/routingconnector/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ status:
stability:
development: [traces_to_traces, metrics_to_metrics, logs_to_logs]
distributions: [contrib]
codeowners:
active: [jpkrohling, kovrus, mwear]
1 change: 1 addition & 0 deletions connector/servicegraphconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| ------------- |-----------|
| Distributions | [contrib], [sumo] |
| Issues | ![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aconnector%2Fservicegraph%20&label=open&color=orange&logo=opentelemetry) ![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aconnector%2Fservicegraph%20&label=closed&color=blue&logo=opentelemetry) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jpkrohling](https://www.github.com/jpkrohling), [@mapno](https://www.github.com/mapno) |

[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
Expand Down
2 changes: 2 additions & 0 deletions connector/servicegraphconnector/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ status:
stability:
alpha: [traces_to_metrics]
distributions: [contrib, sumo]
codeowners:
active: [jpkrohling, mapno]
1 change: 1 addition & 0 deletions connector/spanmetricsconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| ------------- |-----------|
| Distributions | [contrib], [sumo] |
| Issues | ![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aconnector%2Fspanmetrics%20&label=open&color=orange&logo=opentelemetry) ![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aconnector%2Fspanmetrics%20&label=closed&color=blue&logo=opentelemetry) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@albertteoh](https://www.github.com/albertteoh), [@kovrus](https://www.github.com/kovrus) |

[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
Expand Down
2 changes: 2 additions & 0 deletions connector/spanmetricsconnector/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ status:
stability:
alpha: [traces_to_metrics]
distributions: [contrib, sumo]
codeowners:
active: [albertteoh, kovrus]
Loading

0 comments on commit 8a4348c

Please sign in to comment.