Skip to content

Commit

Permalink
[chore] add metadata status to sapmreceiver (#21261)
Browse files Browse the repository at this point in the history
* [chore] add metadata status to sapmreceiver

* use splunk distribution
  • Loading branch information
atoulme committed May 12, 2023
1 parent 86b886d commit 6f5021b
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 19 deletions.
18 changes: 10 additions & 8 deletions receiver/sapmreceiver/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# SAPM Receiver

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

[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[splunk]: https://github.com/signalfx/splunk-otel-collector
<!-- 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
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.TracesStability))
}

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: [traces]
distributions: [contrib, splunk]

0 comments on commit 6f5021b

Please sign in to comment.