diff --git a/plugins/in_opentelemetry/opentelemetry_common.pb-c.c b/plugins/in_opentelemetry/opentelemetry_common.pb-c.c new file mode 100644 index 00000000000..c758d7d8e98 --- /dev/null +++ b/plugins/in_opentelemetry/opentelemetry_common.pb-c.c @@ -0,0 +1,746 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: common.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "opentelemetry_common.pb-c.h" +void opentelemetry__proto__common__v1__any_value__init + (Opentelemetry__Proto__Common__V1__AnyValue *message) +{ + static const Opentelemetry__Proto__Common__V1__AnyValue init_value = OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__INIT; + *message = init_value; +} +size_t opentelemetry__proto__common__v1__any_value__get_packed_size + (const Opentelemetry__Proto__Common__V1__AnyValue *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__any_value__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__common__v1__any_value__pack + (const Opentelemetry__Proto__Common__V1__AnyValue *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__any_value__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__common__v1__any_value__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__AnyValue *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__any_value__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Common__V1__AnyValue * + opentelemetry__proto__common__v1__any_value__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Common__V1__AnyValue *) + protobuf_c_message_unpack (&opentelemetry__proto__common__v1__any_value__descriptor, + allocator, len, data); +} +void opentelemetry__proto__common__v1__any_value__free_unpacked + (Opentelemetry__Proto__Common__V1__AnyValue *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__common__v1__any_value__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__common__v1__array_value__init + (Opentelemetry__Proto__Common__V1__ArrayValue *message) +{ + static const Opentelemetry__Proto__Common__V1__ArrayValue init_value = OPENTELEMETRY__PROTO__COMMON__V1__ARRAY_VALUE__INIT; + *message = init_value; +} +size_t opentelemetry__proto__common__v1__array_value__get_packed_size + (const Opentelemetry__Proto__Common__V1__ArrayValue *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__array_value__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__common__v1__array_value__pack + (const Opentelemetry__Proto__Common__V1__ArrayValue *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__array_value__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__common__v1__array_value__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__ArrayValue *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__array_value__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Common__V1__ArrayValue * + opentelemetry__proto__common__v1__array_value__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Common__V1__ArrayValue *) + protobuf_c_message_unpack (&opentelemetry__proto__common__v1__array_value__descriptor, + allocator, len, data); +} +void opentelemetry__proto__common__v1__array_value__free_unpacked + (Opentelemetry__Proto__Common__V1__ArrayValue *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__common__v1__array_value__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__common__v1__key_value_list__init + (Opentelemetry__Proto__Common__V1__KeyValueList *message) +{ + static const Opentelemetry__Proto__Common__V1__KeyValueList init_value = OPENTELEMETRY__PROTO__COMMON__V1__KEY_VALUE_LIST__INIT; + *message = init_value; +} +size_t opentelemetry__proto__common__v1__key_value_list__get_packed_size + (const Opentelemetry__Proto__Common__V1__KeyValueList *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value_list__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__common__v1__key_value_list__pack + (const Opentelemetry__Proto__Common__V1__KeyValueList *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value_list__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__common__v1__key_value_list__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__KeyValueList *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value_list__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Common__V1__KeyValueList * + opentelemetry__proto__common__v1__key_value_list__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Common__V1__KeyValueList *) + protobuf_c_message_unpack (&opentelemetry__proto__common__v1__key_value_list__descriptor, + allocator, len, data); +} +void opentelemetry__proto__common__v1__key_value_list__free_unpacked + (Opentelemetry__Proto__Common__V1__KeyValueList *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value_list__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__common__v1__key_value__init + (Opentelemetry__Proto__Common__V1__KeyValue *message) +{ + static const Opentelemetry__Proto__Common__V1__KeyValue init_value = OPENTELEMETRY__PROTO__COMMON__V1__KEY_VALUE__INIT; + *message = init_value; +} +size_t opentelemetry__proto__common__v1__key_value__get_packed_size + (const Opentelemetry__Proto__Common__V1__KeyValue *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__common__v1__key_value__pack + (const Opentelemetry__Proto__Common__V1__KeyValue *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__common__v1__key_value__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__KeyValue *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Common__V1__KeyValue * + opentelemetry__proto__common__v1__key_value__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Common__V1__KeyValue *) + protobuf_c_message_unpack (&opentelemetry__proto__common__v1__key_value__descriptor, + allocator, len, data); +} +void opentelemetry__proto__common__v1__key_value__free_unpacked + (Opentelemetry__Proto__Common__V1__KeyValue *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__common__v1__key_value__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__common__v1__string_key_value__init + (Opentelemetry__Proto__Common__V1__StringKeyValue *message) +{ + static const Opentelemetry__Proto__Common__V1__StringKeyValue init_value = OPENTELEMETRY__PROTO__COMMON__V1__STRING_KEY_VALUE__INIT; + *message = init_value; +} +size_t opentelemetry__proto__common__v1__string_key_value__get_packed_size + (const Opentelemetry__Proto__Common__V1__StringKeyValue *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__string_key_value__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__common__v1__string_key_value__pack + (const Opentelemetry__Proto__Common__V1__StringKeyValue *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__string_key_value__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__common__v1__string_key_value__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__StringKeyValue *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__string_key_value__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Common__V1__StringKeyValue * + opentelemetry__proto__common__v1__string_key_value__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Common__V1__StringKeyValue *) + protobuf_c_message_unpack (&opentelemetry__proto__common__v1__string_key_value__descriptor, + allocator, len, data); +} +void opentelemetry__proto__common__v1__string_key_value__free_unpacked + (Opentelemetry__Proto__Common__V1__StringKeyValue *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__common__v1__string_key_value__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__common__v1__instrumentation_scope__init + (Opentelemetry__Proto__Common__V1__InstrumentationScope *message) +{ + static const Opentelemetry__Proto__Common__V1__InstrumentationScope init_value = OPENTELEMETRY__PROTO__COMMON__V1__INSTRUMENTATION_SCOPE__INIT; + *message = init_value; +} +size_t opentelemetry__proto__common__v1__instrumentation_scope__get_packed_size + (const Opentelemetry__Proto__Common__V1__InstrumentationScope *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_scope__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__common__v1__instrumentation_scope__pack + (const Opentelemetry__Proto__Common__V1__InstrumentationScope *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_scope__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__common__v1__instrumentation_scope__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__InstrumentationScope *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_scope__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Common__V1__InstrumentationScope * + opentelemetry__proto__common__v1__instrumentation_scope__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Common__V1__InstrumentationScope *) + protobuf_c_message_unpack (&opentelemetry__proto__common__v1__instrumentation_scope__descriptor, + allocator, len, data); +} +void opentelemetry__proto__common__v1__instrumentation_scope__free_unpacked + (Opentelemetry__Proto__Common__V1__InstrumentationScope *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_scope__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__common__v1__instrumentation_library__init + (Opentelemetry__Proto__Common__V1__InstrumentationLibrary *message) +{ + static const Opentelemetry__Proto__Common__V1__InstrumentationLibrary init_value = OPENTELEMETRY__PROTO__COMMON__V1__INSTRUMENTATION_LIBRARY__INIT; + *message = init_value; +} +size_t opentelemetry__proto__common__v1__instrumentation_library__get_packed_size + (const Opentelemetry__Proto__Common__V1__InstrumentationLibrary *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_library__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__common__v1__instrumentation_library__pack + (const Opentelemetry__Proto__Common__V1__InstrumentationLibrary *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_library__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__common__v1__instrumentation_library__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__InstrumentationLibrary *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_library__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Common__V1__InstrumentationLibrary * + opentelemetry__proto__common__v1__instrumentation_library__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Common__V1__InstrumentationLibrary *) + protobuf_c_message_unpack (&opentelemetry__proto__common__v1__instrumentation_library__descriptor, + allocator, len, data); +} +void opentelemetry__proto__common__v1__instrumentation_library__free_unpacked + (Opentelemetry__Proto__Common__V1__InstrumentationLibrary *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__common__v1__instrumentation_library__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_value__field_descriptors[7] = +{ + { + "string_value", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, value_case), + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, string_value), + NULL, + &protobuf_c_empty_string, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bool_value", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, value_case), + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, bool_value), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "int_value", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT64, + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, value_case), + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, int_value), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "double_value", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, value_case), + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, double_value), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "array_value", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, value_case), + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, array_value), + &opentelemetry__proto__common__v1__array_value__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "kvlist_value", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, value_case), + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, kvlist_value), + &opentelemetry__proto__common__v1__key_value_list__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bytes_value", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, value_case), + offsetof(Opentelemetry__Proto__Common__V1__AnyValue, bytes_value), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__common__v1__any_value__field_indices_by_name[] = { + 4, /* field[4] = array_value */ + 1, /* field[1] = bool_value */ + 6, /* field[6] = bytes_value */ + 3, /* field[3] = double_value */ + 2, /* field[2] = int_value */ + 5, /* field[5] = kvlist_value */ + 0, /* field[0] = string_value */ +}; +static const ProtobufCIntRange opentelemetry__proto__common__v1__any_value__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__any_value__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.common.v1.AnyValue", + "AnyValue", + "Opentelemetry__Proto__Common__V1__AnyValue", + "opentelemetry.proto.common.v1", + sizeof(Opentelemetry__Proto__Common__V1__AnyValue), + 7, + opentelemetry__proto__common__v1__any_value__field_descriptors, + opentelemetry__proto__common__v1__any_value__field_indices_by_name, + 1, opentelemetry__proto__common__v1__any_value__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__common__v1__any_value__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__array_value__field_descriptors[1] = +{ + { + "values", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Common__V1__ArrayValue, n_values), + offsetof(Opentelemetry__Proto__Common__V1__ArrayValue, values), + &opentelemetry__proto__common__v1__any_value__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__common__v1__array_value__field_indices_by_name[] = { + 0, /* field[0] = values */ +}; +static const ProtobufCIntRange opentelemetry__proto__common__v1__array_value__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__array_value__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.common.v1.ArrayValue", + "ArrayValue", + "Opentelemetry__Proto__Common__V1__ArrayValue", + "opentelemetry.proto.common.v1", + sizeof(Opentelemetry__Proto__Common__V1__ArrayValue), + 1, + opentelemetry__proto__common__v1__array_value__field_descriptors, + opentelemetry__proto__common__v1__array_value__field_indices_by_name, + 1, opentelemetry__proto__common__v1__array_value__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__common__v1__array_value__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__key_value_list__field_descriptors[1] = +{ + { + "values", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Common__V1__KeyValueList, n_values), + offsetof(Opentelemetry__Proto__Common__V1__KeyValueList, values), + &opentelemetry__proto__common__v1__key_value__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__common__v1__key_value_list__field_indices_by_name[] = { + 0, /* field[0] = values */ +}; +static const ProtobufCIntRange opentelemetry__proto__common__v1__key_value_list__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__key_value_list__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.common.v1.KeyValueList", + "KeyValueList", + "Opentelemetry__Proto__Common__V1__KeyValueList", + "opentelemetry.proto.common.v1", + sizeof(Opentelemetry__Proto__Common__V1__KeyValueList), + 1, + opentelemetry__proto__common__v1__key_value_list__field_descriptors, + opentelemetry__proto__common__v1__key_value_list__field_indices_by_name, + 1, opentelemetry__proto__common__v1__key_value_list__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__common__v1__key_value_list__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__key_value__field_descriptors[2] = +{ + { + "key", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__KeyValue, key), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "value", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__KeyValue, value), + &opentelemetry__proto__common__v1__any_value__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__common__v1__key_value__field_indices_by_name[] = { + 0, /* field[0] = key */ + 1, /* field[1] = value */ +}; +static const ProtobufCIntRange opentelemetry__proto__common__v1__key_value__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__key_value__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.common.v1.KeyValue", + "KeyValue", + "Opentelemetry__Proto__Common__V1__KeyValue", + "opentelemetry.proto.common.v1", + sizeof(Opentelemetry__Proto__Common__V1__KeyValue), + 2, + opentelemetry__proto__common__v1__key_value__field_descriptors, + opentelemetry__proto__common__v1__key_value__field_indices_by_name, + 1, opentelemetry__proto__common__v1__key_value__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__common__v1__key_value__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__string_key_value__field_descriptors[2] = +{ + { + "key", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__StringKeyValue, key), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "value", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__StringKeyValue, value), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__common__v1__string_key_value__field_indices_by_name[] = { + 0, /* field[0] = key */ + 1, /* field[1] = value */ +}; +static const ProtobufCIntRange opentelemetry__proto__common__v1__string_key_value__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__string_key_value__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.common.v1.StringKeyValue", + "StringKeyValue", + "Opentelemetry__Proto__Common__V1__StringKeyValue", + "opentelemetry.proto.common.v1", + sizeof(Opentelemetry__Proto__Common__V1__StringKeyValue), + 2, + opentelemetry__proto__common__v1__string_key_value__field_descriptors, + opentelemetry__proto__common__v1__string_key_value__field_indices_by_name, + 1, opentelemetry__proto__common__v1__string_key_value__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__common__v1__string_key_value__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__instrumentation_library__field_descriptors[2] = +{ + { + "name", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__InstrumentationLibrary, name), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "version", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__InstrumentationLibrary, version), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__common__v1__instrumentation_library__field_indices_by_name[] = { + 0, /* field[0] = name */ + 1, /* field[1] = version */ +}; +static const ProtobufCIntRange opentelemetry__proto__common__v1__instrumentation_library__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__instrumentation_library__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.common.v1.InstrumentationLibrary", + "InstrumentationLibrary", + "Opentelemetry__Proto__Common__V1__InstrumentationLibrary", + "opentelemetry.proto.common.v1", + sizeof(Opentelemetry__Proto__Common__V1__InstrumentationLibrary), + 2, + opentelemetry__proto__common__v1__instrumentation_library__field_descriptors, + opentelemetry__proto__common__v1__instrumentation_library__field_indices_by_name, + 1, opentelemetry__proto__common__v1__instrumentation_library__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__common__v1__instrumentation_library__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__instrumentation_scope__field_descriptors[4] = +{ + { + "name", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__InstrumentationScope, name), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "version", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__InstrumentationScope, version), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "attributes", + 3, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Common__V1__InstrumentationScope, n_attributes), + offsetof(Opentelemetry__Proto__Common__V1__InstrumentationScope, attributes), + &opentelemetry__proto__common__v1__key_value__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dropped_attributes_count", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Common__V1__InstrumentationScope, dropped_attributes_count), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__common__v1__instrumentation_scope__field_indices_by_name[] = { + 2, /* field[2] = attributes */ + 3, /* field[3] = dropped_attributes_count */ + 0, /* field[0] = name */ + 1, /* field[1] = version */ +}; +static const ProtobufCIntRange opentelemetry__proto__common__v1__instrumentation_scope__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__instrumentation_scope__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.common.v1.InstrumentationScope", + "InstrumentationScope", + "Opentelemetry__Proto__Common__V1__InstrumentationScope", + "opentelemetry.proto.common.v1", + sizeof(Opentelemetry__Proto__Common__V1__InstrumentationScope), + 4, + opentelemetry__proto__common__v1__instrumentation_scope__field_descriptors, + opentelemetry__proto__common__v1__instrumentation_scope__field_indices_by_name, + 1, opentelemetry__proto__common__v1__instrumentation_scope__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__common__v1__instrumentation_scope__init, + NULL,NULL,NULL /* reserved[123] */ +}; \ No newline at end of file diff --git a/plugins/in_opentelemetry/opentelemetry_common.pb-c.h b/plugins/in_opentelemetry/opentelemetry_common.pb-c.h new file mode 100644 index 00000000000..19f3b7fd43e --- /dev/null +++ b/plugins/in_opentelemetry/opentelemetry_common.pb-c.h @@ -0,0 +1,79 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: common.proto */ + +// #ifndef PROTOBUF_C_common_2eproto__INCLUDED +// #define PROTOBUF_C_common_2eproto__INCLUDED + +#include +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +typedef struct _Opentelemetry__Proto__Common__V1__InstrumentationScope Opentelemetry__Proto__Common__V1__InstrumentationScope; + +/* --- enums --- */ + + +/* --- messages --- */ + +/* + * InstrumentationScope is a message representing the instrumentation scope information + * such as the fully qualified name and version. + */ +struct _Opentelemetry__Proto__Common__V1__InstrumentationScope +{ + ProtobufCMessage base; + /* + * An empty instrumentation scope name means the name is unknown. + */ + char *name; + char *version; + size_t n_attributes; + Opentelemetry__Proto__Common__V1__KeyValue **attributes; + uint32_t dropped_attributes_count; +}; +#define OPENTELEMETRY__PROTO__COMMON__V1__INSTRUMENTATION_SCOPE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&opentelemetry__proto__common__v1__instrumentation_scope__descriptor) \ + , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0,NULL, 0 } + +/* Opentelemetry__Proto__Common__V1__InstrumentationScope methods */ +void opentelemetry__proto__common__v1__instrumentation_scope__init + (Opentelemetry__Proto__Common__V1__InstrumentationScope *message); +size_t opentelemetry__proto__common__v1__instrumentation_scope__get_packed_size + (const Opentelemetry__Proto__Common__V1__InstrumentationScope *message); +size_t opentelemetry__proto__common__v1__instrumentation_scope__pack + (const Opentelemetry__Proto__Common__V1__InstrumentationScope *message, + uint8_t *out); +size_t opentelemetry__proto__common__v1__instrumentation_scope__pack_to_buffer + (const Opentelemetry__Proto__Common__V1__InstrumentationScope *message, + ProtobufCBuffer *buffer); +Opentelemetry__Proto__Common__V1__InstrumentationScope * + opentelemetry__proto__common__v1__instrumentation_scope__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void opentelemetry__proto__common__v1__instrumentation_scope__free_unpacked + (Opentelemetry__Proto__Common__V1__InstrumentationScope *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ +typedef void (*Opentelemetry__Proto__Common__V1__InstrumentationScope__Closure) + (const Opentelemetry__Proto__Common__V1__InstrumentationScope *message, + void *user_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor opentelemetry__proto__common__v1__instrumentation_scope__descriptor; + +PROTOBUF_C__END_DECLS + + +// #endif /* PROTOBUF_C_common_2eproto__INCLUDED */ \ No newline at end of file diff --git a/plugins/in_opentelemetry/opentelemetry_logs.pb-c.c b/plugins/in_opentelemetry/opentelemetry_logs.pb-c.c new file mode 100644 index 00000000000..9c1f4479ceb --- /dev/null +++ b/plugins/in_opentelemetry/opentelemetry_logs.pb-c.c @@ -0,0 +1,613 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: opentelemetry/proto/logs/v1/logs.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "opentelemetry_logs.pb-c.h" +void opentelemetry__proto__logs__v1__logs_data__init + (Opentelemetry__Proto__Logs__V1__LogsData *message) +{ + static const Opentelemetry__Proto__Logs__V1__LogsData init_value = OPENTELEMETRY__PROTO__LOGS__V1__LOGS_DATA__INIT; + *message = init_value; +} +size_t opentelemetry__proto__logs__v1__logs_data__get_packed_size + (const Opentelemetry__Proto__Logs__V1__LogsData *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__logs_data__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__logs__v1__logs_data__pack + (const Opentelemetry__Proto__Logs__V1__LogsData *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__logs_data__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__logs__v1__logs_data__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__LogsData *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__logs_data__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Logs__V1__LogsData * + opentelemetry__proto__logs__v1__logs_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Logs__V1__LogsData *) + protobuf_c_message_unpack (&opentelemetry__proto__logs__v1__logs_data__descriptor, + allocator, len, data); +} +void opentelemetry__proto__logs__v1__logs_data__free_unpacked + (Opentelemetry__Proto__Logs__V1__LogsData *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__logs_data__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__logs__v1__resource_logs__init + (Opentelemetry__Proto__Logs__V1__ResourceLogs *message) +{ + static const Opentelemetry__Proto__Logs__V1__ResourceLogs init_value = OPENTELEMETRY__PROTO__LOGS__V1__RESOURCE_LOGS__INIT; + *message = init_value; +} +size_t opentelemetry__proto__logs__v1__resource_logs__get_packed_size + (const Opentelemetry__Proto__Logs__V1__ResourceLogs *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__resource_logs__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__logs__v1__resource_logs__pack + (const Opentelemetry__Proto__Logs__V1__ResourceLogs *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__resource_logs__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__logs__v1__resource_logs__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__ResourceLogs *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__resource_logs__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Logs__V1__ResourceLogs * + opentelemetry__proto__logs__v1__resource_logs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Logs__V1__ResourceLogs *) + protobuf_c_message_unpack (&opentelemetry__proto__logs__v1__resource_logs__descriptor, + allocator, len, data); +} +void opentelemetry__proto__logs__v1__resource_logs__free_unpacked + (Opentelemetry__Proto__Logs__V1__ResourceLogs *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__resource_logs__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__logs__v1__scope_logs__init + (Opentelemetry__Proto__Logs__V1__ScopeLogs *message) +{ + static const Opentelemetry__Proto__Logs__V1__ScopeLogs init_value = OPENTELEMETRY__PROTO__LOGS__V1__SCOPE_LOGS__INIT; + *message = init_value; +} +size_t opentelemetry__proto__logs__v1__scope_logs__get_packed_size + (const Opentelemetry__Proto__Logs__V1__ScopeLogs *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__scope_logs__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__logs__v1__scope_logs__pack + (const Opentelemetry__Proto__Logs__V1__ScopeLogs *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__scope_logs__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__logs__v1__scope_logs__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__ScopeLogs *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__scope_logs__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Logs__V1__ScopeLogs * + opentelemetry__proto__logs__v1__scope_logs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Logs__V1__ScopeLogs *) + protobuf_c_message_unpack (&opentelemetry__proto__logs__v1__scope_logs__descriptor, + allocator, len, data); +} +void opentelemetry__proto__logs__v1__scope_logs__free_unpacked + (Opentelemetry__Proto__Logs__V1__ScopeLogs *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__scope_logs__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__logs__v1__log_record__init + (Opentelemetry__Proto__Logs__V1__LogRecord *message) +{ + static const Opentelemetry__Proto__Logs__V1__LogRecord init_value = OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD__INIT; + *message = init_value; +} +size_t opentelemetry__proto__logs__v1__log_record__get_packed_size + (const Opentelemetry__Proto__Logs__V1__LogRecord *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__log_record__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__logs__v1__log_record__pack + (const Opentelemetry__Proto__Logs__V1__LogRecord *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__log_record__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__logs__v1__log_record__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__LogRecord *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__log_record__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Logs__V1__LogRecord * + opentelemetry__proto__logs__v1__log_record__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Logs__V1__LogRecord *) + protobuf_c_message_unpack (&opentelemetry__proto__logs__v1__log_record__descriptor, + allocator, len, data); +} +void opentelemetry__proto__logs__v1__log_record__free_unpacked + (Opentelemetry__Proto__Logs__V1__LogRecord *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__logs__v1__log_record__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor opentelemetry__proto__logs__v1__logs_data__field_descriptors[1] = +{ + { + "resource_logs", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Logs__V1__LogsData, n_resource_logs), + offsetof(Opentelemetry__Proto__Logs__V1__LogsData, resource_logs), + &opentelemetry__proto__logs__v1__resource_logs__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__logs__v1__logs_data__field_indices_by_name[] = { + 0, /* field[0] = resource_logs */ +}; +static const ProtobufCIntRange opentelemetry__proto__logs__v1__logs_data__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__logs_data__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.logs.v1.LogsData", + "LogsData", + "Opentelemetry__Proto__Logs__V1__LogsData", + "opentelemetry.proto.logs.v1", + sizeof(Opentelemetry__Proto__Logs__V1__LogsData), + 1, + opentelemetry__proto__logs__v1__logs_data__field_descriptors, + opentelemetry__proto__logs__v1__logs_data__field_indices_by_name, + 1, opentelemetry__proto__logs__v1__logs_data__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__logs__v1__logs_data__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__logs__v1__resource_logs__field_descriptors[3] = +{ + { + "resource", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__ResourceLogs, resource), + &opentelemetry__proto__resource__v1__resource__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "scope_logs", + 2, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Logs__V1__ResourceLogs, n_scope_logs), + offsetof(Opentelemetry__Proto__Logs__V1__ResourceLogs, scope_logs), + &opentelemetry__proto__logs__v1__scope_logs__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "schema_url", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__ResourceLogs, schema_url), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__logs__v1__resource_logs__field_indices_by_name[] = { + 0, /* field[0] = resource */ + 2, /* field[2] = schema_url */ + 1, /* field[1] = scope_logs */ +}; +static const ProtobufCIntRange opentelemetry__proto__logs__v1__resource_logs__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__resource_logs__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.logs.v1.ResourceLogs", + "ResourceLogs", + "Opentelemetry__Proto__Logs__V1__ResourceLogs", + "opentelemetry.proto.logs.v1", + sizeof(Opentelemetry__Proto__Logs__V1__ResourceLogs), + 3, + opentelemetry__proto__logs__v1__resource_logs__field_descriptors, + opentelemetry__proto__logs__v1__resource_logs__field_indices_by_name, + 1, opentelemetry__proto__logs__v1__resource_logs__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__logs__v1__resource_logs__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__logs__v1__scope_logs__field_descriptors[3] = +{ + { + "scope", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__ScopeLogs, scope), + &opentelemetry__proto__common__v1__instrumentation_scope__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "log_records", + 2, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Logs__V1__ScopeLogs, n_log_records), + offsetof(Opentelemetry__Proto__Logs__V1__ScopeLogs, log_records), + &opentelemetry__proto__logs__v1__log_record__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "schema_url", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__ScopeLogs, schema_url), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__logs__v1__scope_logs__field_indices_by_name[] = { + 1, /* field[1] = log_records */ + 2, /* field[2] = schema_url */ + 0, /* field[0] = scope */ +}; +static const ProtobufCIntRange opentelemetry__proto__logs__v1__scope_logs__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__scope_logs__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.logs.v1.ScopeLogs", + "ScopeLogs", + "Opentelemetry__Proto__Logs__V1__ScopeLogs", + "opentelemetry.proto.logs.v1", + sizeof(Opentelemetry__Proto__Logs__V1__ScopeLogs), + 3, + opentelemetry__proto__logs__v1__scope_logs__field_descriptors, + opentelemetry__proto__logs__v1__scope_logs__field_indices_by_name, + 1, opentelemetry__proto__logs__v1__scope_logs__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__logs__v1__scope_logs__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor opentelemetry__proto__logs__v1__log_record__field_descriptors[10] = +{ + { + "time_unix_nano", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_FIXED64, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, time_unix_nano), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "severity_number", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_ENUM, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, severity_number), + &opentelemetry__proto__logs__v1__severity_number__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "severity_text", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, severity_text), + NULL, + &protobuf_c_empty_string, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "body", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, body), + &opentelemetry__proto__common__v1__any_value__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "attributes", + 6, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, n_attributes), + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, attributes), + &opentelemetry__proto__common__v1__key_value__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dropped_attributes_count", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, dropped_attributes_count), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "flags", + 8, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_FIXED32, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, flags), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "trace_id", + 9, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, trace_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "span_id", + 10, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, span_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "observed_time_unix_nano", + 11, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_FIXED64, + 0, /* quantifier_offset */ + offsetof(Opentelemetry__Proto__Logs__V1__LogRecord, observed_time_unix_nano), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__logs__v1__log_record__field_indices_by_name[] = { + 4, /* field[4] = attributes */ + 3, /* field[3] = body */ + 5, /* field[5] = dropped_attributes_count */ + 6, /* field[6] = flags */ + 9, /* field[9] = observed_time_unix_nano */ + 1, /* field[1] = severity_number */ + 2, /* field[2] = severity_text */ + 8, /* field[8] = span_id */ + 0, /* field[0] = time_unix_nano */ + 7, /* field[7] = trace_id */ +}; +static const ProtobufCIntRange opentelemetry__proto__logs__v1__log_record__number_ranges[2 + 1] = +{ + { 1, 0 }, + { 5, 3 }, + { 0, 10 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__log_record__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.logs.v1.LogRecord", + "LogRecord", + "Opentelemetry__Proto__Logs__V1__LogRecord", + "opentelemetry.proto.logs.v1", + sizeof(Opentelemetry__Proto__Logs__V1__LogRecord), + 10, + opentelemetry__proto__logs__v1__log_record__field_descriptors, + opentelemetry__proto__logs__v1__log_record__field_indices_by_name, + 2, opentelemetry__proto__logs__v1__log_record__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__logs__v1__log_record__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCEnumValue opentelemetry__proto__logs__v1__severity_number__enum_values_by_number[25] = +{ + { "SEVERITY_NUMBER_UNSPECIFIED", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_UNSPECIFIED", 0 }, + { "SEVERITY_NUMBER_TRACE", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE", 1 }, + { "SEVERITY_NUMBER_TRACE2", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE2", 2 }, + { "SEVERITY_NUMBER_TRACE3", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE3", 3 }, + { "SEVERITY_NUMBER_TRACE4", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE4", 4 }, + { "SEVERITY_NUMBER_DEBUG", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG", 5 }, + { "SEVERITY_NUMBER_DEBUG2", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG2", 6 }, + { "SEVERITY_NUMBER_DEBUG3", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG3", 7 }, + { "SEVERITY_NUMBER_DEBUG4", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG4", 8 }, + { "SEVERITY_NUMBER_INFO", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO", 9 }, + { "SEVERITY_NUMBER_INFO2", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO2", 10 }, + { "SEVERITY_NUMBER_INFO3", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO3", 11 }, + { "SEVERITY_NUMBER_INFO4", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO4", 12 }, + { "SEVERITY_NUMBER_WARN", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN", 13 }, + { "SEVERITY_NUMBER_WARN2", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN2", 14 }, + { "SEVERITY_NUMBER_WARN3", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN3", 15 }, + { "SEVERITY_NUMBER_WARN4", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN4", 16 }, + { "SEVERITY_NUMBER_ERROR", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR", 17 }, + { "SEVERITY_NUMBER_ERROR2", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR2", 18 }, + { "SEVERITY_NUMBER_ERROR3", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR3", 19 }, + { "SEVERITY_NUMBER_ERROR4", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR4", 20 }, + { "SEVERITY_NUMBER_FATAL", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL", 21 }, + { "SEVERITY_NUMBER_FATAL2", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL2", 22 }, + { "SEVERITY_NUMBER_FATAL3", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL3", 23 }, + { "SEVERITY_NUMBER_FATAL4", "OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL4", 24 }, +}; +static const ProtobufCIntRange opentelemetry__proto__logs__v1__severity_number__value_ranges[] = { +{0, 0},{0, 25} +}; +static const ProtobufCEnumValueIndex opentelemetry__proto__logs__v1__severity_number__enum_values_by_name[25] = +{ + { "SEVERITY_NUMBER_DEBUG", 5 }, + { "SEVERITY_NUMBER_DEBUG2", 6 }, + { "SEVERITY_NUMBER_DEBUG3", 7 }, + { "SEVERITY_NUMBER_DEBUG4", 8 }, + { "SEVERITY_NUMBER_ERROR", 17 }, + { "SEVERITY_NUMBER_ERROR2", 18 }, + { "SEVERITY_NUMBER_ERROR3", 19 }, + { "SEVERITY_NUMBER_ERROR4", 20 }, + { "SEVERITY_NUMBER_FATAL", 21 }, + { "SEVERITY_NUMBER_FATAL2", 22 }, + { "SEVERITY_NUMBER_FATAL3", 23 }, + { "SEVERITY_NUMBER_FATAL4", 24 }, + { "SEVERITY_NUMBER_INFO", 9 }, + { "SEVERITY_NUMBER_INFO2", 10 }, + { "SEVERITY_NUMBER_INFO3", 11 }, + { "SEVERITY_NUMBER_INFO4", 12 }, + { "SEVERITY_NUMBER_TRACE", 1 }, + { "SEVERITY_NUMBER_TRACE2", 2 }, + { "SEVERITY_NUMBER_TRACE3", 3 }, + { "SEVERITY_NUMBER_TRACE4", 4 }, + { "SEVERITY_NUMBER_UNSPECIFIED", 0 }, + { "SEVERITY_NUMBER_WARN", 13 }, + { "SEVERITY_NUMBER_WARN2", 14 }, + { "SEVERITY_NUMBER_WARN3", 15 }, + { "SEVERITY_NUMBER_WARN4", 16 }, +}; +const ProtobufCEnumDescriptor opentelemetry__proto__logs__v1__severity_number__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "opentelemetry.proto.logs.v1.SeverityNumber", + "SeverityNumber", + "Opentelemetry__Proto__Logs__V1__SeverityNumber", + "opentelemetry.proto.logs.v1", + 25, + opentelemetry__proto__logs__v1__severity_number__enum_values_by_number, + 25, + opentelemetry__proto__logs__v1__severity_number__enum_values_by_name, + 1, + opentelemetry__proto__logs__v1__severity_number__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; +static const ProtobufCEnumValue opentelemetry__proto__logs__v1__log_record_flags__enum_values_by_number[2] = +{ + { "LOG_RECORD_FLAG_UNSPECIFIED", "OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD_FLAGS__LOG_RECORD_FLAG_UNSPECIFIED", 0 }, + { "LOG_RECORD_FLAG_TRACE_FLAGS_MASK", "OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD_FLAGS__LOG_RECORD_FLAG_TRACE_FLAGS_MASK", 255 }, +}; +static const ProtobufCIntRange opentelemetry__proto__logs__v1__log_record_flags__value_ranges[] = { +{0, 0},{255, 1},{0, 2} +}; +static const ProtobufCEnumValueIndex opentelemetry__proto__logs__v1__log_record_flags__enum_values_by_name[2] = +{ + { "LOG_RECORD_FLAG_TRACE_FLAGS_MASK", 1 }, + { "LOG_RECORD_FLAG_UNSPECIFIED", 0 }, +}; +const ProtobufCEnumDescriptor opentelemetry__proto__logs__v1__log_record_flags__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "opentelemetry.proto.logs.v1.LogRecordFlags", + "LogRecordFlags", + "Opentelemetry__Proto__Logs__V1__LogRecordFlags", + "opentelemetry.proto.logs.v1", + 2, + opentelemetry__proto__logs__v1__log_record_flags__enum_values_by_number, + 2, + opentelemetry__proto__logs__v1__log_record_flags__enum_values_by_name, + 2, + opentelemetry__proto__logs__v1__log_record_flags__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; \ No newline at end of file diff --git a/plugins/in_opentelemetry/opentelemetry_logs.pb-c.h b/plugins/in_opentelemetry/opentelemetry_logs.pb-c.h new file mode 100644 index 00000000000..8e51d7e0ff7 --- /dev/null +++ b/plugins/in_opentelemetry/opentelemetry_logs.pb-c.h @@ -0,0 +1,344 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: opentelemetry/proto/logs/v1/logs.proto */ + +#ifndef PROTOBUF_C_opentelemetry_2fproto_2flogs_2fv1_2flogs_2eproto__INCLUDED +#define PROTOBUF_C_opentelemetry_2fproto_2flogs_2fv1_2flogs_2eproto__INCLUDED + +#include +#include +#include "opentelemetry_common.pb-c.h" + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1004000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +/* #include "common.pb-c.h" */ +/* #include "resource.pb-c.h" */ + +typedef struct Opentelemetry__Proto__Logs__V1__LogsData Opentelemetry__Proto__Logs__V1__LogsData; +typedef struct Opentelemetry__Proto__Logs__V1__ResourceLogs Opentelemetry__Proto__Logs__V1__ResourceLogs; +typedef struct Opentelemetry__Proto__Logs__V1__ScopeLogs Opentelemetry__Proto__Logs__V1__ScopeLogs; +typedef struct Opentelemetry__Proto__Logs__V1__LogRecord Opentelemetry__Proto__Logs__V1__LogRecord; + + +/* --- enums --- */ + +/* + * Possible values for LogRecord.SeverityNumber. + */ +typedef enum _Opentelemetry__Proto__Logs__V1__SeverityNumber { + /* + * UNSPECIFIED is the default SeverityNumber, it MUST NOT be used. + */ + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_UNSPECIFIED = 0, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE = 1, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE2 = 2, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE3 = 3, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_TRACE4 = 4, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG = 5, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG2 = 6, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG3 = 7, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_DEBUG4 = 8, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO = 9, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO2 = 10, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO3 = 11, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_INFO4 = 12, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN = 13, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN2 = 14, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN3 = 15, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_WARN4 = 16, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR = 17, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR2 = 18, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR3 = 19, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_ERROR4 = 20, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL = 21, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL2 = 22, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL3 = 23, + OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_FATAL4 = 24 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER) +} Opentelemetry__Proto__Logs__V1__SeverityNumber; +/* + * Masks for LogRecord.flags field. + */ +typedef enum _Opentelemetry__Proto__Logs__V1__LogRecordFlags { + OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD_FLAGS__LOG_RECORD_FLAG_UNSPECIFIED = 0, + OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD_FLAGS__LOG_RECORD_FLAG_TRACE_FLAGS_MASK = 255 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD_FLAGS) +} Opentelemetry__Proto__Logs__V1__LogRecordFlags; + +/* --- messages --- */ + +/* + * LogsData represents the logs data that can be stored in a persistent storage, + * OR can be embedded by other protocols that transfer OTLP logs data but do not + * implement the OTLP protocol. + * The main difference between this message and collector protocol is that + * in this message there will not be any "control" or "metadata" specific to + * OTLP protocol. + * When new fields are added into this message, the OTLP request MUST be updated + * as well. + */ +struct Opentelemetry__Proto__Logs__V1__LogsData +{ + ProtobufCMessage base; + /* + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + */ + size_t n_resource_logs; + Opentelemetry__Proto__Logs__V1__ResourceLogs **resource_logs; +}; +#define OPENTELEMETRY__PROTO__LOGS__V1__LOGS_DATA__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&opentelemetry__proto__logs__v1__logs_data__descriptor) \ + , 0,NULL } + + +/* + * A collection of ScopeLogs from a Resource. + */ +struct Opentelemetry__Proto__Logs__V1__ResourceLogs +{ + ProtobufCMessage base; + /* + * The resource for the logs in this message. + * If this field is not set then resource info is unknown. + */ + Opentelemetry__Proto__Resource__V1__Resource *resource; + /* + * A list of ScopeLogs that originate from a resource. + */ + size_t n_scope_logs; + Opentelemetry__Proto__Logs__V1__ScopeLogs **scope_logs; + /* + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_logs" field which have their own schema_url field. + */ + char *schema_url; +}; +#define OPENTELEMETRY__PROTO__LOGS__V1__RESOURCE_LOGS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&opentelemetry__proto__logs__v1__resource_logs__descriptor) \ + , NULL, 0,NULL, (char *)protobuf_c_empty_string } + + +/* + * A collection of Logs produced by a Scope. + */ +struct Opentelemetry__Proto__Logs__V1__ScopeLogs +{ + ProtobufCMessage base; + /* + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + */ + Opentelemetry__Proto__Common__V1__InstrumentationScope *scope; + /* + * A list of log records. + */ + size_t n_log_records; + Opentelemetry__Proto__Logs__V1__LogRecord **log_records; + /* + * This schema_url applies to all logs in the "logs" field. + */ + char *schema_url; +}; +#define OPENTELEMETRY__PROTO__LOGS__V1__SCOPE_LOGS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&opentelemetry__proto__logs__v1__scope_logs__descriptor) \ + , NULL, 0,NULL, (char *)protobuf_c_empty_string } + + +/* + * A log record according to OpenTelemetry Log Data Model: + * https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md + */ +struct Opentelemetry__Proto__Logs__V1__LogRecord +{ + ProtobufCMessage base; + /* + * 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. + */ + uint64_t 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. + */ + uint64_t observed_time_unix_nano; + /* + * Numerical value of the severity, normalized to values described in Log Data Model. + * [Optional]. + */ + Opentelemetry__Proto__Logs__V1__SeverityNumber severity_number; + /* + * The severity text (also known as log level). The original string representation as + * it is known at the source. [Optional]. + */ + char *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]. + */ + Opentelemetry__Proto__Common__V1__AnyValue *body; + /* + * 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). + */ + size_t n_attributes; + Opentelemetry__Proto__Common__V1__KeyValue **attributes; + uint32_t dropped_attributes_count; + /* + * 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 & TRACE_FLAGS_MASK). [Optional]. + */ + uint32_t flags; + /* + * 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 + * is considered invalid. Can be set for logs that are part of request processing + * and have an assigned trace id. [Optional]. + */ + ProtobufCBinaryData 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 is considered + * invalid. Can be set for logs that are part of a particular processing span. + * If span_id is present trace_id SHOULD be also present. [Optional]. + */ + ProtobufCBinaryData span_id; +}; +#define OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&opentelemetry__proto__logs__v1__log_record__descriptor) \ + , 0, 0, OPENTELEMETRY__PROTO__LOGS__V1__SEVERITY_NUMBER__SEVERITY_NUMBER_UNSPECIFIED, (char *)protobuf_c_empty_string, NULL, 0,NULL, 0, 0, {0,NULL}, {0,NULL} } + + +/* Opentelemetry__Proto__Logs__V1__LogsData methods */ +void opentelemetry__proto__logs__v1__logs_data__init + (Opentelemetry__Proto__Logs__V1__LogsData *message); +size_t opentelemetry__proto__logs__v1__logs_data__get_packed_size + (const Opentelemetry__Proto__Logs__V1__LogsData *message); +size_t opentelemetry__proto__logs__v1__logs_data__pack + (const Opentelemetry__Proto__Logs__V1__LogsData *message, + uint8_t *out); +size_t opentelemetry__proto__logs__v1__logs_data__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__LogsData *message, + ProtobufCBuffer *buffer); +Opentelemetry__Proto__Logs__V1__LogsData * + opentelemetry__proto__logs__v1__logs_data__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void opentelemetry__proto__logs__v1__logs_data__free_unpacked + (Opentelemetry__Proto__Logs__V1__LogsData *message, + ProtobufCAllocator *allocator); +/* Opentelemetry__Proto__Logs__V1__ResourceLogs methods */ +void opentelemetry__proto__logs__v1__resource_logs__init + (Opentelemetry__Proto__Logs__V1__ResourceLogs *message); +size_t opentelemetry__proto__logs__v1__resource_logs__get_packed_size + (const Opentelemetry__Proto__Logs__V1__ResourceLogs *message); +size_t opentelemetry__proto__logs__v1__resource_logs__pack + (const Opentelemetry__Proto__Logs__V1__ResourceLogs *message, + uint8_t *out); +size_t opentelemetry__proto__logs__v1__resource_logs__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__ResourceLogs *message, + ProtobufCBuffer *buffer); +Opentelemetry__Proto__Logs__V1__ResourceLogs * + opentelemetry__proto__logs__v1__resource_logs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void opentelemetry__proto__logs__v1__resource_logs__free_unpacked + (Opentelemetry__Proto__Logs__V1__ResourceLogs *message, + ProtobufCAllocator *allocator); +/* Opentelemetry__Proto__Logs__V1__ScopeLogs methods */ +void opentelemetry__proto__logs__v1__scope_logs__init + (Opentelemetry__Proto__Logs__V1__ScopeLogs *message); +size_t opentelemetry__proto__logs__v1__scope_logs__get_packed_size + (const Opentelemetry__Proto__Logs__V1__ScopeLogs *message); +size_t opentelemetry__proto__logs__v1__scope_logs__pack + (const Opentelemetry__Proto__Logs__V1__ScopeLogs *message, + uint8_t *out); +size_t opentelemetry__proto__logs__v1__scope_logs__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__ScopeLogs *message, + ProtobufCBuffer *buffer); +Opentelemetry__Proto__Logs__V1__ScopeLogs * + opentelemetry__proto__logs__v1__scope_logs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void opentelemetry__proto__logs__v1__scope_logs__free_unpacked + (Opentelemetry__Proto__Logs__V1__ScopeLogs *message, + ProtobufCAllocator *allocator); +/* Opentelemetry__Proto__Logs__V1__LogRecord methods */ +void opentelemetry__proto__logs__v1__log_record__init + (Opentelemetry__Proto__Logs__V1__LogRecord *message); +size_t opentelemetry__proto__logs__v1__log_record__get_packed_size + (const Opentelemetry__Proto__Logs__V1__LogRecord *message); +size_t opentelemetry__proto__logs__v1__log_record__pack + (const Opentelemetry__Proto__Logs__V1__LogRecord *message, + uint8_t *out); +size_t opentelemetry__proto__logs__v1__log_record__pack_to_buffer + (const Opentelemetry__Proto__Logs__V1__LogRecord *message, + ProtobufCBuffer *buffer); +Opentelemetry__Proto__Logs__V1__LogRecord * + opentelemetry__proto__logs__v1__log_record__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void opentelemetry__proto__logs__v1__log_record__free_unpacked + (Opentelemetry__Proto__Logs__V1__LogRecord *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Opentelemetry__Proto__Logs__V1__LogsData_Closure) + (const Opentelemetry__Proto__Logs__V1__LogsData *message, + void *closure_data); +typedef void (*Opentelemetry__Proto__Logs__V1__ResourceLogs_Closure) + (const Opentelemetry__Proto__Logs__V1__ResourceLogs *message, + void *closure_data); +typedef void (*Opentelemetry__Proto__Logs__V1__ScopeLogs_Closure) + (const Opentelemetry__Proto__Logs__V1__ScopeLogs *message, + void *closure_data); +typedef void (*Opentelemetry__Proto__Logs__V1__LogRecord_Closure) + (const Opentelemetry__Proto__Logs__V1__LogRecord *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor opentelemetry__proto__logs__v1__severity_number__descriptor; +extern const ProtobufCEnumDescriptor opentelemetry__proto__logs__v1__log_record_flags__descriptor; +extern const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__logs_data__descriptor; +extern const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__resource_logs__descriptor; +extern const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__scope_logs__descriptor; +extern const ProtobufCMessageDescriptor opentelemetry__proto__logs__v1__log_record__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_opentelemetry_2fproto_2flogs_2fv1_2flogs_2eproto__INCLUDED */ \ No newline at end of file diff --git a/plugins/in_opentelemetry/opentelemetry_logs_service.pb-c.c b/plugins/in_opentelemetry/opentelemetry_logs_service.pb-c.c new file mode 100644 index 00000000000..b09fca90d69 --- /dev/null +++ b/plugins/in_opentelemetry/opentelemetry_logs_service.pb-c.c @@ -0,0 +1,188 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: opentelemetry/proto/collector/logs/v1/logs_service.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "opentelemetry_logs_service.pb-c.h" +void opentelemetry__proto__collector__logs__v1__export_logs_service_request__init + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message) +{ + static const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest init_value = OPENTELEMETRY__PROTO__COLLECTOR__LOGS__V1__EXPORT_LOGS_SERVICE_REQUEST__INIT; + *message = init_value; +} +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_request__get_packed_size + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_request__pack + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_request__pack_to_buffer + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest * + opentelemetry__proto__collector__logs__v1__export_logs_service_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *) + protobuf_c_message_unpack (&opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor, + allocator, len, data); +} +void opentelemetry__proto__collector__logs__v1__export_logs_service_request__free_unpacked + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void opentelemetry__proto__collector__logs__v1__export_logs_service_response__init + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message) +{ + static const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse init_value = OPENTELEMETRY__PROTO__COLLECTOR__LOGS__V1__EXPORT_LOGS_SERVICE_RESPONSE__INIT; + *message = init_value; +} +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_response__get_packed_size + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message) +{ + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_response__pack + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_response__pack_to_buffer + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse * + opentelemetry__proto__collector__logs__v1__export_logs_service_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *) + protobuf_c_message_unpack (&opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor, + allocator, len, data); +} +void opentelemetry__proto__collector__logs__v1__export_logs_service_response__free_unpacked + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor opentelemetry__proto__collector__logs__v1__export_logs_service_request__field_descriptors[1] = +{ + { + "resource_logs", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest, n_resource_logs), + offsetof(Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest, resource_logs), + &opentelemetry__proto__logs__v1__resource_logs__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned opentelemetry__proto__collector__logs__v1__export_logs_service_request__field_indices_by_name[] = { + 0, /* field[0] = resource_logs */ +}; +static const ProtobufCIntRange opentelemetry__proto__collector__logs__v1__export_logs_service_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest", + "ExportLogsServiceRequest", + "Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest", + "opentelemetry.proto.collector.logs.v1", + sizeof(Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest), + 1, + opentelemetry__proto__collector__logs__v1__export_logs_service_request__field_descriptors, + opentelemetry__proto__collector__logs__v1__export_logs_service_request__field_indices_by_name, + 1, opentelemetry__proto__collector__logs__v1__export_logs_service_request__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__collector__logs__v1__export_logs_service_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define opentelemetry__proto__collector__logs__v1__export_logs_service_response__field_descriptors NULL +#define opentelemetry__proto__collector__logs__v1__export_logs_service_response__field_indices_by_name NULL +#define opentelemetry__proto__collector__logs__v1__export_logs_service_response__number_ranges NULL +const ProtobufCMessageDescriptor opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse", + "ExportLogsServiceResponse", + "Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse", + "opentelemetry.proto.collector.logs.v1", + sizeof(Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse), + 0, + opentelemetry__proto__collector__logs__v1__export_logs_service_response__field_descriptors, + opentelemetry__proto__collector__logs__v1__export_logs_service_response__field_indices_by_name, + 0, opentelemetry__proto__collector__logs__v1__export_logs_service_response__number_ranges, + (ProtobufCMessageInit) opentelemetry__proto__collector__logs__v1__export_logs_service_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCMethodDescriptor opentelemetry__proto__collector__logs__v1__logs_service__method_descriptors[1] = +{ + { "Export", &opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor, &opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor }, +}; +const unsigned opentelemetry__proto__collector__logs__v1__logs_service__method_indices_by_name[] = { + 0 /* Export */ +}; +const ProtobufCServiceDescriptor opentelemetry__proto__collector__logs__v1__logs_service__descriptor = +{ + PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC, + "opentelemetry.proto.collector.logs.v1.LogsService", + "LogsService", + "Opentelemetry__Proto__Collector__Logs__V1__LogsService", + "opentelemetry.proto.collector.logs.v1", + 1, + opentelemetry__proto__collector__logs__v1__logs_service__method_descriptors, + opentelemetry__proto__collector__logs__v1__logs_service__method_indices_by_name +}; +void opentelemetry__proto__collector__logs__v1__logs_service__export(ProtobufCService *service, + const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *input, + Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse_Closure closure, + void *closure_data) +{ + assert(service->descriptor == &opentelemetry__proto__collector__logs__v1__logs_service__descriptor); + service->invoke(service, 0, (const ProtobufCMessage *) input, (ProtobufCClosure) closure, closure_data); +} +void opentelemetry__proto__collector__logs__v1__logs_service__init (Opentelemetry__Proto__Collector__Logs__V1__LogsService_Service *service, + Opentelemetry__Proto__Collector__Logs__V1__LogsService_ServiceDestroy destroy) +{ + protobuf_c_service_generated_init (&service->base, + &opentelemetry__proto__collector__logs__v1__logs_service__descriptor, + (ProtobufCServiceDestroy) destroy); +} \ No newline at end of file diff --git a/plugins/in_opentelemetry/opentelemetry_logs_service.pb-c.h b/plugins/in_opentelemetry/opentelemetry_logs_service.pb-c.h new file mode 100644 index 00000000000..ab774a9b8ea --- /dev/null +++ b/plugins/in_opentelemetry/opentelemetry_logs_service.pb-c.h @@ -0,0 +1,135 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: opentelemetry/proto/collector/logs/v1/logs_service.proto */ + +#ifndef PROTOBUF_C_opentelemetry_2fproto_2fcollector_2flogs_2fv1_2flogs_5fservice_2eproto__INCLUDED +#define PROTOBUF_C_opentelemetry_2fproto_2fcollector_2flogs_2fv1_2flogs_5fservice_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1004000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "opentelemetry_logs.pb-c.h" + +typedef struct Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest; +typedef struct Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest +{ + ProtobufCMessage base; + /* + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + */ + size_t n_resource_logs; + Opentelemetry__Proto__Logs__V1__ResourceLogs **resource_logs; +}; +#define OPENTELEMETRY__PROTO__COLLECTOR__LOGS__V1__EXPORT_LOGS_SERVICE_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor) \ + , 0,NULL } + + +struct Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse +{ + ProtobufCMessage base; +}; +#define OPENTELEMETRY__PROTO__COLLECTOR__LOGS__V1__EXPORT_LOGS_SERVICE_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor) \ + } + + +/* Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest methods */ +void opentelemetry__proto__collector__logs__v1__export_logs_service_request__init + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message); +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_request__get_packed_size + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message); +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_request__pack + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message, + uint8_t *out); +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_request__pack_to_buffer + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message, + ProtobufCBuffer *buffer); +Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest * + opentelemetry__proto__collector__logs__v1__export_logs_service_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void opentelemetry__proto__collector__logs__v1__export_logs_service_request__free_unpacked + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message, + ProtobufCAllocator *allocator); +/* Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse methods */ +void opentelemetry__proto__collector__logs__v1__export_logs_service_response__init + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message); +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_response__get_packed_size + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message); +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_response__pack + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message, + uint8_t *out); +size_t opentelemetry__proto__collector__logs__v1__export_logs_service_response__pack_to_buffer + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message, + ProtobufCBuffer *buffer); +Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse * + opentelemetry__proto__collector__logs__v1__export_logs_service_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void opentelemetry__proto__collector__logs__v1__export_logs_service_response__free_unpacked + (Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest_Closure) + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *message, + void *closure_data); +typedef void (*Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse_Closure) + (const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse *message, + void *closure_data); + +/* --- services --- */ + +typedef struct Opentelemetry__Proto__Collector__Logs__V1__LogsService_Service Opentelemetry__Proto__Collector__Logs__V1__LogsService_Service; +struct Opentelemetry__Proto__Collector__Logs__V1__LogsService_Service +{ + ProtobufCService base; + void (*export)(Opentelemetry__Proto__Collector__Logs__V1__LogsService_Service *service, + const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *input, + Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse_Closure closure, + void *closure_data); +}; +typedef void (*Opentelemetry__Proto__Collector__Logs__V1__LogsService_ServiceDestroy)(Opentelemetry__Proto__Collector__Logs__V1__LogsService_Service *); +void opentelemetry__proto__collector__logs__v1__logs_service__init (Opentelemetry__Proto__Collector__Logs__V1__LogsService_Service *service, + Opentelemetry__Proto__Collector__Logs__V1__LogsService_ServiceDestroy destroy); +#define OPENTELEMETRY__PROTO__COLLECTOR__LOGS__V1__LOGS_SERVICE__BASE_INIT \ + { &opentelemetry__proto__collector__logs__v1__logs_service__descriptor, protobuf_c_service_invoke_internal, NULL } +#define OPENTELEMETRY__PROTO__COLLECTOR__LOGS__V1__LOGS_SERVICE__INIT(function_prefix__) \ + { OPENTELEMETRY__PROTO__COLLECTOR__LOGS__V1__LOGS_SERVICE__BASE_INIT,\ + function_prefix__ ## export } +void opentelemetry__proto__collector__logs__v1__logs_service__export(ProtobufCService *service, + const Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *input, + Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceResponse_Closure closure, + void *closure_data); + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor opentelemetry__proto__collector__logs__v1__export_logs_service_request__descriptor; +extern const ProtobufCMessageDescriptor opentelemetry__proto__collector__logs__v1__export_logs_service_response__descriptor; +extern const ProtobufCServiceDescriptor opentelemetry__proto__collector__logs__v1__logs_service__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_opentelemetry_2fproto_2fcollector_2flogs_2fv1_2flogs_5fservice_2eproto__INCLUDED */ \ No newline at end of file diff --git a/plugins/in_opentelemetry/opentelemetry_prot.c b/plugins/in_opentelemetry/opentelemetry_prot.c index b6e6ee21be6..5ea0aac0cd1 100644 --- a/plugins/in_opentelemetry/opentelemetry_prot.c +++ b/plugins/in_opentelemetry/opentelemetry_prot.c @@ -26,11 +26,16 @@ #include #include +#include "opentelemetry_logs_service.pb-c.h" #include "opentelemetry.h" #include "http_conn.h" +#include "string.h" #define HTTP_CONTENT_JSON 0 +static int otlp_pack_any_value(msgpack_packer *mp_pck, + Opentelemetry__Proto__Common__V1__AnyValue *body); + static int send_response(struct http_conn *conn, int http_status, char *message) { int len; @@ -156,6 +161,335 @@ static int process_payload_traces(struct flb_opentelemetry *ctx, struct http_con return 0; } +static int otel_pack_string(msgpack_packer *mp_pck, char *str) +{ + return msgpack_pack_str_with_body(mp_pck, str, strlen(str)); +} + +static int otel_pack_bool(msgpack_packer *mp_pck, bool val) +{ + if (val) { + return msgpack_pack_true(mp_pck); + } + else { + return msgpack_pack_false(mp_pck); + } +} + +static int otel_pack_int(msgpack_packer *mp_pck, int val) +{ + return msgpack_pack_int64(mp_pck, val); +} + +static int otel_pack_double(msgpack_packer *mp_pck, double val) +{ + return msgpack_pack_double(mp_pck, val); +} + +static int otel_pack_kvlist(msgpack_packer *mp_pck, + Opentelemetry__Proto__Common__V1__KeyValueList *kv_list) +{ + int kv_index; + int ret; + char *key; + Opentelemetry__Proto__Common__V1__AnyValue *value; + + ret = msgpack_pack_map(mp_pck, kv_list->n_values); + if (ret != 0) { + return ret; + } + + for (int kv_index = 0; kv_index < kv_list->n_values && ret == 0; kv_index++) { + key = kv_list->values[kv_index]->key; + value = kv_list->values[kv_index]->value; + + ret = otel_pack_string(mp_pck, key); + + if(ret == 0) { + ret = otlp_pack_any_value(mp_pck, value); + } + } + + return ret; +} + +static int otel_pack_array(msgpack_packer *mp_pck, + Opentelemetry__Proto__Common__V1__ArrayValue *array) +{ + int ret; + int array_index; + + for (array_index = 0; array_index < array->n_values && ret == 0; array_index++) { + ret = otlp_pack_any_value(mp_pck, array->values[array_index]); + } + return ret; +} + +static int otel_pack_bytes(msgpack_packer *mp_pck, + ProtobufCBinaryData bytes) +{ + return msgpack_pack_bin_with_body(mp_pck, bytes.data, bytes.len); +} + +static int otlp_pack_any_value(msgpack_packer *mp_pck, + Opentelemetry__Proto__Common__V1__AnyValue *body) +{ + int result; + + result = -2; + + switch(body->value_case){ + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE: + result = otel_pack_string(mp_pck, body->string_value); + break; + + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_BOOL_VALUE: + result = otel_pack_bool(mp_pck, body->bool_value); + break; + + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_INT_VALUE: + result = otel_pack_int(mp_pck, body->int_value); + break; + + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_DOUBLE_VALUE: + result = otel_pack_double(mp_pck, body->double_value); + break; + + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_ARRAY_VALUE: + result = otel_pack_array(mp_pck, body->array_value); + break; + + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_KVLIST_VALUE: + result = otel_pack_kvlist(mp_pck, body->kvlist_value); + break; + + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_BYTES_VALUE: + result = otel_pack_bytes(mp_pck, body->bytes_value); + break; + + case OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE__NOT_SET: + break; + } + + if (result == -2) { + flb_error("[otel]: invalid value type in pack_any_value"); + result = -1; + } + + return result; +} + +static int binary_payload_to_msgpack(msgpack_packer *mp_pck, + uint8_t *in_buf, + size_t in_size) +{ + int ret; + int resource_logs_index; + int scope_log_index; + int log_record_index; + + Opentelemetry__Proto__Collector__Logs__V1__ExportLogsServiceRequest *input_logs; + Opentelemetry__Proto__Logs__V1__ScopeLogs **scope_logs; + Opentelemetry__Proto__Logs__V1__ScopeLogs *scope_log; + Opentelemetry__Proto__Logs__V1__ResourceLogs **resource_logs; + Opentelemetry__Proto__Logs__V1__ResourceLogs *resource_log; + Opentelemetry__Proto__Logs__V1__LogRecord **log_records; + Opentelemetry__Proto__Logs__V1__LogRecord *log_record; + + input_logs = opentelemetry__proto__collector__logs__v1__export_logs_service_request__unpack(NULL, in_size, in_buf); + if (input_logs == NULL) { + flb_error("[otel] Failed to unpack input logs"); + return -1; + } + + resource_logs = input_logs->resource_logs; + if (resource_logs == NULL) { + flb_error("[otel] No resource logs found"); + return -1; + } + + for (resource_logs_index = 0; resource_logs_index < input_logs->n_resource_logs; resource_logs_index++) { + resource_log = resource_logs[resource_logs_index]; + scope_logs = resource_log->scope_logs; + + if (resource_log->n_scope_logs > 0 && scope_logs == NULL) { + flb_error("[otel] No scope logs found"); + return -1; + } + + for (scope_log_index = 0; scope_log_index < resource_log->n_scope_logs; scope_log_index++) { + scope_log = scope_logs[scope_log_index]; + log_records = scope_log->log_records; + + if (log_records == NULL) { + flb_error("[otel] No log records found"); + return -1; + } + + for (log_record_index=0; log_record_index < scope_log->n_log_records; log_record_index++) { + msgpack_pack_array(mp_pck, 2); + flb_pack_time_now(mp_pck); + + log_record = log_records[log_record_index]; + + ret = otlp_pack_any_value(mp_pck, log_record->body); + + if (ret != 0) { + flb_error("[otel] Failed to convert log record body"); + return -1; + } + } + } + } + return 0; +} + +static int get_token_length(jsmntok_t token){ + return token.end - token.start; +} + +static char *get_value_from_token(jsmntok_t *tokens, + const char *body, + int pos){ + char *tmp; + jsmntok_t token; + int token_len; + + token = tokens[pos]; + token_len = get_token_length(token); + + tmp = flb_calloc(1, token_len + 1); + tmp = memcpy(tmp, body+token.start, token_len); + + return tmp; +} + +static int json_payload_to_msgpack(msgpack_packer *mp_pck, + const char *body, + size_t len) +{ + int n_tokens; + int token_index; + int kv_index; + int result; + + char *key; + char *otel_value_type; + char *otel_log_record; + + jsmn_parser parser; + jsmntok_t tokens[1024]; + jsmntok_t token; + + result = 0; + + jsmn_init(&parser); + n_tokens = jsmn_parse(&parser, body, len, tokens, 1024); + + if (n_tokens < 0) { + flb_error("[otel] Failed to parse JSON payload, jsmn error %d", n_tokens); + return -1; + } + + // position 0 is the root object, skip it + for (token_index = 1; token_index < n_tokens; token_index++) { + token = tokens[token_index]; + + switch (token.type) { + case JSMN_PRIMITIVE: + break; + + case JSMN_OBJECT: + for (kv_index=0; kv_index < token.size; kv_index++) { + key = get_value_from_token(tokens, body, token_index+kv_index+1); + + if (strcmp(key, "body") == 0) { + otel_value_type = get_value_from_token(tokens, body, token_index+kv_index+3); + otel_log_record = get_value_from_token(tokens, body, token_index+kv_index+4); + + msgpack_pack_array(mp_pck, 2); + flb_pack_time_now(mp_pck); + + if (strcasecmp(otel_value_type, "stringvalue") == 0) { + result = otel_pack_string(mp_pck, otel_log_record); + } + + else if (strcasecmp(otel_value_type, "intvalue") == 0) { + result = otel_pack_int(mp_pck, atoi(otel_log_record)); + } + + else if (strcasecmp(otel_value_type, "doublevalue") == 0) { + result = otel_pack_double(mp_pck, atof(otel_log_record)); + } + + else if (strcasecmp(otel_value_type, "boolvalue") == 0) { + if (strcasecmp(otel_log_record, "true") == 0) { + result = otel_pack_boolean(mp_pck, true); + } else { + result = otel_pack_boolean(mp_pck, false); + } + } + + else if (strcasecmp(otel_value_type, "bytesvalue") == 0){ + result = otel_pack_string(mp_pck, body->string_value); + } + } + } + break; + + case JSMN_ARRAY: + break; + + case JSMN_STRING: + break; + } + } + return result; +} + +static int process_payload_logs(struct flb_opentelemetry *ctx, struct http_conn *conn, + flb_sds_t tag, + struct mk_http_session *session, + struct mk_http_request *request) +{ + int ret; + char *out_buf = NULL; + + msgpack_packer mp_pck; + msgpack_sbuffer mp_sbuf; + + msgpack_sbuffer_init(&mp_sbuf); + msgpack_packer_init(&mp_pck, &mp_sbuf, msgpack_sbuffer_write); + + /* Check if the incoming payload is a valid JSON message and convert it to msgpack */ + if (strncasecmp(request->content_type.data, + "application/json", + request->content_type.len) == 0) { + ret = json_payload_to_msgpack(&mp_pck, request->data.data, request->data.len); + } + else if (strncasecmp(request->content_type.data, + "application/x-protobuf", + request->content_type.len) == 0) { + ret = binary_payload_to_msgpack(&mp_pck, (uint8_t *)request->data.data, request->data.len); + } + else { + flb_error("[otel] Unsupported content type %.*s", request->content_type.len, request->content_type.data); + ret = -1; + } + + /* release 'out_buf' if it was allocated */ + if (out_buf) { + flb_free(out_buf); + } + + ctx->ins->event_type = FLB_INPUT_LOGS; + + flb_input_chunk_append_raw(ctx->ins, tag, flb_sds_len(tag), mp_sbuf.data, mp_sbuf.size); + + msgpack_sbuffer_destroy(&mp_sbuf); + return ret; +} + static inline int mk_http_point_header(mk_ptr_t *h, struct mk_http_parser *parser, int key) { @@ -208,7 +542,7 @@ int opentelemetry_prot_handle(struct flb_opentelemetry *ctx, struct http_conn *c uri[request->uri.len] = '\0'; } - if (strcmp(uri, "/v1/metrics") != 0 && strcmp(uri, "/v1/traces") != 0) { + if (strcmp(uri, "/v1/metrics") != 0 && strcmp(uri, "/v1/traces") != 0 && strcmp(uri, "/v1/logs") != 0 ) { send_response(conn, 400, "error: invalid endpoint\n"); mk_mem_free(uri); return -1; @@ -273,12 +607,8 @@ int opentelemetry_prot_handle(struct flb_opentelemetry *ctx, struct http_conn *c request->_content_length.data = NULL; } - if (request->method != MK_METHOD_POST) { - flb_sds_destroy(tag); - mk_mem_free(uri); - send_response(conn, 400, "error: invalid HTTP method\n"); - return -1; - } + /* Content Type */ + mk_http_point_header(&request->content_type, &session->parser, MK_HEADER_CONTENT_TYPE); if (strcmp(uri, "/v1/metrics") == 0) { ret = process_payload_metrics(ctx, conn, tag, session, request); @@ -286,6 +616,9 @@ int opentelemetry_prot_handle(struct flb_opentelemetry *ctx, struct http_conn *c else if (strcmp(uri, "/v1/traces") == 0) { ret = process_payload_traces(ctx, conn, tag, session, request); } + else if (strcmp(uri, "/v1/logs") == 0) { + ret = process_payload_logs(ctx, conn, tag, session, request); + } mk_mem_free(uri); flb_sds_destroy(tag); send_response(conn, ctx->successful_response_code, NULL);