Debian Codegraph @

semconv/v1.23.1/event.go

raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 // Code generated from semantic convention specification. DO NOT EDIT.
5
6 package semconv // import "go.opentelemetry.io/otel/semconv/v1.23.1"
7
8 import "go.opentelemetry.io/otel/attribute"
9
10 // This event represents an occurrence of a lifecycle transition on the iOS
11 // platform. `event.domain` MUST be `device`.
12 const (
13 // IosStateKey is the attribute Key conforming to the "ios.state" semantic
14 // conventions. It represents the this attribute represents the state the
15 // application has transitioned into at the occurrence of the event.
16 //
17 // Type: Enum
18 // RequirementLevel: Required
19 // Stability: experimental
20 // Note: The iOS lifecycle states are defined in the [UIApplicationDelegate
21 // documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902),
22 // and from which the `OS terminology` column values are derived.
23 IosStateKey = attribute.Key("ios.state")
24 )
25
26 var (
27 // The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`
28 IosStateActive = IosStateKey.String("active")
29 // The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`
30 IosStateInactive = IosStateKey.String("inactive")
31 // The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`
32 IosStateBackground = IosStateKey.String("background")
33 // The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`
34 IosStateForeground = IosStateKey.String("foreground")
35 // The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`
36 IosStateTerminate = IosStateKey.String("terminate")
37 )
38
39 // This event represents an occurrence of a lifecycle transition on the Android
40 // platform. `event.domain` MUST be `device`.
41 const (
42 // AndroidStateKey is the attribute Key conforming to the "android.state"
43 // semantic conventions. It represents the this attribute represents the
44 // state the application has transitioned into at the occurrence of the
45 // event.
46 //
47 // Type: Enum
48 // RequirementLevel: Required
49 // Stability: experimental
50 // Note: The Android lifecycle states are defined in [Activity lifecycle
51 // callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc),
52 // and from which the `OS identifiers` are derived.
53 AndroidStateKey = attribute.Key("android.state")
54 )
55
56 var (
57 // Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time
58 AndroidStateCreated = AndroidStateKey.String("created")
59 // Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state
60 AndroidStateBackground = AndroidStateKey.String("background")
61 // Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states
62 AndroidStateForeground = AndroidStateKey.String("foreground")
63 )
64
65 // This semantic convention defines the attributes used to represent a feature
66 // flag evaluation as an event.
67 const (
68 // FeatureFlagKeyKey is the attribute Key conforming to the
69 // "feature_flag.key" semantic conventions. It represents the unique
70 // identifier of the feature flag.
71 //
72 // Type: string
73 // RequirementLevel: Required
74 // Stability: experimental
75 // Examples: 'logo-color'
76 FeatureFlagKeyKey = attribute.Key("feature_flag.key")
77
78 // FeatureFlagProviderNameKey is the attribute Key conforming to the
79 // "feature_flag.provider_name" semantic conventions. It represents the
80 // name of the service provider that performs the flag evaluation.
81 //
82 // Type: string
83 // RequirementLevel: Recommended
84 // Stability: experimental
85 // Examples: 'Flag Manager'
86 FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name")
87
88 // FeatureFlagVariantKey is the attribute Key conforming to the
89 // "feature_flag.variant" semantic conventions. It represents the sHOULD be
90 // a semantic identifier for a value. If one is unavailable, a stringified
91 // version of the value can be used.
92 //
93 // Type: string
94 // RequirementLevel: Recommended
95 // Stability: experimental
96 // Examples: 'red', 'true', 'on'
97 // Note: A semantic identifier, commonly referred to as a variant, provides
98 // a means
99 // for referring to a value without including the value itself. This can
100 // provide additional context for understanding the meaning behind a value.
101 // For example, the variant `red` maybe be used for the value `#c05543`.
102 //
103 // A stringified version of the value can be used in situations where a
104 // semantic identifier is unavailable. String representation of the value
105 // should be determined by the implementer.
106 FeatureFlagVariantKey = attribute.Key("feature_flag.variant")
107 )
108
109 // FeatureFlagKey returns an attribute KeyValue conforming to the
110 // "feature_flag.key" semantic conventions. It represents the unique identifier
111 // of the feature flag.
112 func FeatureFlagKey(val string) attribute.KeyValue {
113 return FeatureFlagKeyKey.String(val)
114 }
115
116 // FeatureFlagProviderName returns an attribute KeyValue conforming to the
117 // "feature_flag.provider_name" semantic conventions. It represents the name of
118 // the service provider that performs the flag evaluation.
119 func FeatureFlagProviderName(val string) attribute.KeyValue {
120 return FeatureFlagProviderNameKey.String(val)
121 }
122
123 // FeatureFlagVariant returns an attribute KeyValue conforming to the
124 // "feature_flag.variant" semantic conventions. It represents the sHOULD be a
125 // semantic identifier for a value. If one is unavailable, a stringified
126 // version of the value can be used.
127 func FeatureFlagVariant(val string) attribute.KeyValue {
128 return FeatureFlagVariantKey.String(val)
129 }
130
131 // RPC received/sent message.
132 const (
133 // MessageCompressedSizeKey is the attribute Key conforming to the
134 // "message.compressed_size" semantic conventions. It represents the
135 // compressed size of the message in bytes.
136 //
137 // Type: int
138 // RequirementLevel: Optional
139 // Stability: experimental
140 MessageCompressedSizeKey = attribute.Key("message.compressed_size")
141
142 // MessageIDKey is the attribute Key conforming to the "message.id"
143 // semantic conventions. It represents the mUST be calculated as two
144 // different counters starting from `1` one for sent messages and one for
145 // received message.
146 //
147 // Type: int
148 // RequirementLevel: Optional
149 // Stability: experimental
150 // Note: This way we guarantee that the values will be consistent between
151 // different implementations.
152 MessageIDKey = attribute.Key("message.id")
153
154 // MessageTypeKey is the attribute Key conforming to the "message.type"
155 // semantic conventions. It represents the whether this is a received or
156 // sent message.
157 //
158 // Type: Enum
159 // RequirementLevel: Optional
160 // Stability: experimental
161 MessageTypeKey = attribute.Key("message.type")
162
163 // MessageUncompressedSizeKey is the attribute Key conforming to the
164 // "message.uncompressed_size" semantic conventions. It represents the
165 // uncompressed size of the message in bytes.
166 //
167 // Type: int
168 // RequirementLevel: Optional
169 // Stability: experimental
170 MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
171 )
172
173 var (
174 // sent
175 MessageTypeSent = MessageTypeKey.String("SENT")
176 // received
177 MessageTypeReceived = MessageTypeKey.String("RECEIVED")
178 )
179
180 // MessageCompressedSize returns an attribute KeyValue conforming to the
181 // "message.compressed_size" semantic conventions. It represents the compressed
182 // size of the message in bytes.
183 func MessageCompressedSize(val int) attribute.KeyValue {
184 return MessageCompressedSizeKey.Int(val)
185 }
186
187 // MessageID returns an attribute KeyValue conforming to the "message.id"
188 // semantic conventions. It represents the mUST be calculated as two different
189 // counters starting from `1` one for sent messages and one for received
190 // message.
191 func MessageID(val int) attribute.KeyValue {
192 return MessageIDKey.Int(val)
193 }
194
195 // MessageUncompressedSize returns an attribute KeyValue conforming to the
196 // "message.uncompressed_size" semantic conventions. It represents the
197 // uncompressed size of the message in bytes.
198 func MessageUncompressedSize(val int) attribute.KeyValue {
199 return MessageUncompressedSizeKey.Int(val)
200 }
201
202 // The attributes used to report a single exception associated with a span.
203 const (
204 // ExceptionEscapedKey is the attribute Key conforming to the
205 // "exception.escaped" semantic conventions. It represents the sHOULD be
206 // set to true if the exception event is recorded at a point where it is
207 // known that the exception is escaping the scope of the span.
208 //
209 // Type: boolean
210 // RequirementLevel: Optional
211 // Stability: experimental
212 // Note: An exception is considered to have escaped (or left) the scope of
213 // a span,
214 // if that span is ended while the exception is still logically "in
215 // flight".
216 // This may be actually "in flight" in some languages (e.g. if the
217 // exception
218 // is passed to a Context manager's `__exit__` method in Python) but will
219 // usually be caught at the point of recording the exception in most
220 // languages.
221 //
222 // It is usually not possible to determine at the point where an exception
223 // is thrown
224 // whether it will escape the scope of a span.
225 // However, it is trivial to know that an exception
226 // will escape, if one checks for an active exception just before ending
227 // the span,
228 // as done in the [example above](#recording-an-exception).
229 //
230 // It follows that an exception may still escape the scope of the span
231 // even if the `exception.escaped` attribute was not set or set to false,
232 // since the event might have been recorded at a time where it was not
233 // clear whether the exception will escape.
234 ExceptionEscapedKey = attribute.Key("exception.escaped")
235 )
236
237 // ExceptionEscaped returns an attribute KeyValue conforming to the
238 // "exception.escaped" semantic conventions. It represents the sHOULD be set to
239 // true if the exception event is recorded at a point where it is known that
240 // the exception is escaping the scope of the span.
241 func ExceptionEscaped(val bool) attribute.KeyValue {
242 return ExceptionEscapedKey.Bool(val)
243 }