Skip to content

Commit 286810d

Browse files
bogdandrutuyurishkurotigrannajaryan
authored
Clarify what empty instrumentation name means, and missing instrumentation library (#245)
* Clarify what empty instrumentation name means, and missing instrumentation library Signed-off-by: Bogdan Drutu <[email protected]> * Update opentelemetry/proto/logs/v1/logs.proto Co-authored-by: Yuri Shkuro <[email protected]> * Update opentelemetry/proto/logs/v1/logs.proto Co-authored-by: Yuri Shkuro <[email protected]> * Update opentelemetry/proto/logs/v1/logs.proto Co-authored-by: Yuri Shkuro <[email protected]> * Update opentelemetry/proto/common/v1/common.proto Co-authored-by: Tigran Najaryan <[email protected]> * Update common.proto Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Tigran Najaryan <[email protected]>
1 parent d0e9c0c commit 286810d

File tree

4 files changed

+89
-85
lines changed

4 files changed

+89
-85
lines changed

opentelemetry/proto/common/v1/common.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ message StringKeyValue {
7272
// InstrumentationLibrary is a message representing the instrumentation library information
7373
// such as the fully qualified name and version.
7474
message InstrumentationLibrary {
75+
// An empty instrumentation library name means the name is unknown.
7576
string name = 1;
7677
string version = 2;
7778
}

opentelemetry/proto/logs/v1/logs.proto

Lines changed: 84 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -26,106 +26,107 @@ option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/logs/v
2626

2727
// A collection of InstrumentationLibraryLogs from a Resource.
2828
message ResourceLogs {
29-
// The resource for the logs in this message.
30-
// If this field is not set then no resource info is known.
31-
opentelemetry.proto.resource.v1.Resource resource = 1;
29+
// The resource for the logs in this message.
30+
// If this field is not set then resource info is unknown.
31+
opentelemetry.proto.resource.v1.Resource resource = 1;
3232

33-
// A list of InstrumentationLibraryLogs that originate from a resource.
34-
repeated InstrumentationLibraryLogs instrumentation_library_logs = 2;
33+
// A list of InstrumentationLibraryLogs that originate from a resource.
34+
repeated InstrumentationLibraryLogs instrumentation_library_logs = 2;
3535
}
3636

3737
// A collection of Logs produced by an InstrumentationLibrary.
3838
message InstrumentationLibraryLogs {
39-
// The instrumentation library information for the logs in this message.
40-
// If this field is not set then no library info is known.
41-
opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;
39+
// The instrumentation library information for the logs in this message.
40+
// Semantically when InstrumentationLibrary isn't set, it is equivalent with
41+
// an empty instrumentation library name (unknown).
42+
opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;
4243

43-
// A list of log records.
44-
repeated LogRecord logs = 2;
44+
// A list of log records.
45+
repeated LogRecord logs = 2;
4546
}
4647

4748
// Possible values for LogRecord.SeverityNumber.
4849
enum SeverityNumber {
49-
// UNSPECIFIED is the default SeverityNumber, it MUST not be used.
50-
SEVERITY_NUMBER_UNSPECIFIED = 0;
51-
SEVERITY_NUMBER_TRACE = 1;
52-
SEVERITY_NUMBER_TRACE2 = 2;
53-
SEVERITY_NUMBER_TRACE3 = 3;
54-
SEVERITY_NUMBER_TRACE4 = 4;
55-
SEVERITY_NUMBER_DEBUG = 5;
56-
SEVERITY_NUMBER_DEBUG2 = 6;
57-
SEVERITY_NUMBER_DEBUG3 = 7;
58-
SEVERITY_NUMBER_DEBUG4 = 8;
59-
SEVERITY_NUMBER_INFO = 9;
60-
SEVERITY_NUMBER_INFO2 = 10;
61-
SEVERITY_NUMBER_INFO3 = 11;
62-
SEVERITY_NUMBER_INFO4 = 12;
63-
SEVERITY_NUMBER_WARN = 13;
64-
SEVERITY_NUMBER_WARN2 = 14;
65-
SEVERITY_NUMBER_WARN3 = 15;
66-
SEVERITY_NUMBER_WARN4 = 16;
67-
SEVERITY_NUMBER_ERROR = 17;
68-
SEVERITY_NUMBER_ERROR2 = 18;
69-
SEVERITY_NUMBER_ERROR3 = 19;
70-
SEVERITY_NUMBER_ERROR4 = 20;
71-
SEVERITY_NUMBER_FATAL = 21;
72-
SEVERITY_NUMBER_FATAL2 = 22;
73-
SEVERITY_NUMBER_FATAL3 = 23;
74-
SEVERITY_NUMBER_FATAL4 = 24;
50+
// UNSPECIFIED is the default SeverityNumber, it MUST NOT be used.
51+
SEVERITY_NUMBER_UNSPECIFIED = 0;
52+
SEVERITY_NUMBER_TRACE = 1;
53+
SEVERITY_NUMBER_TRACE2 = 2;
54+
SEVERITY_NUMBER_TRACE3 = 3;
55+
SEVERITY_NUMBER_TRACE4 = 4;
56+
SEVERITY_NUMBER_DEBUG = 5;
57+
SEVERITY_NUMBER_DEBUG2 = 6;
58+
SEVERITY_NUMBER_DEBUG3 = 7;
59+
SEVERITY_NUMBER_DEBUG4 = 8;
60+
SEVERITY_NUMBER_INFO = 9;
61+
SEVERITY_NUMBER_INFO2 = 10;
62+
SEVERITY_NUMBER_INFO3 = 11;
63+
SEVERITY_NUMBER_INFO4 = 12;
64+
SEVERITY_NUMBER_WARN = 13;
65+
SEVERITY_NUMBER_WARN2 = 14;
66+
SEVERITY_NUMBER_WARN3 = 15;
67+
SEVERITY_NUMBER_WARN4 = 16;
68+
SEVERITY_NUMBER_ERROR = 17;
69+
SEVERITY_NUMBER_ERROR2 = 18;
70+
SEVERITY_NUMBER_ERROR3 = 19;
71+
SEVERITY_NUMBER_ERROR4 = 20;
72+
SEVERITY_NUMBER_FATAL = 21;
73+
SEVERITY_NUMBER_FATAL2 = 22;
74+
SEVERITY_NUMBER_FATAL3 = 23;
75+
SEVERITY_NUMBER_FATAL4 = 24;
7576
}
7677

7778
// Masks for LogRecord.flags field.
7879
enum LogRecordFlags {
79-
LOG_RECORD_FLAG_UNSPECIFIED = 0;
80-
LOG_RECORD_FLAG_TRACE_FLAGS_MASK = 0x000000FF;
80+
LOG_RECORD_FLAG_UNSPECIFIED = 0;
81+
LOG_RECORD_FLAG_TRACE_FLAGS_MASK = 0x000000FF;
8182
}
8283

8384
// A log record according to OpenTelemetry Log Data Model:
8485
// https://github.com/open-telemetry/oteps/blob/master/text/logs/0097-log-data-model.md
8586
message LogRecord {
86-
// time_unix_nano is the time when the event occurred.
87-
// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
88-
// Value of 0 indicates unknown or missing timestamp.
89-
fixed64 time_unix_nano = 1;
90-
91-
// Numerical value of the severity, normalized to values described in Log Data Model.
92-
// [Optional].
93-
SeverityNumber severity_number = 2;
94-
95-
// The severity text (also known as log level). The original string representation as
96-
// it is known at the source. [Optional].
97-
string severity_text = 3;
98-
99-
// Short event identifier that does not contain varying parts. Name describes
100-
// what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
101-
// characters. Not guaranteed to be unique in any way. [Optional].
102-
string name = 4;
103-
104-
// A value containing the body of the log record. Can be for example a human-readable
105-
// string message (including multi-line) describing the event in a free form or it can
106-
// be a structured data composed of arrays and maps of other values. [Optional].
107-
opentelemetry.proto.common.v1.AnyValue body = 5;
108-
109-
// Additional attributes that describe the specific event occurrence. [Optional].
110-
repeated opentelemetry.proto.common.v1.KeyValue attributes = 6;
111-
uint32 dropped_attributes_count = 7;
112-
113-
// Flags, a bit field. 8 least significant bits are the trace flags as
114-
// defined in W3C Trace Context specification. 24 most significant bits are reserved
115-
// and must be set to 0. Readers must not assume that 24 most significant bits
116-
// will be zero and must correctly mask the bits when reading 8-bit trace flag (use
117-
// flags & TRACE_FLAGS_MASK). [Optional].
118-
fixed32 flags = 8;
119-
120-
// A unique identifier for a trace. All logs from the same trace share
121-
// the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
122-
// is considered invalid. Can be set for logs that are part of request processing
123-
// and have an assigned trace id. [Optional].
124-
bytes trace_id = 9;
125-
126-
// A unique identifier for a span within a trace, assigned when the span
127-
// is created. The ID is an 8-byte array. An ID with all zeroes is considered
128-
// invalid. Can be set for logs that are part of a particular processing span.
129-
// If span_id is present trace_id SHOULD be also present. [Optional].
130-
bytes span_id = 10;
87+
// time_unix_nano is the time when the event occurred.
88+
// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
89+
// Value of 0 indicates unknown or missing timestamp.
90+
fixed64 time_unix_nano = 1;
91+
92+
// Numerical value of the severity, normalized to values described in Log Data Model.
93+
// [Optional].
94+
SeverityNumber severity_number = 2;
95+
96+
// The severity text (also known as log level). The original string representation as
97+
// it is known at the source. [Optional].
98+
string severity_text = 3;
99+
100+
// Short event identifier that does not contain varying parts. Name describes
101+
// what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
102+
// characters. Not guaranteed to be unique in any way. [Optional].
103+
string name = 4;
104+
105+
// A value containing the body of the log record. Can be for example a human-readable
106+
// string message (including multi-line) describing the event in a free form or it can
107+
// be a structured data composed of arrays and maps of other values. [Optional].
108+
opentelemetry.proto.common.v1.AnyValue body = 5;
109+
110+
// Additional attributes that describe the specific event occurrence. [Optional].
111+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 6;
112+
uint32 dropped_attributes_count = 7;
113+
114+
// Flags, a bit field. 8 least significant bits are the trace flags as
115+
// defined in W3C Trace Context specification. 24 most significant bits are reserved
116+
// and must be set to 0. Readers must not assume that 24 most significant bits
117+
// will be zero and must correctly mask the bits when reading 8-bit trace flag (use
118+
// flags & TRACE_FLAGS_MASK). [Optional].
119+
fixed32 flags = 8;
120+
121+
// A unique identifier for a trace. All logs from the same trace share
122+
// the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
123+
// is considered invalid. Can be set for logs that are part of request processing
124+
// and have an assigned trace id. [Optional].
125+
bytes trace_id = 9;
126+
127+
// A unique identifier for a span within a trace, assigned when the span
128+
// is created. The ID is an 8-byte array. An ID with all zeroes is considered
129+
// invalid. Can be set for logs that are part of a particular processing span.
130+
// If span_id is present trace_id SHOULD be also present. [Optional].
131+
bytes span_id = 10;
131132
}

opentelemetry/proto/metrics/v1/metrics.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ message ResourceMetrics {
3737
// A collection of Metrics produced by an InstrumentationLibrary.
3838
message InstrumentationLibraryMetrics {
3939
// The instrumentation library information for the metrics in this message.
40-
// If this field is not set then no library info is known.
40+
// Semantically when InstrumentationLibrary isn't set, it is equivalent with
41+
// an empty instrumentation library name (unknown).
4142
opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;
4243

4344
// A list of metrics that originate from an instrumentation library.

opentelemetry/proto/trace/v1/trace.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ message ResourceSpans {
3737
// A collection of Spans produced by an InstrumentationLibrary.
3838
message InstrumentationLibrarySpans {
3939
// The instrumentation library information for the spans in this message.
40-
// If this field is not set then no library info is known.
40+
// Semantically when InstrumentationLibrary isn't set, it is equivalent with
41+
// an empty instrumentation library name (unknown).
4142
opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;
4243

4344
// A list of Spans that originate from an instrumentation library.

0 commit comments

Comments
 (0)