-
Notifications
You must be signed in to change notification settings - Fork 1.9k
lib: fluent-otel-proto: update to v0.12 #11601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3e7b021
e991571
5c0525a
c3ae73c
960b7e5
77d7a50
cb15cd3
b23be53
6030840
acdd41a
18d253a
16e420b
8ee89d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,9 @@ static struct cfl_variant *clone_variant(Opentelemetry__Proto__Common__V1__AnyVa | |
| if (source->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE) { | ||
| result_instance = cfl_variant_create_from_string(source->string_value); | ||
| } | ||
| else if (source->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE_STRINDEX) { | ||
| result_instance = cfl_variant_create_from_string(""); | ||
| } | ||
| else if (source->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_BOOL_VALUE) { | ||
| result_instance = cfl_variant_create_from_bool(source->bool_value); | ||
| } | ||
|
|
@@ -154,6 +157,11 @@ static int clone_array_entry(struct cfl_array *target, | |
| struct cfl_variant *new_child_instance; | ||
| int result; | ||
|
|
||
| if (source != NULL && | ||
| source->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE_STRINDEX) { | ||
| return CMT_DECODE_OPENTELEMETRY_SUCCESS; | ||
| } | ||
|
Comment on lines
+160
to
+163
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't drop These branches return success without inserting anything, so arrays lose elements and kvlists lose keys whenever a Also applies to: 207-210 🤖 Prompt for AI Agents |
||
|
|
||
| new_child_instance = clone_variant(source); | ||
| if (new_child_instance == NULL) { | ||
| return CMT_DECODE_OPENTELEMETRY_ALLOCATION_ERROR; | ||
|
|
@@ -183,7 +191,7 @@ static int clone_kvlist(struct cfl_kvlist *target, | |
| result = clone_kvlist_entry(target, source->values[index]); | ||
| } | ||
|
|
||
| return 0; | ||
| return result; | ||
| } | ||
|
|
||
| static int clone_kvlist_entry(struct cfl_kvlist *target, | ||
|
|
@@ -192,6 +200,15 @@ static int clone_kvlist_entry(struct cfl_kvlist *target, | |
| struct cfl_variant *new_child_instance; | ||
| int result; | ||
|
|
||
| if (source == NULL) { | ||
| return CMT_DECODE_OPENTELEMETRY_SUCCESS; | ||
| } | ||
|
|
||
| if (source->value != NULL && | ||
| source->value->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE_STRINDEX) { | ||
| return CMT_DECODE_OPENTELEMETRY_SUCCESS; | ||
| } | ||
|
|
||
| new_child_instance = clone_variant(source->value); | ||
|
|
||
| if (new_child_instance == NULL) { | ||
|
|
@@ -625,6 +642,10 @@ static int decode_data_point_labels(struct cmt *cmt, | |
| if (attribute->value->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE) { | ||
| result = append_new_metric_label_value(metric, attribute->value->string_value, 0); | ||
| } | ||
| else if (attribute->value->value_case == | ||
| OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE_STRINDEX) { | ||
| result = append_new_metric_label_value(metric, "", 0); | ||
| } | ||
| else if (attribute->value->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_BYTES_VALUE) { | ||
| result = append_new_metric_label_value(metric, | ||
| (char *) attribute->value->bytes_value.data, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty-string fallback will merge distinct label and metadata values.
This decoder has no string-table context, so coercing
VALUE_STRING_VALUE_STRINDEXto""silently changes the original value. For labels that can collapse distinct series into the same identity; for metadata it hides the actual payload. Please fail withCMT_DECODE_OPENTELEMETRY_INVALID_ARGUMENT_ERRORuntil real resolution is available.Also applies to: 645-648
🤖 Prompt for AI Agents