summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecord.php
blob: caca11f87d1a738685b9de059927bbaf2d53804a (plain)
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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: opentelemetry/proto/logs/v1/logs.proto

namespace Opentelemetry\Proto\Logs\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A log record according to OpenTelemetry Log Data Model:
 * https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md
 *
 * Generated from protobuf message <code>opentelemetry.proto.logs.v1.LogRecord</code>
 */
class LogRecord extends \Google\Protobuf\Internal\Message
{
    /**
     * time_unix_nano is the time when the event occurred.
     * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     * Value of 0 indicates unknown or missing timestamp.
     *
     * Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
     */
    protected $time_unix_nano = 0;
    /**
     * Time when the event was observed by the collection system.
     * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
     * this timestamp is typically set at the generation time and is equal to Timestamp.
     * For events originating externally and collected by OpenTelemetry (e.g. using
     * Collector) this is the time when OpenTelemetry's code observed the event measured
     * by the clock of the OpenTelemetry code. This field MUST be set once the event is
     * observed by OpenTelemetry.
     * For converting OpenTelemetry log data to formats that support only one timestamp or
     * when receiving OpenTelemetry log data by recipients that support only one timestamp
     * internally the following logic is recommended:
     *   - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano.
     * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     * Value of 0 indicates unknown or missing timestamp.
     *
     * Generated from protobuf field <code>fixed64 observed_time_unix_nano = 11;</code>
     */
    protected $observed_time_unix_nano = 0;
    /**
     * Numerical value of the severity, normalized to values described in Log Data Model.
     * [Optional].
     *
     * Generated from protobuf field <code>.opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;</code>
     */
    protected $severity_number = 0;
    /**
     * The severity text (also known as log level). The original string representation as
     * it is known at the source. [Optional].
     *
     * Generated from protobuf field <code>string severity_text = 3;</code>
     */
    protected $severity_text = '';
    /**
     * A value containing the body of the log record. Can be for example a human-readable
     * string message (including multi-line) describing the event in a free form or it can
     * be a structured data composed of arrays and maps of other values. [Optional].
     *
     * Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue body = 5;</code>
     */
    protected $body = null;
    /**
     * Additional attributes that describe the specific event occurrence. [Optional].
     * Attribute keys MUST be unique (it is not allowed to have more than one
     * attribute with the same key).
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;</code>
     */
    private $attributes;
    /**
     * Generated from protobuf field <code>uint32 dropped_attributes_count = 7;</code>
     */
    protected $dropped_attributes_count = 0;
    /**
     * Flags, a bit field. 8 least significant bits are the trace flags as
     * defined in W3C Trace Context specification. 24 most significant bits are reserved
     * and must be set to 0. Readers must not assume that 24 most significant bits
     * will be zero and must correctly mask the bits when reading 8-bit trace flag (use
     * flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional].
     *
     * Generated from protobuf field <code>fixed32 flags = 8;</code>
     */
    protected $flags = 0;
    /**
     * A unique identifier for a trace. All logs from the same trace share
     * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR
     * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON
     * is zero-length and thus is also invalid).
     * This field is optional.
     * The receivers SHOULD assume that the log record is not associated with a
     * trace if any of the following is true:
     *   - the field is not present,
     *   - the field contains an invalid value.
     *
     * Generated from protobuf field <code>bytes trace_id = 9;</code>
     */
    protected $trace_id = '';
    /**
     * A unique identifier for a span within a trace, assigned when the span
     * is created. The ID is an 8-byte array. An ID with all zeroes OR of length
     * other than 8 bytes is considered invalid (empty string in OTLP/JSON
     * is zero-length and thus is also invalid).
     * This field is optional. If the sender specifies a valid span_id then it SHOULD also
     * specify a valid trace_id.
     * The receivers SHOULD assume that the log record is not associated with a
     * span if any of the following is true:
     *   - the field is not present,
     *   - the field contains an invalid value.
     *
     * Generated from protobuf field <code>bytes span_id = 10;</code>
     */
    protected $span_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $time_unix_nano
     *           time_unix_nano is the time when the event occurred.
     *           Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     *           Value of 0 indicates unknown or missing timestamp.
     *     @type int|string $observed_time_unix_nano
     *           Time when the event was observed by the collection system.
     *           For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
     *           this timestamp is typically set at the generation time and is equal to Timestamp.
     *           For events originating externally and collected by OpenTelemetry (e.g. using
     *           Collector) this is the time when OpenTelemetry's code observed the event measured
     *           by the clock of the OpenTelemetry code. This field MUST be set once the event is
     *           observed by OpenTelemetry.
     *           For converting OpenTelemetry log data to formats that support only one timestamp or
     *           when receiving OpenTelemetry log data by recipients that support only one timestamp
     *           internally the following logic is recommended:
     *             - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano.
     *           Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     *           Value of 0 indicates unknown or missing timestamp.
     *     @type int $severity_number
     *           Numerical value of the severity, normalized to values described in Log Data Model.
     *           [Optional].
     *     @type string $severity_text
     *           The severity text (also known as log level). The original string representation as
     *           it is known at the source. [Optional].
     *     @type \Opentelemetry\Proto\Common\V1\AnyValue $body
     *           A value containing the body of the log record. Can be for example a human-readable
     *           string message (including multi-line) describing the event in a free form or it can
     *           be a structured data composed of arrays and maps of other values. [Optional].
     *     @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes
     *           Additional attributes that describe the specific event occurrence. [Optional].
     *           Attribute keys MUST be unique (it is not allowed to have more than one
     *           attribute with the same key).
     *     @type int $dropped_attributes_count
     *     @type int $flags
     *           Flags, a bit field. 8 least significant bits are the trace flags as
     *           defined in W3C Trace Context specification. 24 most significant bits are reserved
     *           and must be set to 0. Readers must not assume that 24 most significant bits
     *           will be zero and must correctly mask the bits when reading 8-bit trace flag (use
     *           flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional].
     *     @type string $trace_id
     *           A unique identifier for a trace. All logs from the same trace share
     *           the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR
     *           of length other than 16 bytes is considered invalid (empty string in OTLP/JSON
     *           is zero-length and thus is also invalid).
     *           This field is optional.
     *           The receivers SHOULD assume that the log record is not associated with a
     *           trace if any of the following is true:
     *             - the field is not present,
     *             - the field contains an invalid value.
     *     @type string $span_id
     *           A unique identifier for a span within a trace, assigned when the span
     *           is created. The ID is an 8-byte array. An ID with all zeroes OR of length
     *           other than 8 bytes is considered invalid (empty string in OTLP/JSON
     *           is zero-length and thus is also invalid).
     *           This field is optional. If the sender specifies a valid span_id then it SHOULD also
     *           specify a valid trace_id.
     *           The receivers SHOULD assume that the log record is not associated with a
     *           span if any of the following is true:
     *             - the field is not present,
     *             - the field contains an invalid value.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce();
        parent::__construct($data);
    }

    /**
     * time_unix_nano is the time when the event occurred.
     * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     * Value of 0 indicates unknown or missing timestamp.
     *
     * Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
     * @return int|string
     */
    public function getTimeUnixNano()
    {
        return $this->time_unix_nano;
    }

    /**
     * time_unix_nano is the time when the event occurred.
     * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     * Value of 0 indicates unknown or missing timestamp.
     *
     * Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTimeUnixNano($var)
    {
        GPBUtil::checkUint64($var);
        $this->time_unix_nano = $var;

        return $this;
    }

    /**
     * Time when the event was observed by the collection system.
     * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
     * this timestamp is typically set at the generation time and is equal to Timestamp.
     * For events originating externally and collected by OpenTelemetry (e.g. using
     * Collector) this is the time when OpenTelemetry's code observed the event measured
     * by the clock of the OpenTelemetry code. This field MUST be set once the event is
     * observed by OpenTelemetry.
     * For converting OpenTelemetry log data to formats that support only one timestamp or
     * when receiving OpenTelemetry log data by recipients that support only one timestamp
     * internally the following logic is recommended:
     *   - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano.
     * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     * Value of 0 indicates unknown or missing timestamp.
     *
     * Generated from protobuf field <code>fixed64 observed_time_unix_nano = 11;</code>
     * @return int|string
     */
    public function getObservedTimeUnixNano()
    {
        return $this->observed_time_unix_nano;
    }

    /**
     * Time when the event was observed by the collection system.
     * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
     * this timestamp is typically set at the generation time and is equal to Timestamp.
     * For events originating externally and collected by OpenTelemetry (e.g. using
     * Collector) this is the time when OpenTelemetry's code observed the event measured
     * by the clock of the OpenTelemetry code. This field MUST be set once the event is
     * observed by OpenTelemetry.
     * For converting OpenTelemetry log data to formats that support only one timestamp or
     * when receiving OpenTelemetry log data by recipients that support only one timestamp
     * internally the following logic is recommended:
     *   - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano.
     * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
     * Value of 0 indicates unknown or missing timestamp.
     *
     * Generated from protobuf field <code>fixed64 observed_time_unix_nano = 11;</code>
     * @param int|string $var
     * @return $this
     */
    public function setObservedTimeUnixNano($var)
    {
        GPBUtil::checkUint64($var);
        $this->observed_time_unix_nano = $var;

        return $this;
    }

    /**
     * Numerical value of the severity, normalized to values described in Log Data Model.
     * [Optional].
     *
     * Generated from protobuf field <code>.opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;</code>
     * @return int
     */
    public function getSeverityNumber()
    {
        return $this->severity_number;
    }

    /**
     * Numerical value of the severity, normalized to values described in Log Data Model.
     * [Optional].
     *
     * Generated from protobuf field <code>.opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setSeverityNumber($var)
    {
        GPBUtil::checkEnum($var, \Opentelemetry\Proto\Logs\V1\SeverityNumber::class);
        $this->severity_number = $var;

        return $this;
    }

    /**
     * The severity text (also known as log level). The original string representation as
     * it is known at the source. [Optional].
     *
     * Generated from protobuf field <code>string severity_text = 3;</code>
     * @return string
     */
    public function getSeverityText()
    {
        return $this->severity_text;
    }

    /**
     * The severity text (also known as log level). The original string representation as
     * it is known at the source. [Optional].
     *
     * Generated from protobuf field <code>string severity_text = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setSeverityText($var)
    {
        GPBUtil::checkString($var, True);
        $this->severity_text = $var;

        return $this;
    }

    /**
     * A value containing the body of the log record. Can be for example a human-readable
     * string message (including multi-line) describing the event in a free form or it can
     * be a structured data composed of arrays and maps of other values. [Optional].
     *
     * Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue body = 5;</code>
     * @return \Opentelemetry\Proto\Common\V1\AnyValue|null
     */
    public function getBody()
    {
        return $this->body;
    }

    public function hasBody()
    {
        return isset($this->body);
    }

    public function clearBody()
    {
        unset($this->body);
    }

    /**
     * A value containing the body of the log record. Can be for example a human-readable
     * string message (including multi-line) describing the event in a free form or it can
     * be a structured data composed of arrays and maps of other values. [Optional].
     *
     * Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue body = 5;</code>
     * @param \Opentelemetry\Proto\Common\V1\AnyValue $var
     * @return $this
     */
    public function setBody($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\AnyValue::class);
        $this->body = $var;

        return $this;
    }

    /**
     * Additional attributes that describe the specific event occurrence. [Optional].
     * Attribute keys MUST be unique (it is not allowed to have more than one
     * attribute with the same key).
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     * Additional attributes that describe the specific event occurrence. [Optional].
     * Attribute keys MUST be unique (it is not allowed to have more than one
     * attribute with the same key).
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;</code>
     * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAttributes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class);
        $this->attributes = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint32 dropped_attributes_count = 7;</code>
     * @return int
     */
    public function getDroppedAttributesCount()
    {
        return $this->dropped_attributes_count;
    }

    /**
     * Generated from protobuf field <code>uint32 dropped_attributes_count = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setDroppedAttributesCount($var)
    {
        GPBUtil::checkUint32($var);
        $this->dropped_attributes_count = $var;

        return $this;
    }

    /**
     * Flags, a bit field. 8 least significant bits are the trace flags as
     * defined in W3C Trace Context specification. 24 most significant bits are reserved
     * and must be set to 0. Readers must not assume that 24 most significant bits
     * will be zero and must correctly mask the bits when reading 8-bit trace flag (use
     * flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional].
     *
     * Generated from protobuf field <code>fixed32 flags = 8;</code>
     * @return int
     */
    public function getFlags()
    {
        return $this->flags;
    }

    /**
     * Flags, a bit field. 8 least significant bits are the trace flags as
     * defined in W3C Trace Context specification. 24 most significant bits are reserved
     * and must be set to 0. Readers must not assume that 24 most significant bits
     * will be zero and must correctly mask the bits when reading 8-bit trace flag (use
     * flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional].
     *
     * Generated from protobuf field <code>fixed32 flags = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setFlags($var)
    {
        GPBUtil::checkUint32($var);
        $this->flags = $var;

        return $this;
    }

    /**
     * A unique identifier for a trace. All logs from the same trace share
     * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR
     * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON
     * is zero-length and thus is also invalid).
     * This field is optional.
     * The receivers SHOULD assume that the log record is not associated with a
     * trace if any of the following is true:
     *   - the field is not present,
     *   - the field contains an invalid value.
     *
     * Generated from protobuf field <code>bytes trace_id = 9;</code>
     * @return string
     */
    public function getTraceId()
    {
        return $this->trace_id;
    }

    /**
     * A unique identifier for a trace. All logs from the same trace share
     * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR
     * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON
     * is zero-length and thus is also invalid).
     * This field is optional.
     * The receivers SHOULD assume that the log record is not associated with a
     * trace if any of the following is true:
     *   - the field is not present,
     *   - the field contains an invalid value.
     *
     * Generated from protobuf field <code>bytes trace_id = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setTraceId($var)
    {
        GPBUtil::checkString($var, False);
        $this->trace_id = $var;

        return $this;
    }

    /**
     * A unique identifier for a span within a trace, assigned when the span
     * is created. The ID is an 8-byte array. An ID with all zeroes OR of length
     * other than 8 bytes is considered invalid (empty string in OTLP/JSON
     * is zero-length and thus is also invalid).
     * This field is optional. If the sender specifies a valid span_id then it SHOULD also
     * specify a valid trace_id.
     * The receivers SHOULD assume that the log record is not associated with a
     * span if any of the following is true:
     *   - the field is not present,
     *   - the field contains an invalid value.
     *
     * Generated from protobuf field <code>bytes span_id = 10;</code>
     * @return string
     */
    public function getSpanId()
    {
        return $this->span_id;
    }

    /**
     * A unique identifier for a span within a trace, assigned when the span
     * is created. The ID is an 8-byte array. An ID with all zeroes OR of length
     * other than 8 bytes is considered invalid (empty string in OTLP/JSON
     * is zero-length and thus is also invalid).
     * This field is optional. If the sender specifies a valid span_id then it SHOULD also
     * specify a valid trace_id.
     * The receivers SHOULD assume that the log record is not associated with a
     * span if any of the following is true:
     *   - the field is not present,
     *   - the field contains an invalid value.
     *
     * Generated from protobuf field <code>bytes span_id = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setSpanId($var)
    {
        GPBUtil::checkString($var, False);
        $this->span_id = $var;

        return $this;
    }

}