-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
factory.go
35 lines (27 loc) · 910 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
// Copyright (c) 2023 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0
package jaegerstorage
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("jaeger_storage")
// 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{}
}
// createExtension creates the extension based on this config.
func createExtension(_ context.Context, set extension.CreateSettings, cfg component.Config) (extension.Extension, error) {
return newStorageExt(cfg.(*Config), set.TelemetrySettings), nil
}