Skip to content

Commit

Permalink
lib: fluent-otel-proto: update generated files and add profiling support
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Sep 27, 2024
1 parent dd53a39 commit 1731923
Show file tree
Hide file tree
Showing 23 changed files with 3,558 additions and 145 deletions.
32 changes: 23 additions & 9 deletions lib/fluent-otel-proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ include(cmake/macros.cmake)
option(FLUENT_PROTO_REGENERATE "Regenerate .[ch] files only" "No")

# build options for files generation
option(FLUENT_PROTO_COMMON "Include common.proto" "Yes")
option(FLUENT_PROTO_RESOURCE "Include resource.proto" "Yes")
option(FLUENT_PROTO_TRACE "Include trace.proto" "Yes")
option(FLUENT_PROTO_LOGS "Include logs.proto" "Yes")
option(FLUENT_PROTO_METRICS "Inlcude metrics.proto" "No")
option(FLUENT_PROTO_EXAMPLES "Add example programs" "Yes")
option(FLUENT_PROTO_COMMON "Include common.proto" "Yes")
option(FLUENT_PROTO_RESOURCE "Include resource.proto" "Yes")
option(FLUENT_PROTO_TRACE "Include trace.proto" "Yes")
option(FLUENT_PROTO_LOGS "Include logs.proto" "Yes")
option(FLUENT_PROTO_METRICS "Inlcude metrics.proto" "Yes")
option(FLUENT_PROTO_PROFILES "Includes profiles proto files" "Yes")
option(FLUENT_PROTO_EXAMPLES "Add example programs" "Yes")

if(FLUENT_PROTO_REGENERATE AND (NOT PROTOBUF_C_SOURCE_DIR OR NOT OTEL_PROTO_DIR))
if (NOT PROTOBUF_C_SOURCE_DIR)
Expand Down Expand Up @@ -86,28 +87,41 @@ if (FLUENT_PROTO_REGENERATE)
set(proto_file "${OTEL_PROTO_DIR}/opentelemetry/proto/logs/v1/logs.proto")
execute_process(COMMAND ${PROTOC_BIN} ${PROTOC_ARG_OUT} ${PROTOC_ARG_PATH} ${proto_file})
include_directories(${PROJECT_BINARY_DIR}/opentelemetry/proto/logs/v1/)
FLUENT_OTEL_DEFINITION(FLUENT_OTEL_HAVE_LOGS)

message(STATUS "processing logs_service.proto")
set(proto_file "${OTEL_PROTO_DIR}/opentelemetry/proto/collector/logs/v1/logs_service.proto")
execute_process(COMMAND ${PROTOC_BIN} ${PROTOC_ARG_OUT} ${PROTOC_ARG_PATH} ${proto_file})
include_directories(${PROJECT_BINARY_DIR}/opentelemetry/proto/collector/logs/v1/)

FLUENT_OTEL_DEFINITION(FLUENT_OTEL_HAVE_LOGS)
endif()

if (FLUENT_PROTO_METRICS)
message(STATUS "processing metrics.proto")
set(proto_file "${OTEL_PROTO_DIR}/opentelemetry/proto/metrics/v1/metrics.proto")
execute_process(COMMAND ${PROTOC_BIN} ${PROTOC_ARG_OUT} ${PROTOC_ARG_PATH} ${proto_file})
include_directories(${PROJECT_BINARY_DIR}/opentelemetry/proto/metrics/v1/)

message(STATUS "processing metrics_service.proto")
set(proto_file "${OTEL_PROTO_DIR}/opentelemetry/proto/collector/metrics/v1/metrics_service.proto")
execute_process(COMMAND ${PROTOC_BIN} ${PROTOC_ARG_OUT} ${PROTOC_ARG_PATH} ${proto_file})
include_directories(${PROJECT_BINARY_DIR}/opentelemetry/proto/collector/logs/v1/)

include_directories(${PROJECT_BINARY_DIR}/opentelemetry/proto/metrics/v1/)
FLUENT_OTEL_DEFINITION(FLUENT_OTEL_HAVE_METRICS)
endif()

if (FLUENT_PROTO_PROFILES)
message(STATUS "processing profiles.proto")
set(proto_file "${OTEL_PROTO_DIR}/opentelemetry/proto/profiles/v1development/profiles.proto")
execute_process(COMMAND ${PROTOC_BIN} ${PROTOC_ARG_OUT} ${PROTOC_ARG_PATH} ${proto_file})

message(STATUS "processing pprofextended.proto")
set(proto_file "${OTEL_PROTO_DIR}/opentelemetry/proto/profiles/v1development/pprofextended.proto")
execute_process(COMMAND ${PROTOC_BIN} ${PROTOC_ARG_OUT} ${PROTOC_ARG_PATH} ${proto_file})

include_directories(${PROJECT_BINARY_DIR}/opentelemetry/proto/profiles/v1development/)
FLUENT_OTEL_DEFINITION(FLUENT_OTEL_HAVE_PROFILES)
endif()

configure_file(
"${PROJECT_SOURCE_DIR}/include/fluent-otel-proto/fluent-otel-info.h.in"
"${PROJECT_SOURCE_DIR}/include/fluent-otel-proto/fluent-otel-info.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef FLUENT_OTEL_INFO_H
#define FLUENT_OTEL_INFO_H

#define FLUENT_OTEL_SOURCE_DIR "/Users/edsiper/coding/fluent-otel-proto"
#define FLUENT_OTEL_SOURCE_DIR "/home/edsiper/c/fluent-otel-proto"

/* General flags set by /CMakeLists.txt */
#ifndef FLUENT_OTEL_HAVE_COMMON
Expand All @@ -35,12 +35,12 @@
#ifndef FLUENT_OTEL_HAVE_LOGS
#define FLUENT_OTEL_HAVE_LOGS
#endif
#ifndef FLUENT_OTEL_HAVE_LOGS
#define FLUENT_OTEL_HAVE_LOGS
#endif
#ifndef FLUENT_OTEL_HAVE_METRICS
#define FLUENT_OTEL_HAVE_METRICS
#endif
#ifndef FLUENT_OTEL_HAVE_PROFILES
#define FLUENT_OTEL_HAVE_PROFILES
#endif


#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* Fluent Bit
* ==========
* Copyright (C) 2022 The Fluent Bit Authors
* Copyright (C) 2022-2024 The Fluent Bit Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_valu
offsetof(Opentelemetry__Proto__Common__V1__AnyValue, string_value),
NULL,
&protobuf_c_empty_string,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
Expand All @@ -255,7 +255,7 @@ static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_valu
offsetof(Opentelemetry__Proto__Common__V1__AnyValue, bool_value),
NULL,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
Expand All @@ -267,7 +267,7 @@ static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_valu
offsetof(Opentelemetry__Proto__Common__V1__AnyValue, int_value),
NULL,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
Expand All @@ -279,7 +279,7 @@ static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_valu
offsetof(Opentelemetry__Proto__Common__V1__AnyValue, double_value),
NULL,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
Expand All @@ -291,7 +291,7 @@ static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_valu
offsetof(Opentelemetry__Proto__Common__V1__AnyValue, array_value),
&opentelemetry__proto__common__v1__array_value__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
Expand All @@ -303,7 +303,7 @@ static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_valu
offsetof(Opentelemetry__Proto__Common__V1__AnyValue, kvlist_value),
&opentelemetry__proto__common__v1__key_value_list__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
Expand All @@ -315,7 +315,7 @@ static const ProtobufCFieldDescriptor opentelemetry__proto__common__v1__any_valu
offsetof(Opentelemetry__Proto__Common__V1__AnyValue, bytes_value),
NULL,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -585,16 +585,16 @@ const ProtobufCEnumDescriptor opentelemetry__proto__logs__v1__severity_number__d
};
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 },
{ "LOG_RECORD_FLAGS_DO_NOT_USE", "OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD_FLAGS__LOG_RECORD_FLAGS_DO_NOT_USE", 0 },
{ "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK", "OPENTELEMETRY__PROTO__LOGS__V1__LOG_RECORD_FLAGS__LOG_RECORD_FLAGS_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 },
{ "LOG_RECORD_FLAGS_DO_NOT_USE", 0 },
{ "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK", 1 },
};
const ProtobufCEnumDescriptor opentelemetry__proto__logs__v1__log_record_flags__descriptor =
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1731923

Please sign in to comment.