Skip to content

Commit

Permalink
[chore][extension/storage/db] use generated status header (#22817)
Browse files Browse the repository at this point in the history
This PR updates the component to generate the status table using mdatagen.

Linked issue: #21213

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
Alex Boten authored May 26, 2023
1 parent 2c8fecc commit de252f7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
18 changes: 10 additions & 8 deletions extension/storage/dbstorage/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Database Storage

| Status | |
| ------------------------ |-------------------|
| Stability | [alpha] |
| Distributions | [contrib], [sumo] |
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [alpha] |
| Distributions | [contrib], [sumo] |

[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[sumo]: https://github.com/SumoLogic/sumologic-otel-collector
<!-- end autogenerated section -->

> :construction: This extension is in alpha. Configuration and functionality are subject to change.
Expand Down Expand Up @@ -41,7 +47,3 @@ processors:
exporters:
nop:
```

[alpha]:https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[sumo]: https://github.com/SumoLogic/sumologic-otel-collector
11 changes: 6 additions & 5 deletions extension/storage/dbstorage/factory.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

package dbstorage // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage"

import (
"context"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/extension"
)

// The value of extension "type" in configuration.
const typeStr component.Type = "db_storage"
"github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage/internal/metadata"
)

// NewFactory creates a factory for DBStorage extension.
func NewFactory() extension.Factory {
return extension.NewFactory(
typeStr,
metadata.Type,
createDefaultConfig,
createExtension,
component.StabilityLevelAlpha,
metadata.ExtensionStability,
)
}

Expand Down
12 changes: 12 additions & 0 deletions extension/storage/dbstorage/internal/metadata/generated_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions extension/storage/dbstorage/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: db_storage

status:
class: extension
stability:
alpha: [extension]
distributions: [contrib, sumo]

0 comments on commit de252f7

Please sign in to comment.