-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
factory_windows.go
40 lines (32 loc) · 1.08 KB
/
factory_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
//go:build windows
package iisreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/iisreceiver"
import (
"context"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/collector/receiver/scraperhelper"
"go.opentelemetry.io/collector/scraper"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/iisreceiver/internal/metadata"
)
func createMetricsReceiver(
_ context.Context,
params receiver.Settings,
rConf component.Config,
nextConsumer consumer.Metrics,
) (receiver.Metrics, error) {
cfg := rConf.(*Config)
rcvr := newIisReceiver(params, cfg, nextConsumer)
s, err := scraper.NewMetrics(rcvr.scrape,
scraper.WithStart(rcvr.start),
scraper.WithShutdown(rcvr.shutdown))
if err != nil {
return nil, err
}
return scraperhelper.NewScraperControllerReceiver(
&cfg.ControllerConfig, params, nextConsumer,
scraperhelper.AddScraper(metadata.Type, s),
)
}