Skip to content

Commit

Permalink
Embed Log Body for gogo3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigran Najaryan committed Jun 8, 2020
1 parent a82ce6d commit 793e581
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 70 deletions.
2 changes: 1 addition & 1 deletion encodings/otlp_gogo3/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (g *Generator) GenerateLogBatch(logsPerBatch int, attrsPerLog int) core.Exp
SpanId: core.GenerateSpanID(spanID),
TimeUnixnano: core.TimeToTimestamp(startTime.Add(time.Duration(i) * time.Millisecond)),
ShortName: "auto_generated_event",
Body: &otlpcommon.AnyValue{
Body: otlpcommon.AnyValue{
Value:&otlpcommon.AnyValue_StringValue{
StringValue: fmt.Sprintf("Log message %d of %d, traceid=%q, spanid=%q", i, logsPerBatch, traceID, spanID),
},
Expand Down
131 changes: 63 additions & 68 deletions encodings/otlp_gogo3/logs/v1/logs.pb.go

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

4 changes: 3 additions & 1 deletion encodings/otlp_gogo3/opentelemetry/proto/logs/v1/logs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ syntax = "proto3";

package opentelemetrygogo3.proto.logs.v1;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

import "opentelemetry/proto/common/v1/common.proto";
import "opentelemetry/proto/resource/v1/resource.proto";

Expand Down Expand Up @@ -118,7 +120,7 @@ message LogRecord {
// 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.
opentelemetrygogo3.proto.common.v1.AnyValue body = 8;
opentelemetrygogo3.proto.common.v1.AnyValue body = 8 [(gogoproto.nullable) = false];

// Additional attributes that describe the specific event occurrence. Optional.
repeated opentelemetrygogo3.proto.common.v1.AttributeKeyValue attributes = 9;
Expand Down

0 comments on commit 793e581

Please sign in to comment.