Skip to content
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

Encode enums as numbers in logging OTLP exporters #4783

Merged
merged 1 commit into from Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -43,7 +43,7 @@ public void writeBool(ProtoFieldInfo field, boolean value) throws IOException {

@Override
protected void writeEnum(ProtoFieldInfo field, ProtoEnumInfo enumValue) throws IOException {
generator.writeStringField(field.getJsonName(), enumValue.getJsonName());
generator.writeNumberField(field.getJsonName(), enumValue.getEnumNumber());
}

@Override
Expand Down
Expand Up @@ -110,7 +110,7 @@ void log() throws Exception {
+ " },"
+ " \"logRecords\": [{"
+ " \"timeUnixNano\":\"1631533710000000\","
+ " \"severityNumber\":\"SEVERITY_NUMBER_INFO\","
+ " \"severityNumber\":9,"
+ " \"severityText\":\"INFO\","
+ " \"body\": {"
+ " \"stringValue\":\"body2\""
Expand All @@ -137,7 +137,7 @@ void log() throws Exception {
+ " },"
+ " \"logRecords\": [{"
+ " \"timeUnixNano\":\"1631533710000000\","
+ " \"severityNumber\":\"SEVERITY_NUMBER_INFO\","
+ " \"severityNumber\":9,"
+ " \"severityText\":\"INFO\","
+ " \"body\": {"
+ " \"stringValue\":\"body1\""
Expand Down
Expand Up @@ -122,7 +122,7 @@ void log() throws Exception {
+ " \"timeUnixNano\": \"2\","
+ " \"asDouble\": 4.0"
+ " }],"
+ " \"aggregationTemporality\": \"AGGREGATION_TEMPORALITY_CUMULATIVE\","
+ " \"aggregationTemporality\": 2,"
+ " \"isMonotonic\": true"
+ " }"
+ " }]"
Expand Down Expand Up @@ -151,7 +151,7 @@ void log() throws Exception {
+ " \"timeUnixNano\": \"2\","
+ " \"asDouble\": 4.0"
+ " }],"
+ " \"aggregationTemporality\": \"AGGREGATION_TEMPORALITY_CUMULATIVE\","
+ " \"aggregationTemporality\": 2,"
+ " \"isMonotonic\": true"
+ " }"
+ " }]"
Expand Down
Expand Up @@ -126,11 +126,11 @@ void log() throws Exception {
+ " \"traceId\": \"12340000000043211234000000004321\","
+ " \"spanId\": \"8765000000005678\","
+ " \"name\": \"testSpan2\","
+ " \"kind\": \"SPAN_KIND_CLIENT\","
+ " \"kind\": 3,"
+ " \"startTimeUnixNano\": \"500\","
+ " \"endTimeUnixNano\": \"1501\","
+ " \"status\": {"
+ " \"code\": \"STATUS_CODE_ERROR\""
+ " \"code\": 2"
+ " }"
+ " }]"
+ " }, {"
Expand All @@ -148,7 +148,7 @@ void log() throws Exception {
+ " \"traceId\": \"12345678876543211234567887654321\","
+ " \"spanId\": \"8765432112345678\","
+ " \"name\": \"testSpan1\","
+ " \"kind\": \"SPAN_KIND_INTERNAL\","
+ " \"kind\": 1,"
+ " \"startTimeUnixNano\": \"100\","
+ " \"endTimeUnixNano\": \"1100\","
+ " \"attributes\": [{"
Expand All @@ -173,7 +173,7 @@ void log() throws Exception {
+ " }]"
+ " }],"
+ " \"status\": {"
+ " \"code\": \"STATUS_CODE_OK\""
+ " \"code\": 1"
+ " }"
+ " }]"
+ " }]"
Expand Down