Skip to content

Commit

Permalink
chore: generate metadata package for metricsprocessor (#10)
Browse files Browse the repository at this point in the history
* chore: generate metadata package

using the mdatagen collector's tool

* chore: bump opentelemetry-lib version to v0.1.0

* chore: tidy go.sum
  • Loading branch information
rogercoll authored Jun 11, 2024
1 parent ac542d3 commit f633660
Show file tree
Hide file tree
Showing 9 changed files with 271 additions and 179 deletions.
5 changes: 3 additions & 2 deletions processor/elasticinframetricsprocessor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"path/filepath"
"testing"

"github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor/internal/metadata"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
Expand All @@ -18,12 +19,12 @@ func TestLoadConfig(t *testing.T) {
}{
{
configPath: "config.yaml",
id: component.NewIDWithName("elasticinframetricsprocessor", "default"),
id: component.NewIDWithName(metadata.Type, "default"),
expected: &Config{AddSystemMetrics: true},
},
{
configPath: "config.yaml",
id: component.NewIDWithName("elasticinframetricsprocessor", "with_system_metrics"),
id: component.NewIDWithName(metadata.Type, "with_system_metrics"),
expected: &Config{AddSystemMetrics: true},
},
}
Expand Down
3 changes: 3 additions & 0 deletions processor/elasticinframetricsprocessor/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//go:generate mdatagen metadata.yaml

package elasticinframetricsprocessor // import "github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor"
9 changes: 3 additions & 6 deletions processor/elasticinframetricsprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@ package elasticinframetricsprocessor // import "github.com/elastic/opentelemetry
import (
"context"

"github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor/internal/metadata"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processorhelper"
)

const (
typeStr = "elasticinframetrics"
)

var processorCapabilities = consumer.Capabilities{MutatesData: true}

// NewFactory returns a new factory for the Filter processor.
func NewFactory() processor.Factory {
return processor.NewFactory(
typeStr,
metadata.Type,
createDefaultConfig,
processor.WithMetrics(createMetricsProcessor, component.StabilityLevelAlpha),
processor.WithMetrics(createMetricsProcessor, metadata.MetricsStability),
)
}

Expand Down
135 changes: 135 additions & 0 deletions processor/elasticinframetricsprocessor/generated_component_test.go

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

12 changes: 12 additions & 0 deletions processor/elasticinframetricsprocessor/generated_package_test.go

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

55 changes: 33 additions & 22 deletions processor/elasticinframetricsprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,54 @@ module github.com/elastic/opentelemetry-collector-components/processor/elasticin
go 1.21.1

require (
github.com/elastic/opentelemetry-lib v0.0.0-20240604140721-08863a456d6c
github.com/elastic/opentelemetry-lib v0.1.0
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector/component v0.92.0
go.opentelemetry.io/collector/confmap v0.92.0
go.opentelemetry.io/collector/consumer v0.92.0
go.opentelemetry.io/collector/pdata v1.7.0
go.opentelemetry.io/collector/processor v0.92.0
go.opentelemetry.io/collector/component v0.102.1
go.opentelemetry.io/collector/confmap v0.102.1
go.opentelemetry.io/collector/consumer v0.102.1
go.opentelemetry.io/collector/pdata v1.9.0
go.opentelemetry.io/collector/processor v0.102.1
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
github.com/knadh/koanf/v2 v2.0.1 // indirect
github.com/knadh/koanf/v2 v2.1.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector v0.92.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.92.0 // indirect
go.opentelemetry.io/collector/featuregate v1.0.1 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.15.0 // indirect
go.opentelemetry.io/collector v0.102.1 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect
go.opentelemetry.io/collector/pdata/testdata v0.102.1 // indirect
go.opentelemetry.io/otel v1.27.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.opentelemetry.io/otel/sdk v1.27.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.27.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.34.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit f633660

Please sign in to comment.