Skip to content

Commit

Permalink
[chore][receiver/wavefront] wavefront metadata (#21669)
Browse files Browse the repository at this point in the history
Created Metadata file and added stability + type changes.
Link to tracking Issue: #21213
  • Loading branch information
BominRahmani authored May 30, 2023
1 parent 4014092 commit 5b06a57
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 19 deletions.
18 changes: 10 additions & 8 deletions receiver/wavefrontreceiver/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Wavefront Receiver

| Status | |
| ------------------------ |-------------------|
| Stability | [beta] |
| Supported pipeline types | metrics |
| Distributions | [contrib], [sumo] |
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [beta]: metrics |
| Distributions | [contrib], [sumo] |

[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
[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 -->

The Wavefront receiver accepts metrics and depends on [carbonreceiver proto
and
Expand Down Expand Up @@ -57,6 +62,3 @@ receivers:
The full list of settings exposed for this receiver are documented [here](./config.go)
with detailed sample configurations [here](./testdata/config.yaml).
[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[sumo]: https://github.com/SumoLogic/sumologic-otel-collector
6 changes: 4 additions & 2 deletions receiver/wavefrontreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/confignet"
"go.opentelemetry.io/collector/confmap/confmaptest"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/wavefrontreceiver/internal/metadata"
)

func TestLoadConfig(t *testing.T) {
Expand All @@ -26,11 +28,11 @@ func TestLoadConfig(t *testing.T) {
expected component.Config
}{
{
id: component.NewID(typeStr),
id: component.NewID(metadata.Type),
expected: createDefaultConfig(),
},
{
id: component.NewIDWithName(typeStr, "allsettings"),
id: component.NewIDWithName(metadata.Type, "allsettings"),
expected: &Config{
TCPAddr: confignet.TCPAddr{
Endpoint: "localhost:8080",
Expand Down
6 changes: 6 additions & 0 deletions receiver/wavefrontreceiver/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 wavefrontreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/wavefrontreceiver"
12 changes: 3 additions & 9 deletions receiver/wavefrontreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,17 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/wavefrontreceiver/internal/metadata"
)

// This file implements factory for the Wavefront receiver.

const (
// The value of "type" key in configuration.
typeStr = "wavefront"
// The stability level of the receiver.
stability = component.StabilityLevelBeta
)

// NewFactory creates a factory for WaveFront receiver.
func NewFactory() receiver.Factory {
return receiver.NewFactory(
typeStr,
metadata.Type,
createDefaultConfig,
receiver.WithMetrics(createMetricsReceiver, stability))
receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability))
}

func createDefaultConfig() component.Config {
Expand Down
12 changes: 12 additions & 0 deletions receiver/wavefrontreceiver/internal/metadata/generated_status.go

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

9 changes: 9 additions & 0 deletions receiver/wavefrontreceiver/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: wavefront

status:
class: receiver
stability:
beta: [metrics]
distributions: [contrib, sumo]


0 comments on commit 5b06a57

Please sign in to comment.