-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfactory.go
32 lines (28 loc) · 795 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
package opentelemetry_stacktrace_processor // import "github.com/joostlek/opentelemetry-stacktrace-processor"
import (
"context"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
)
const typeStr = "stacktrace"
func NewFactory() processor.Factory {
return processor.NewFactory(
typeStr,
createDefaultConfig,
processor.WithTraces(createTraces, component.StabilityLevelStable),
)
}
func createDefaultConfig() component.Config {
return &Config{
SourceMapDirs: make([]string, 0),
}
}
func createTraces(
_ context.Context,
set processor.CreateSettings,
cfg component.Config,
nextConsumer consumer.Traces,
) (processor.Traces, error) {
return newStackTraceProcessor(set, nextConsumer, cfg.(*Config))
}