-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
Copy pathfunctions.go
24 lines (20 loc) · 1021 Bytes
/
functions.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
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package traces // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/traces"
import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspan"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspanevent"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs"
)
func SpanFunctions() map[string]ottl.Factory[ottlspan.TransformContext] {
// No trace-only functions yet.
m := ottlfuncs.StandardFuncs[ottlspan.TransformContext]()
isRootSpanFactory := ottlfuncs.NewIsRootSpanFactory()
m[isRootSpanFactory.Name()] = isRootSpanFactory
return m
}
func SpanEventFunctions() map[string]ottl.Factory[ottlspanevent.TransformContext] {
// No trace-only functions yet.
return ottlfuncs.StandardFuncs[ottlspanevent.TransformContext]()
}