-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
factory.go
40 lines (32 loc) · 875 Bytes
/
factory.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 (c) 2024 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0
package storagecleaner
import (
"context"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/extension"
)
// componentType is the name of this extension in configuration.
var componentType = component.MustNewType("storage_cleaner")
// ID is the identifier of this extension.
var ID = component.NewID(componentType)
func NewFactory() extension.Factory {
return extension.NewFactory(
componentType,
createDefaultConfig,
createExtension,
component.StabilityLevelBeta,
)
}
func createDefaultConfig() component.Config {
return &Config{
Port: Port,
}
}
func createExtension(
_ context.Context,
set extension.CreateSettings,
cfg component.Config,
) (extension.Extension, error) {
return newStorageCleaner(cfg.(*Config), set.TelemetrySettings), nil
}