Skip to content

Commit

Permalink
[chore] add metadata status to sapmreceiver
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed May 1, 2023
1 parent 05dad8e commit 0e68484
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 16 deletions.
12 changes: 7 additions & 5 deletions receiver/sapmreceiver/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# SAPM Receiver

<!-- status autogenerated section -->
| Status | |
| ------------------------ |-----------|
| Stability | [beta] |
| Supported pipeline types | traces |
| Stability | [beta] |
| Supported pipeline types | traces |
| Distributions | [contrib] |

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

The SAPM receiver builds on the Jaeger proto. This allows the collector to
receive traces from other collectors or the SignalFx Smart Agent. SAPM proto
and some useful related utilities can be found
Expand Down Expand Up @@ -45,6 +50,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
9 changes: 5 additions & 4 deletions receiver/sapmreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"go.opentelemetry.io/collector/confmap/confmaptest"

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

func TestLoadConfig(t *testing.T) {
Expand All @@ -39,19 +40,19 @@ func TestLoadConfig(t *testing.T) {
expected component.Config
}{
{
id: component.NewIDWithName(typeStr, ""),
id: component.NewIDWithName(metadata.Type, ""),
expected: createDefaultConfig(),
},
{
id: component.NewIDWithName(typeStr, "customname"),
id: component.NewIDWithName(metadata.Type, "customname"),
expected: &Config{
HTTPServerSettings: confighttp.HTTPServerSettings{
Endpoint: "0.0.0.0:7276",
},
},
},
{
id: component.NewIDWithName(typeStr, "tls"),
id: component.NewIDWithName(metadata.Type, "tls"),
expected: &Config{
HTTPServerSettings: confighttp.HTTPServerSettings{
Endpoint: ":7276",
Expand All @@ -65,7 +66,7 @@ func TestLoadConfig(t *testing.T) {
},
},
{
id: component.NewIDWithName(typeStr, "passthrough"),
id: component.NewIDWithName(metadata.Type, "passthrough"),
expected: &Config{
HTTPServerSettings: confighttp.HTTPServerSettings{
Endpoint: ":7276",
Expand Down
2 changes: 2 additions & 0 deletions receiver/sapmreceiver/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:generate mdatagen metadata.yaml

// Package sapmreceiver implements a receiver that can be used by the
// Opentelemetry collector to receive traces in the Splunk SAPM format.
package sapmreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sapmreceiver"
11 changes: 4 additions & 7 deletions receiver/sapmreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,21 @@ import (
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/receiver"

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

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

// Default endpoints to bind to.
defaultEndpoint = ":7276"
)

// NewFactory creates a factory for SAPM receiver.
func NewFactory() receiver.Factory {
return receiver.NewFactory(
typeStr,
metadata.Type,
createDefaultConfig,
receiver.WithTraces(createTracesReceiver, stability))
receiver.WithTraces(createTracesReceiver, metadata.Stability))
}

func createDefaultConfig() component.Config {
Expand Down
12 changes: 12 additions & 0 deletions receiver/sapmreceiver/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 receiver/sapmreceiver/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: sapm

status:
class: receiver
stability: beta
pipelines: [traces]
distributions: [contrib]

0 comments on commit 0e68484

Please sign in to comment.