Skip to content

Commit

Permalink
[receiver/zookeeper] Migrate scraper to new experimental metrics buil…
Browse files Browse the repository at this point in the history
…der (#6522)
  • Loading branch information
dmitryax authored Dec 10, 2021
1 parent 420ed6a commit 0a4d966
Show file tree
Hide file tree
Showing 9 changed files with 916 additions and 399 deletions.
2 changes: 1 addition & 1 deletion receiver/zookeeperreceiver/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
//go:build !windows
// +build !windows

//go:generate mdatagen metadata.yaml
//go:generate mdatagen --experimental-gen metadata.yaml

package zookeeperreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zookeeperreceiver"
3 changes: 3 additions & 0 deletions receiver/zookeeperreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ import (

"go.opentelemetry.io/collector/config/confignet"
"go.opentelemetry.io/collector/receiver/scraperhelper"

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

type Config struct {
scraperhelper.ScraperControllerSettings `mapstructure:",squash"`
confignet.TCPAddr `mapstructure:",squash"`
Metrics metadata.MetricsSettings `mapstructure:"metrics"`

// Timeout within which requests should be completed.
Timeout time.Duration `mapstructure:"timeout"`
Expand Down
3 changes: 3 additions & 0 deletions receiver/zookeeperreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/receiver/receiverhelper"
"go.opentelemetry.io/collector/receiver/scraperhelper"

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

const (
Expand Down Expand Up @@ -51,6 +53,7 @@ func createDefaultConfig() config.Receiver {
Endpoint: ":2181",
},
Timeout: defaultTimeout,
Metrics: metadata.DefaultMetricsSettings(),
}
}

Expand Down
304 changes: 0 additions & 304 deletions receiver/zookeeperreceiver/internal/metadata/generated_metrics.go

This file was deleted.

Loading

0 comments on commit 0a4d966

Please sign in to comment.