Skip to content

Commit

Permalink
Privatize collector struct
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed Sep 13, 2022
1 parent b9592fa commit 1087b80
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions exporters/prometheus/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ type Exporter struct {
Collector prometheus.Collector
}

// Collector is used to implement prometheus.Collector.
type Collector struct {
// collector is used to implement prometheus.Collector.
type collector struct {
metric.Reader
}

Expand All @@ -57,15 +57,15 @@ func NewExporter(options ...Option) Exporter {
reader := metric.NewManualReader()
e := Exporter{
Reader: reader,
Collector: &Collector{
Collector: &collector{
Reader: reader,
},
}
return e
}

// Describe implements prometheus.Collector.
func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
func (c *collector) Describe(ch chan<- *prometheus.Desc) {
metrics, err := c.Reader.Collect(context.TODO())
if err != nil {
otel.Handle(err)
Expand All @@ -76,7 +76,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
}

// Collect implements prometheus.Collector.
func (c *Collector) Collect(ch chan<- prometheus.Metric) {
func (c *collector) Collect(ch chan<- prometheus.Metric) {
metrics, err := c.Reader.Collect(context.TODO())
if err != nil {
otel.Handle(err)
Expand Down

0 comments on commit 1087b80

Please sign in to comment.