mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
46ecbbea26
* lib/protoparser: adds opentelemetry parser app/{vmagent,vminsert}: adds opentelemetry ingestion path Adds ability to ingest data with opentelemetry protocol protobuf and json encoding is supported data converted into prometheus protobuf timeseries each data type has own converter and it may produce multiple timeseries from single datapoint (for summary and histogram). only cumulative aggregationFamily is supported for sum(prometheus counter) and histogram. Apply suggestions from code review Co-authored-by: Roman Khavronenko <roman@victoriametrics.com> updates deps fixes tests wip wip wip wip lib/protoparser/opentelemetry: moves to vtprotobuf generator go mod vendor lib/protoparse/opentelemetry: reduce memory allocations * wip - Remove support for JSON parsing, since it is too fragile and is rarely used in practice. The most clients send OpenTelemetry metrics in protobuf. The JSON parser can be added in the future if needed. - Remove unused code from lib/protoparser/opentelemetry/pb and lib/protoparser/opentelemetry/proto - Do not re-use protobuf message between ParseStream() calls, since there is high chance of high fragmentation of the re-used message because of too complex nested structure of the message. * wip * wip * wip --------- Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
67 lines
2.5 KiB
Protocol Buffer
67 lines
2.5 KiB
Protocol Buffer
// Copyright 2019, OpenTelemetry Authors
|
|
//
|
|
// 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.
|
|
|
|
syntax = "proto3";
|
|
|
|
package opentelemetry;
|
|
|
|
option csharp_namespace = "OpenTelemetry.Proto.Common.V1";
|
|
option java_multiple_files = true;
|
|
option java_package = "io.opentelemetry.proto.common.v1";
|
|
option java_outer_classname = "CommonProto";
|
|
option go_package = "opentelemetry/pb";
|
|
|
|
// AnyValue is used to represent any type of attribute value. AnyValue may contain a
|
|
// primitive value such as a string or integer or it may contain an arbitrary nested
|
|
// object containing arrays, key-value lists and primitives.
|
|
message AnyValue {
|
|
// The value is one of the listed fields. It is valid for all values to be unspecified
|
|
// in which case this AnyValue is considered to be "empty".
|
|
oneof value {
|
|
string string_value = 1;
|
|
bool bool_value = 2;
|
|
int64 int_value = 3;
|
|
double double_value = 4;
|
|
ArrayValue array_value = 5;
|
|
KeyValueList kvlist_value = 6;
|
|
bytes bytes_value = 7;
|
|
}
|
|
}
|
|
|
|
// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
|
|
// since oneof in AnyValue does not allow repeated fields.
|
|
message ArrayValue {
|
|
// Array of values. The array may be empty (contain 0 elements).
|
|
repeated AnyValue values = 1;
|
|
}
|
|
|
|
// KeyValueList is a list of KeyValue messages. We need KeyValueList as a message
|
|
// since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need
|
|
// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
|
|
// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
|
|
// are semantically equivalent.
|
|
message KeyValueList {
|
|
// A collection of key/value pairs of key-value pairs. The list may be empty (may
|
|
// contain 0 elements).
|
|
// The keys MUST be unique (it is not allowed to have more than one
|
|
// value with the same key).
|
|
repeated KeyValue values = 1;
|
|
}
|
|
|
|
// KeyValue is a key-value pair that is used to store Span attributes, Link
|
|
// attributes, etc.
|
|
message KeyValue {
|
|
string key = 1;
|
|
AnyValue value = 2;
|
|
}
|