forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logfields.go
389 lines (267 loc) · 11 KB
/
logfields.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
// Copyright 2017-2018 Authors of Cilium
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package logfields defines common logging fields which are used across packages
package logfields
const (
// LogSubsys is the field denoting the subsystem when logging
LogSubsys = "subsys"
// Signal is the field to print os signals on exit etc.
Signal = "signal"
// Node is a host machine in the cluster, running cilium
Node = "node"
// NodeName is a human readable name for the node
NodeName = "nodeName"
// EndpointID is the numeric endpoint identifier
EndpointID = "endpointID"
// EndpointState is the current endpoint state
EndpointState = "endpointState"
// EventUUID is an event unique identifier
EventUUID = "eventID"
// ContainerID is the container identifier
ContainerID = "containerID"
// IdentityLabels are the labels relevant for the security identity
IdentityLabels = "identityLabels"
// InfoLabels are the labels relevant for the security identity
InfoLabels = "infoLabels"
// Labels are any label, they may not be relevant to the security identity.
Labels = "labels"
// Controller is the name of the controller to log it.
Controller = "controller"
// Identity is the identifier of a security identity
Identity = "identity"
// OldIdentity is a previously used security identity
OldIdentity = "oldIdentity"
// PolicyRevision is the revision of the policy in the repository or of
// the object in question
PolicyRevision = "policyRevision"
// DatapathPolicyRevision is the policy revision currently running in
// the datapath
DatapathPolicyRevision = "datapathPolicyRevision"
// DesiredPolicyRevision is the latest policy revision as evaluated for
// an endpoint. It is the desired policy revision to be implemented
// into the datapath.
DesiredPolicyRevision = "desiredPolicyRevision"
// PolicyID is the identifier of a L3, L4 or L7 Policy. Ideally the .NumericIdentity
PolicyID = "policyID"
// AddedPolicyID is the .NumericIdentity, or set or them
AddedPolicyID = "policyID.Added"
// DeletedPolicyID is the .NumericIdentity, or set or them
DeletedPolicyID = "policyID.Deleted"
// L3PolicyID is the identifier of a L3 Policy
L3PolicyID = "policyID.L3"
// L4PolicyID is the identifier of a L4 Policy
L4PolicyID = "PolicyID.L4"
// DNSName is a FQDN or not fully qualified name intended for DNS lookups
DNSName = "dnsName"
// DNSRequestID is the DNS request id used by dns-proxy
DNSRequestID = "DNSRequestID"
// IPAddr is an IPV4 or IPv6 address
IPAddr = "ipAddr"
// IPMask is an IPV4 or IPv6 address mask
IPMask = "ipMask"
// IPv4 is an IPv4 address
IPv4 = "ipv4"
// IPv6 is an IPv6 address
IPv6 = "ipv6"
// BuildDuration is the time elapsed to build a BPF program
BuildDuration = "buildDuration"
// BPFCompilationTime is the time elapsed to build a BPF endpoint program
BPFCompilationTime = "BPFCompilationTime"
// EndpointRegenerationTime is the time elapsed to generate an endpoint
EndpointRegenerationTime = "endpointRegenerationTime"
// StartTime is the start time of an event
StartTime = "startTime"
// EndTime is the end time of an event
EndTime = "endTime"
// Duration is the duration of a measured operation
Duration = "duration"
// V4HealthIP is an address used to contact the cilium-health endpoint
V4HealthIP = "v4healthIP.IPv4"
// V6HealthIP is an address used to contact the cilium-health endpoint
V6HealthIP = "v6healthIP.IPv6"
// V4CiliumHostIP is an address used for the cilium_host interface.
V4CiliumHostIP = "v4CiliumHostIP.IPv4"
// V6CiliumHostIP is an address used for the cilium_host interface.
V6CiliumHostIP = "v6CiliumHostIP.IPv6"
// L3n4Addr is a L3 (IP) + L4 (port and protocol) address object.
L3n4Addr = "l3n4Addr"
// L3n4AddrID is the allocated ID for a L3n4Addr object
L3n4AddrID = "l3n4AddrID"
// Port is a L4 port
Port = "port"
// Family is the L3 protocol family
Family = "family"
// Protocol is the L4 protocol
Protocol = "protocol"
// V4Prefix is a IPv4 subnet/CIDR prefix
V4Prefix = "v4Prefix"
// V6Prefix is a IPv6 subnet/CIDR prefix
V6Prefix = "v6Prefix"
// Interface is an interface id/name on the system
Interface = "interface"
// Ipvlan is a ipvlan object or ID
Ipvlan = "ipvlan"
// Veth is a veth object or ID
Veth = "veth"
// VethPair is a tuple of Veth that are paired
VethPair = "vethPair"
// NetNSName is a name of a network namespace
NetNSName = "netNSName"
// SHA is a sha of something
SHA = "sha"
// ServiceName is the orchestration framework name for a service
ServiceName = "serviceName"
// ServiceNamespace is the orchestration framework name for a service namespace.
ServiceNamespace = "serviceNamespace"
// ClusterName is the name of the cluster
ClusterName = "clusterName"
// ServiceID is the orchestration unique ID of a service
ServiceID = "serviceID"
// ServiceIP is the IP of the service
ServiceIP = "serviceIP"
// ServiceKey is the key of the service in a BPF map
ServiceKey = "svcKey"
// ServiceValue is the value of the service in a BPF map
ServiceValue = "svcVal"
// BackendIDs is the map of backend IDs (lbmap) indexed by backend address
BackendIDs = "backendIDs"
// BackendID is the ID of the backend
BackendID = "backendID"
// BackendName is the name of the backend
BackendName = "backendName"
// SlaveSlot is the slot number in a service BPF map
SlaveSlot = "slaveSlot"
// CiliumNetworkPolicy is a cilium specific NetworkPolicy
CiliumNetworkPolicy = "ciliumNetworkPolicy"
// CiliumNetworkPolicyName is the name of a CiliumNetworkPolicy
CiliumNetworkPolicyName = "ciliumNetworkPolicyName"
// BPFMapKey is a key from a BPF map
BPFMapKey = "bpfMapKey"
// BPFMapValue is a value from a BPF map
BPFMapValue = "bpfMapValue"
// XDPDevice is the device name
XDPDevice = "xdpDevice"
// Device is the device name
Device = "device"
// IpvlanMasterDevice is the ipvlan master device name
IpvlanMasterDevice = "ipvlanMasterDevice"
// DatapathMode is the datapath mode name
DatapathMode = "datapathMode"
// Tunnel is the tunnel name
Tunnel = "tunnel"
// Selector is a selector of any sort: endpoint, CIDR, toFQDNs
Selector = "Selector"
// EndpointLabelSelector is a selector for Endpoints by label
EndpointLabelSelector = "EndpointLabelSelector"
// EndpointSelector is a selector for Endpoints
EndpointSelector = "EndpointSelector"
// Path is a filesystem path. It can be a file or directory.
// Note: pkg/proxy/accesslog points to this variable so be careful when
// changing the value
Path = "file-path"
// Line is a line number within a file
Line = "line"
// Object is used when "%+v" printing Go objects for debug or error handling.
// It is often paired with logfields.Repr to render the object.
Object = "obj"
// Request is a request object received by us, reported in debug or error.
// It is often paired with logfields.Repr to render the object.
Request = "req"
// Params are the parameters of a request, reported in debug or error.
Params = "params"
// Response is a response object received by us, reported in debug or error.
// It is often paired with logfields.Repr to render the object.
Response = "resp"
// Route is a L2 or L3 Linux route
Route = "route"
// RetryUUID is an UUID identical for all retries of a set
RetryUUID = "retryUUID"
// Envoy xDS-protocol-specific
// XDSStreamID is the ID of an xDS request stream.
XDSStreamID = "xdsStreamID"
// XDSAckedVersion is the version of an xDS resource acked by Envoy.
XDSAckedVersion = "xdsAckedVersion"
// XDSCachedVersion is the version of an xDS resource currently in cache.
XDSCachedVersion = "xdsCachedVersion"
// XDSTypeURL is the URL that identifies an xDS resource type.
XDSTypeURL = "xdsTypeURL"
// XDSNonce is a nonce sent in xDS requests and responses.
XDSNonce = "xdsNonce"
// XDSCanary is a boolean indicating whether a response is a dry run.
XDSCanary = "xdsCanary"
// XDSResourceName is the name of an xDS resource.
XDSResourceName = "xdsResourceName"
// XDSClientNode is the ID of an XDS client, e.g. an Envoy node.
XDSClientNode = "xdsClientNode"
// XDSResource is an xDS resource message.
XDSResource = "xdsResource"
// XDSDetail is detail string included in XDS NACKs.
XDSDetail = "xdsDetail"
// K8s-specific
// K8sNodeID is the k8s ID of a K8sNode
K8sNodeID = "k8sNodeID"
// K8sPodName is the name of a k8s pod
K8sPodName = "k8sPodName"
// K8sSvcName is the name of a K8s service
K8sSvcName = "k8sSvcName"
// K8sSvcType is the k8s service type (e.g. NodePort, Loadbalancer etc.)
K8sSvcType = "k8sSvcType"
// K8sEndpointName is the k8s name for a k8s Endpoint (not a cilium Endpoint)
K8sEndpointName = "k8sEndpointName"
// K8sNamespace is the namespace something belongs to
K8sNamespace = "k8sNamespace"
// K8sIdentityAnnotation is a k8s non-identifying annotations on k8s objects
K8sIdentityAnnotation = "k8sIdentityAnnotation"
// K8sNetworkPolicy is a k8s NetworkPolicy object (not a CiliumNetworkObject, above).
K8sNetworkPolicy = "k8sNetworkPolicy"
// K8sNetworkPolicyName is the name of a K8sPolicyObject
K8sNetworkPolicyName = "k8sNetworkPolicyName"
// K8sIngress is a k8s Ingress service object
K8sIngress = "k8sIngress"
// K8sIngressName is the name of a K8sIngress
K8sIngressName = "k8sIngressName"
// K8sAPIVersion is the version of the k8s API an object has
K8sAPIVersion = "k8sApiVersion"
// Attempt is the attempt number if an operation is attempted multiple times
Attempt = "attempt"
// TrafficDirection represents the directionality of traffic with respect
// to an endpoint.
TrafficDirection = "trafficDirection"
// Modification represents a type of state change operation (insert, delete,
// upsert, etc.).
Modification = "modification"
// BPFMapName is the name of a BPF map.
BPFMapName = "bpfMapName"
// BPFHeaderHash is the hash of the BPF header.
BPFHeaderfileHash = "bpfHeaderfileHash"
// BPFMapPath is the path of a BPF map in the filesystem.
BPFMapPath = "bpfMapPath"
// BPFMapFD is the file descriptor for a BPF map.
BPFMapFD = "bpfMapFileDescriptor"
// ThreadID is the Envoy thread ID.
ThreadID = "threadID"
// Reason is a human readable string describing why an operation was
// performed
Reason = "reason"
// Debug is a boolean value for whether debug is set or not.
Debug = "debug"
// PID is an integer value for the process identifier of a process.
PID = "pid"
// PIDFile is a string value for the path to a file containing a PID.
PIDFile = "pidfile"
// Probe is the name of a status probe.
Probe = "probe"
// Key is the identity of the encryption key
Key = "key"
)