-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactory.go
More file actions
37 lines (32 loc) · 918 Bytes
/
Copy pathfactory.go
File metadata and controls
37 lines (32 loc) · 918 Bytes
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
package sqlparamstyleprocessor
import (
"context"
"fmt"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
)
var (
typeStr = component.MustNewType("sqlparamstyle") // pipeline key: sqlparamstyle
stability = component.StabilityLevelAlpha
)
// NewFactory creates a factory for the sqlparamstyle processor (PEP 249 paramstyle normalization).
func NewFactory() processor.Factory {
return processor.NewFactory(
typeStr,
defaultConfig,
processor.WithTraces(createTracesProcessor, stability),
)
}
func createTracesProcessor(
ctx context.Context,
params processor.Settings,
cfg component.Config,
nextConsumer consumer.Traces,
) (processor.Traces, error) {
processorCfg, ok := cfg.(*Config)
if !ok {
return nil, fmt.Errorf("invalid config type: %T", cfg)
}
return newTracesProcessor(processorCfg, params, nextConsumer)
}