1
1
// Copyright The OpenTelemetry Authors
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
- package attribute // import "go.opentelemetry.io/collector/service/internal/graph/ attribute"
4
+ package attribute // import "go.opentelemetry.io/collector/service/internal/attribute"
5
5
6
6
import (
7
- "fmt"
8
7
"hash/fnv"
9
8
10
9
"go.opentelemetry.io/otel/attribute"
@@ -20,10 +19,6 @@ const (
20
19
signalKey = "otelcol.signal"
21
20
signalOutputKey = "otelcol.signal.output"
22
21
23
- receiverKind = "receiver"
24
- processorKind = "processor"
25
- exporterKind = "exporter"
26
- connectorKind = "connector"
27
22
capabiltiesKind = "capabilities"
28
23
fanoutKind = "fanout"
29
24
)
@@ -54,15 +49,22 @@ func (a Attributes) ID() int64 {
54
49
55
50
func Receiver (pipelineType pipeline.Signal , id component.ID ) * Attributes {
56
51
return newAttributes (
57
- attribute .String (componentKindKey , receiverKind ),
52
+ attribute .String (componentKindKey , component . KindReceiver . String () ),
58
53
attribute .String (signalKey , pipelineType .String ()),
59
54
attribute .String (componentIDKey , id .String ()),
60
55
)
61
56
}
62
57
58
+ func ReceiverSingleton (id component.ID ) * Attributes {
59
+ return newAttributes (
60
+ attribute .String (componentKindKey , component .KindReceiver .String ()),
61
+ attribute .String (componentIDKey , id .String ()),
62
+ )
63
+ }
64
+
63
65
func Processor (pipelineID pipeline.ID , id component.ID ) * Attributes {
64
66
return newAttributes (
65
- attribute .String (componentKindKey , processorKind ),
67
+ attribute .String (componentKindKey , component . KindProcessor . String () ),
66
68
attribute .String (signalKey , pipelineID .Signal ().String ()),
67
69
attribute .String (pipelineIDKey , pipelineID .String ()),
68
70
attribute .String (componentIDKey , id .String ()),
@@ -71,16 +73,24 @@ func Processor(pipelineID pipeline.ID, id component.ID) *Attributes {
71
73
72
74
func Exporter (pipelineType pipeline.Signal , id component.ID ) * Attributes {
73
75
return newAttributes (
74
- attribute .String (componentKindKey , exporterKind ),
76
+ attribute .String (componentKindKey , component . KindExporter . String () ),
75
77
attribute .String (signalKey , pipelineType .String ()),
76
78
attribute .String (componentIDKey , id .String ()),
77
79
)
78
80
}
79
81
82
+ func ExporterSingleton (id component.ID ) * Attributes {
83
+ return newAttributes (
84
+ attribute .String (componentKindKey , component .KindExporter .String ()),
85
+ attribute .String (componentIDKey , id .String ()),
86
+ )
87
+ }
88
+
80
89
func Connector (exprPipelineType , rcvrPipelineType pipeline.Signal , id component.ID ) * Attributes {
81
90
return newAttributes (
82
- attribute .String (componentKindKey , connectorKind ),
83
- attribute .String (signalKey , fmt .Sprintf ("%s_to_%s" , exprPipelineType .String (), rcvrPipelineType .String ())),
91
+ attribute .String (componentKindKey , component .KindConnector .String ()),
92
+ attribute .String (signalKey , exprPipelineType .String ()),
93
+ attribute .String (signalOutputKey , rcvrPipelineType .String ()),
84
94
attribute .String (componentIDKey , id .String ()),
85
95
)
86
96
}
@@ -98,3 +108,10 @@ func Fanout(pipelineID pipeline.ID) *Attributes {
98
108
attribute .String (pipelineIDKey , pipelineID .String ()),
99
109
)
100
110
}
111
+
112
+ func Extension (id component.ID ) * Attributes {
113
+ return newAttributes (
114
+ attribute .String (componentKindKey , component .KindExtension .String ()),
115
+ attribute .String (componentIDKey , id .String ()),
116
+ )
117
+ }
0 commit comments