Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore][receiver/udplog] created metadata #21670

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions receiver/udplogreceiver/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# UDP Receiver

| Status | |
| ------------------------ |-----------|
| Stability | [alpha] |
| Supported pipeline types | logs |
| Distributions | [contrib] |
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [alpha]: logs |
| Distributions | [contrib] |

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

Receives logs over UDP.

Expand Down Expand Up @@ -69,5 +73,4 @@ receivers:
udplog:
listen_address: "0.0.0.0:54525"
```
[alpha]:https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib

2 changes: 2 additions & 0 deletions receiver/udplogreceiver/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:generate mdatagen metadata.yaml

package udplogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/udplogreceiver"
12 changes: 12 additions & 0 deletions receiver/udplogreceiver/internal/metadata/generated_status.go

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

8 changes: 8 additions & 0 deletions receiver/udplogreceiver/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: udplog

status:
class: receiver
stability:
alpha: [logs]
distributions: [contrib]

10 changes: 3 additions & 7 deletions receiver/udplogreceiver/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/udp"
)

const (
typeStr = "udplog"
stability = component.StabilityLevelAlpha
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/udplogreceiver/internal/metadata"
)

// NewFactory creates a factory for udp receiver
func NewFactory() receiver.Factory {
return adapter.NewFactory(ReceiverType{}, stability)
return adapter.NewFactory(ReceiverType{}, metadata.LogsStability)
}

// ReceiverType implements adapter.LogReceiverType
Expand All @@ -39,7 +35,7 @@ type ReceiverType struct{}

// Type is the receiver type
func (f ReceiverType) Type() component.Type {
return typeStr
return metadata.Type
}

// CreateDefaultConfig creates a config with type and version
Expand Down