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

[exporter/carbon] use generated status header #22081

Merged
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
21 changes: 11 additions & 10 deletions exporter/carbonexporter/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Carbon Exporter

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

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

The [Carbon](https://github.com/graphite-project/carbon) exporter supports
Carbon's [plaintext
Expand Down Expand Up @@ -37,8 +43,3 @@ exporters:

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
[observiq]: https://github.com/observIQ/observiq-otel-collector
[sumo]: https://github.com/SumoLogic/sumologic-otel-collector
6 changes: 4 additions & 2 deletions exporter/carbonexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/confmap/confmaptest"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter/internal/metadata"
)

func TestLoadConfig(t *testing.T) {
Expand All @@ -27,11 +29,11 @@ func TestLoadConfig(t *testing.T) {
}{

{
id: component.NewIDWithName(typeStr, ""),
id: component.NewIDWithName(metadata.Type, ""),
expected: createDefaultConfig(),
},
{
id: component.NewIDWithName(typeStr, "allsettings"),
id: component.NewIDWithName(metadata.Type, "allsettings"),
expected: &Config{
Endpoint: "localhost:8080",
Timeout: 10 * time.Second,
Expand Down
2 changes: 2 additions & 0 deletions exporter/carbonexporter/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

// Package carbonexporter implements an exporter that sends data to Carbon.
package carbonexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter"
11 changes: 3 additions & 8 deletions exporter/carbonexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@ import (

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

const (
// The value of "type" key in configuration.
typeStr = "carbon"
// The stability level of the exporter.
stability = component.StabilityLevelBeta
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter/internal/metadata"
)

// NewFactory creates a factory for Carbon exporter.
func NewFactory() exporter.Factory {
return exporter.NewFactory(
typeStr,
metadata.Type,
createDefaultConfig,
exporter.WithMetrics(createMetricsExporter, stability))
exporter.WithMetrics(createMetricsExporter, metadata.MetricsStability))
}

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

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