diff --git a/jobs/loggr-forwarder-agent-windows/monit b/jobs/loggr-forwarder-agent-windows/monit index 7410241a4..d56bb879a 100644 --- a/jobs/loggr-forwarder-agent-windows/monit +++ b/jobs/loggr-forwarder-agent-windows/monit @@ -25,6 +25,7 @@ "AGENT_TAGS" => tags.map { |k, v| "#{k}:#{v}" }.join(","), "DOWNSTREAM_INGRESS_PORT_GLOB" => p("downstream_ingress_port_glob"), "EMIT_OTEL_TRACES" => "#{p("temporary_emit_otel_traces")}", + "EMIT_EVENTS_AS_OTEL_LOGS" => "#{p("emit_events_as_otel_logs")}", "METRICS_PORT" => "#{p("metrics.port")}", "METRICS_CA_FILE_PATH" => "#{certs_dir}/metrics_ca.crt", "METRICS_CERT_FILE_PATH" => "#{certs_dir}/metrics.crt", diff --git a/jobs/loggr-forwarder-agent-windows/spec b/jobs/loggr-forwarder-agent-windows/spec index 41816d805..66dfc6708 100644 --- a/jobs/loggr-forwarder-agent-windows/spec +++ b/jobs/loggr-forwarder-agent-windows/spec @@ -38,6 +38,10 @@ properties: description: "Whether to emit traces to OpenTelemetry Collector downstream consumers" default: false + emit_events_as_otel_logs: + description: "Whether to emit events as logs to OpenTelemetry Collector downstream consumers" + default: false + tls.ca_cert: description: | TLS loggregator root CA certificate. It is required for key/cert diff --git a/jobs/loggr-forwarder-agent/spec b/jobs/loggr-forwarder-agent/spec index e72576559..5138e37cb 100644 --- a/jobs/loggr-forwarder-agent/spec +++ b/jobs/loggr-forwarder-agent/spec @@ -38,6 +38,10 @@ properties: description: "Whether to emit traces to OpenTelemetry Collector downstream consumers" default: false + emit_events_as_otel_logs: + description: "Whether to emit events as logs to OpenTelemetry Collector downstream consumers" + default: false + tls.ca_cert: description: | TLS loggregator root CA certificate. It is required for key/cert diff --git a/jobs/loggr-forwarder-agent/templates/bpm.yml.erb b/jobs/loggr-forwarder-agent/templates/bpm.yml.erb index ddb5309b8..3aa4a13e0 100644 --- a/jobs/loggr-forwarder-agent/templates/bpm.yml.erb +++ b/jobs/loggr-forwarder-agent/templates/bpm.yml.erb @@ -30,6 +30,7 @@ "DOWNSTREAM_INGRESS_PORT_GLOB" => p("downstream_ingress_port_glob"), "EMIT_OTEL_TRACES" => p("temporary_emit_otel_traces"), + "EMIT_EVENTS_AS_OTEL_LOGS" => p("emit_events_as_otel_logs"), "METRICS_PORT" => "#{p("metrics.port")}", "METRICS_CA_FILE_PATH" => "#{certs_dir}/metrics_ca.crt", diff --git a/src/cmd/forwarder-agent/app/app_suite_test.go b/src/cmd/forwarder-agent/app/app_suite_test.go index 46db976cf..8541c0ec5 100644 --- a/src/cmd/forwarder-agent/app/app_suite_test.go +++ b/src/cmd/forwarder-agent/app/app_suite_test.go @@ -19,6 +19,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/types" + collogspb "go.opentelemetry.io/proto/otlp/collector/logs/v1" colmetricspb "go.opentelemetry.io/proto/otlp/collector/metrics/v1" coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1" "google.golang.org/grpc" @@ -328,3 +329,63 @@ func (s *spyOtelColTraceServer) Export(_ context.Context, req *coltracepb.Export func (s *spyOtelColTraceServer) close() { s.srv.Stop() } + +// A fake OTel Collector logs gRPC server that captures requests made to it. +type spyOtelColLogServer struct { + collogspb.UnimplementedLogsServiceServer + + srv *grpc.Server + addr string + + requests chan *collogspb.ExportLogsServiceRequest +} + +// Creates a spyOtelColLogServer, starts it listening on a random port, +// registers it as a gRPC service, and writes out a temp file for the forwarder +// agent to recognize it as a destination. The cfgPath it accepts is the folder +// under which to write the temp file. +func startSpyOtelColLogServer(cfgPath string, tc *testhelper.TestCerts, commonName string) *spyOtelColLogServer { + serverCreds, err := plumbing.NewServerCredentials( + tc.Cert(commonName), + tc.Key(commonName), + tc.CA(), + ) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + lis, err := net.Listen("tcp", "127.0.0.1:") + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + s := &spyOtelColLogServer{ + srv: grpc.NewServer(grpc.Creds(serverCreds)), + requests: make(chan *collogspb.ExportLogsServiceRequest, 10000), + addr: lis.Addr().String(), + } + + collogspb.RegisterLogsServiceServer(s.srv, s) + go s.srv.Serve(lis) //nolint:errcheck + + port, err := strconv.Atoi(strings.Split(s.addr, ":")[1]) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + dir, err := os.MkdirTemp(cfgPath, "") + ExpectWithOffset(1, err).ToNot(HaveOccurred()) + tmpfn := filepath.Join(dir, "ingress_port.yml") + + contents := fmt.Sprintf(`--- +ingress: %d +protocol: otelcol +`, port) + err = os.WriteFile(tmpfn, []byte(contents), 0600) + ExpectWithOffset(1, err).ToNot(HaveOccurred()) + + return s +} + +func (s *spyOtelColLogServer) Export(_ context.Context, req *collogspb.ExportLogsServiceRequest) (*collogspb.ExportLogsServiceResponse, error) { + s.requests <- req + return &collogspb.ExportLogsServiceResponse{}, nil +} + +func (s *spyOtelColLogServer) close() { + s.srv.Stop() +} diff --git a/src/cmd/forwarder-agent/app/config.go b/src/cmd/forwarder-agent/app/config.go index 54daa6120..e11e90d02 100644 --- a/src/cmd/forwarder-agent/app/config.go +++ b/src/cmd/forwarder-agent/app/config.go @@ -30,6 +30,7 @@ type Config struct { Tags map[string]string `env:"AGENT_TAGS"` DebugMetrics bool `env:"DEBUG_METRICS, report"` EmitOTelTraces bool `env:"EMIT_OTEL_TRACES, report"` + EmitEventsAsOTelLogs bool `env:"EMIT_EVENTS_AS_OTEL_LOGS, report"` } // LoadConfig will load the configuration for the forwarder agent from the diff --git a/src/cmd/forwarder-agent/app/forwarder_agent.go b/src/cmd/forwarder-agent/app/forwarder_agent.go index f2e8da0e9..14c3c58dd 100644 --- a/src/cmd/forwarder-agent/app/forwarder_agent.go +++ b/src/cmd/forwarder-agent/app/forwarder_agent.go @@ -42,6 +42,7 @@ type ForwarderAgent struct { tags map[string]string debugMetrics bool emitOTelTraces bool + emitEventsAsOTelLogs bool } type Metrics interface { @@ -73,6 +74,7 @@ func NewForwarderAgent( tags: cfg.Tags, debugMetrics: cfg.MetricsServer.DebugMetrics, emitOTelTraces: cfg.EmitOTelTraces, + emitEventsAsOTelLogs: cfg.EmitEventsAsOTelLogs, } } @@ -96,7 +98,7 @@ func (s *ForwarderAgent) Run() { })) dests := downstreamDestinations(s.downstreamFilePattern, s.log) - writers := downstreamWriters(dests, s.grpc, s.m, s.emitOTelTraces, s.log) + writers := downstreamWriters(dests, s.grpc, s.m, s.emitOTelTraces, s.emitEventsAsOTelLogs, s.log) tagger := egress_v2.NewTagger(s.tags) ew := egress_v2.NewEnvelopeWriter( multiWriter{writers: writers}, @@ -209,13 +211,13 @@ func downstreamDestinations(pattern string, l *log.Logger) []destination { return dests } -func downstreamWriters(dests []destination, grpc GRPC, m Metrics, emitOTelTraces bool, l *log.Logger) []Writer { +func downstreamWriters(dests []destination, grpc GRPC, m Metrics, emitOTelTraces, emitEventsAsOTelLogs bool, l *log.Logger) []Writer { var writers []Writer for _, d := range dests { var w Writer switch d.Protocol { case "otelcol": - w = otelCollectorClient(d, grpc, m, emitOTelTraces, l) + w = otelCollectorClient(d, grpc, m, emitOTelTraces, emitEventsAsOTelLogs, l) default: w = loggregatorClient(d, grpc, m, l) } @@ -224,7 +226,7 @@ func downstreamWriters(dests []destination, grpc GRPC, m Metrics, emitOTelTraces return writers } -func otelCollectorClient(dest destination, grpc GRPC, m Metrics, emitTraces bool, l *log.Logger) Writer { +func otelCollectorClient(dest destination, grpc GRPC, m Metrics, emitTraces, emitEvents bool, l *log.Logger) Writer { clientCreds, err := tlsconfig.Build( tlsconfig.WithInternalServiceDefaults(), tlsconfig.WithIdentityFromFile(grpc.CertFile, grpc.KeyFile), @@ -252,7 +254,7 @@ func otelCollectorClient(dest destination, grpc GRPC, m Metrics, emitTraces bool }), ) - dw := egress.NewDiodeWriter(context.Background(), otelcolclient.New(w, emitTraces), gendiodes.AlertFunc(func(missed int) { + dw := egress.NewDiodeWriter(context.Background(), otelcolclient.New(w, emitTraces, emitEvents), gendiodes.AlertFunc(func(missed int) { expired.Add(float64(missed)) }), timeoutwaitgroup.New(time.Minute)) diff --git a/src/cmd/forwarder-agent/app/forwarder_agent_test.go b/src/cmd/forwarder-agent/app/forwarder_agent_test.go index 4ee521813..2f18a9a72 100644 --- a/src/cmd/forwarder-agent/app/forwarder_agent_test.go +++ b/src/cmd/forwarder-agent/app/forwarder_agent_test.go @@ -11,6 +11,7 @@ import ( "time" "code.cloudfoundry.org/loggregator-agent-release/src/pkg/config" + collogspb "go.opentelemetry.io/proto/otlp/collector/logs/v1" colmetricspb "go.opentelemetry.io/proto/otlp/collector/metrics/v1" coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1" @@ -353,20 +354,38 @@ var _ = Describe("App", func() { var ( otelMetricsServer *spyOtelColMetricServer otelTraceServer *spyOtelColTraceServer + otelLogsServer *spyOtelColLogServer ) BeforeEach(func() { otelMetricsServer = startSpyOtelColMetricServer(ingressCfgPath, agentCerts, "otel-collector") otelTraceServer = startSpyOtelColTraceServer(ingressCfgPath, agentCerts, "otel-collector") + otelLogsServer = startSpyOtelColLogServer(ingressCfgPath, agentCerts, "otel-collector") agentCfg.EmitOTelTraces = true + agentCfg.EmitEventsAsOTelLogs = true + }) + + JustBeforeEach(func() { + // Because the event being sent JustBeforeEach in the main test, channels need to be emptied + for len(otelMetricsServer.requests) > 0 { + <-otelMetricsServer.requests + } + for len(otelTraceServer.requests) > 0 { + <-otelTraceServer.requests + } + // test-title events + for len(otelLogsServer.requests) > 0 { + <-otelLogsServer.requests + } }) AfterEach(func() { otelMetricsServer.close() otelTraceServer.close() + otelLogsServer.close() }) - DescribeTable("some envelopes are not forwarded", + DescribeTable("do not forward log nor event envelopes to otel metrics", func(e *loggregator_v2.Envelope) { ingressClient.Emit(e) Consistently(otelMetricsServer.requests, 3).ShouldNot(Receive()) @@ -375,6 +394,16 @@ var _ = Describe("App", func() { Entry("drops events", &loggregator_v2.Envelope{Message: &loggregator_v2.Envelope_Event{}}), ) + DescribeTable("do not forward counters, gagues nor timers envelopes to otel logs", + func(e *loggregator_v2.Envelope) { + ingressClient.Emit(e) + Consistently(otelLogsServer.requests, 3).ShouldNot(Receive()) + }, + Entry("drops counters", &loggregator_v2.Envelope{Message: &loggregator_v2.Envelope_Counter{}}), + Entry("drops gauges", &loggregator_v2.Envelope{Message: &loggregator_v2.Envelope_Gauge{}}), + Entry("drops timers", &loggregator_v2.Envelope{Message: &loggregator_v2.Envelope_Timer{}}), + ) + It("forwards counters", func() { name := "test-counter-name" ingressClient.EmitCounter(name) @@ -408,6 +437,76 @@ var _ = Describe("App", func() { Expect(trace.GetName()).To(Equal(name)) }) + It("forwards logs", func() { + body := "test log body" + ingressClient.EmitLog(body, loggregator.WithStdout()) + + var req *collogspb.ExportLogsServiceRequest + Eventually(otelLogsServer.requests).Should(Receive(&req)) + + log := req.ResourceLogs[0].ScopeLogs[0].LogRecords[0] + Expect(log.GetBody().GetStringValue()).To(Equal(body)) + }) + + It("forwards events", func() { + title := "event title" + body := "event body" + err := ingressClient.EmitEvent(context.TODO(), title, body) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + var req *collogspb.ExportLogsServiceRequest + Eventually(otelLogsServer.requests).Should(Receive(&req)) + + log := req.ResourceLogs[0].ScopeLogs[0].LogRecords[0] + Expect(len(log.GetBody().GetKvlistValue().GetValues())).To(Equal(2)) + for _, v := range log.GetBody().GetKvlistValue().GetValues() { + switch v.GetKey() { + case "title": + Expect(v.GetValue().GetStringValue()).To(Equal(title)) + case "body": + Expect(v.GetValue().GetStringValue()).To(Equal(body)) + default: + Expect(v.GetKey()).ToNot(HaveOccurred()) + } + } + }) + + Context("when support for forwarding events as traces is not active", func() { + BeforeEach(func() { + agentCfg.EmitEventsAsOTelLogs = false + }) + + It("only emits events to other destinations", func() { + ctx, cancel := context.WithCancel(context.Background()) + var wg sync.WaitGroup + defer wg.Wait() + defer cancel() + + wg.Add(1) + go func() { + defer wg.Done() + + ticker := time.NewTicker(10 * time.Millisecond) + for { + select { + case <-ctx.Done(): + ticker.Stop() + return + case <-ticker.C: + err := ingressClient.EmitEvent(context.TODO(), "title", "event body") + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + } + } + }() + + var e *loggregator_v2.Envelope + Eventually(ingressServer1.envelopes, 5).Should(Receive(&e)) + Expect(e.GetEvent().GetTitle()).To(Equal("title")) + Expect(e.GetEvent().GetBody()).To(Equal("event body")) + Consistently(otelLogsServer.requests, 5).ShouldNot(Receive()) + }) + }) + Context("when support for forwarding timers as traces is not active", func() { BeforeEach(func() { agentCfg.EmitOTelTraces = false diff --git a/src/pkg/otelcolclient/otelcolclient.go b/src/pkg/otelcolclient/otelcolclient.go index 320b4e723..3df500607 100644 --- a/src/pkg/otelcolclient/otelcolclient.go +++ b/src/pkg/otelcolclient/otelcolclient.go @@ -12,9 +12,11 @@ import ( "time" "code.cloudfoundry.org/go-loggregator/v9/rpc/loggregator_v2" + collogspb "go.opentelemetry.io/proto/otlp/collector/logs/v1" colmetricspb "go.opentelemetry.io/proto/otlp/collector/metrics/v1" coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1" commonpb "go.opentelemetry.io/proto/otlp/common/v1" + logspb "go.opentelemetry.io/proto/otlp/logs/v1" metricspb "go.opentelemetry.io/proto/otlp/metrics/v1" tracepb "go.opentelemetry.io/proto/otlp/trace/v1" "google.golang.org/grpc" @@ -28,6 +30,9 @@ type GRPCWriter struct { // The client API for the OTel Collector trace service tsc coltracepb.TraceServiceClient + // The client API for the OTel Collector logs service + lsc collogspb.LogsServiceClient + // Context passed to gRPC ctx context.Context @@ -49,6 +54,7 @@ func NewGRPCWriter(addr string, tlsConfig *tls.Config, l *log.Logger) (*GRPCWrit w := &GRPCWriter{ msc: colmetricspb.NewMetricsServiceClient(cc), tsc: coltracepb.NewTraceServiceClient(cc), + lsc: collogspb.NewLogsServiceClient(cc), ctx: ctx, cancel: cancel, l: l, @@ -56,6 +62,18 @@ func NewGRPCWriter(addr string, tlsConfig *tls.Config, l *log.Logger) (*GRPCWrit return w, nil } +func (w GRPCWriter) WriteLogs(batch []*logspb.ResourceLogs) { + resp, err := w.lsc.Export(w.ctx, &collogspb.ExportLogsServiceRequest{ + ResourceLogs: batch, + }) + if err == nil { + err = errorOnLogsRejection(resp) + } + if err != nil { + w.l.Println("Write error:", err) + } +} + func (w GRPCWriter) WriteMetrics(batch []*metricspb.Metric) { resp, err := w.msc.Export(w.ctx, &colmetricspb.ExportMetricsServiceRequest{ ResourceMetrics: []*metricspb.ResourceMetrics{ @@ -71,7 +89,6 @@ func (w GRPCWriter) WriteMetrics(batch []*metricspb.Metric) { if err == nil { err = errorOnRejection(resp) } - if err != nil { w.l.Println("Write error:", err) } @@ -84,7 +101,6 @@ func (w GRPCWriter) WriteTrace(batch []*tracepb.ResourceSpans) { if err == nil { err = errorOnTraceRejection(resp) } - if err != nil { w.l.Println("Write error:", err) } @@ -100,13 +116,16 @@ type Client struct { b *SignalBatcher // Forward timers as traces emitTraces bool + // Forward events as logs + emitEvents bool } -// New creates a new Client that will batch metrics. -func New(w Writer, emitTraces bool) *Client { +// New creates a new Client that will batch metrics and logs. +func New(w Writer, emitTraces bool, emitEvents bool) *Client { return &Client{ b: NewSignalBatcher(100, 100*time.Millisecond, w), emitTraces: emitTraces, + emitEvents: emitEvents, } } @@ -120,8 +139,11 @@ func (c *Client) Write(e *loggregator_v2.Envelope) error { c.writeGauge(e) case *loggregator_v2.Envelope_Timer: c.writeTimer(e) + case *loggregator_v2.Envelope_Log: + c.writeLog(e) + case *loggregator_v2.Envelope_Event: + c.writeEvent(e) } - return nil } @@ -131,6 +153,76 @@ func (c *Client) Close() error { return c.b.w.Close() } +// writeCounter translates a loggregator v2 Counter to OTLP and adds the metric to the pending batch. +func (c *Client) writeLog(e *loggregator_v2.Envelope) { + atts := attributes(e) + svrtyNumber := logspb.SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED + switch e.GetLog().GetType() { + case loggregator_v2.Log_OUT: + svrtyNumber = logspb.SeverityNumber_SEVERITY_NUMBER_INFO + case loggregator_v2.Log_ERR: + svrtyNumber = logspb.SeverityNumber_SEVERITY_NUMBER_ERROR + } + c.b.WriteLog(&logspb.ResourceLogs{ + ScopeLogs: []*logspb.ScopeLogs{ + { + LogRecords: []*logspb.LogRecord{ + { + TimeUnixNano: uint64(e.GetTimestamp()), + Attributes: atts, + ObservedTimeUnixNano: uint64(time.Now().UnixNano()), + SeverityText: svrtyNumber.String(), + SeverityNumber: svrtyNumber, + Body: &commonpb.AnyValue{ + Value: &commonpb.AnyValue_StringValue{ + StringValue: string(e.GetLog().GetPayload()), + }, + }, + }, + }, + }, + }, + }) +} + +func (c *Client) writeEvent(e *loggregator_v2.Envelope) { + if !c.emitEvents { + return + } + atts := attributes(e) + body := e.GetEvent().GetBody() + title := e.GetEvent().GetTitle() + c.b.WriteLog(&logspb.ResourceLogs{ + ScopeLogs: []*logspb.ScopeLogs{ + { + LogRecords: []*logspb.LogRecord{ + { + TimeUnixNano: uint64(e.GetTimestamp()), + Attributes: atts, + ObservedTimeUnixNano: uint64(time.Now().UnixNano()), + Body: &commonpb.AnyValue{ + Value: &commonpb.AnyValue_KvlistValue{ + KvlistValue: &commonpb.KeyValueList{ + Values: []*commonpb.KeyValue{ + { + Key: "title", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: title}}, + }, + { + Key: "body", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: body}}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }) +} + // writeCounter translates a loggregator v2 Counter to OTLP and adds the metric to the pending batch. func (c *Client) writeCounter(e *loggregator_v2.Envelope) { atts := attributes(e) @@ -247,6 +339,13 @@ func errorOnTraceRejection(r *coltracepb.ExportTraceServiceResponse) error { return nil } +func errorOnLogsRejection(r *collogspb.ExportLogsServiceResponse) error { + if ps := r.GetPartialSuccess(); ps != nil && ps.GetRejectedLogRecords() > 0 { + return errors.New(ps.GetErrorMessage()) + } + return nil +} + // attributes converts envelope tags to OTel key/value attributes. func attributes(e *loggregator_v2.Envelope) []*commonpb.KeyValue { atts := []*commonpb.KeyValue{ diff --git a/src/pkg/otelcolclient/otelcolclient_test.go b/src/pkg/otelcolclient/otelcolclient_test.go index b10c8983c..2f3535c74 100644 --- a/src/pkg/otelcolclient/otelcolclient_test.go +++ b/src/pkg/otelcolclient/otelcolclient_test.go @@ -11,9 +11,11 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + collogspb "go.opentelemetry.io/proto/otlp/collector/logs/v1" colmetricspb "go.opentelemetry.io/proto/otlp/collector/metrics/v1" coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1" commonpb "go.opentelemetry.io/proto/otlp/common/v1" + logspb "go.opentelemetry.io/proto/otlp/logs/v1" metricspb "go.opentelemetry.io/proto/otlp/metrics/v1" tracepb "go.opentelemetry.io/proto/otlp/trace/v1" "google.golang.org/grpc" @@ -26,6 +28,7 @@ var _ = Describe("Client", func() { b *SignalBatcher spyMSC *spyMetricsServiceClient spyTSC *spyTraceServiceClient + spyLSC *spyLogsServiceClient buf *gbytes.Buffer ) @@ -42,11 +45,16 @@ var _ = Describe("Client", func() { response: &coltracepb.ExportTraceServiceResponse{}, responseErr: nil, } - + spyLSC = &spyLogsServiceClient{ + requests: make(chan *collogspb.ExportLogsServiceRequest, 1), + response: &collogspb.ExportLogsServiceResponse{}, + responseErr: nil, + } ctx, cancel := context.WithCancel(context.Background()) w := GRPCWriter{ msc: spyMSC, tsc: spyTSC, + lsc: spyLSC, ctx: ctx, cancel: cancel, l: log.New(GinkgoWriter, "", 0), @@ -56,7 +64,7 @@ var _ = Describe("Client", func() { 100*time.Millisecond, w, ) - c = Client{b: b, emitTraces: true} + c = Client{b: b, emitTraces: true, emitEvents: true} }) AfterEach(func() { @@ -716,33 +724,238 @@ var _ = Describe("Client", func() { }) }) - Context("when given a log", func() { + Context("when given a stdout log", func() { BeforeEach(func() { - envelope = &loggregator_v2.Envelope{Message: &loggregator_v2.Envelope_Log{}} + envelope = &loggregator_v2.Envelope{ + Timestamp: 1257894000000000000, + SourceId: "fake-source-id", + InstanceId: "fake-instance-id", + Tags: map[string]string{ + "direction": "egress", + "origin": "fake-origin.some-vm", + }, + Message: &loggregator_v2.Envelope_Log{ + Log: &loggregator_v2.Log{ + Payload: []byte("log message"), + Type: loggregator_v2.Log_OUT, + }, + }, + } }) It("returns nil", func() { Expect(returnedErr).NotTo(HaveOccurred()) }) - It("does nothing", func() { - Expect(spyMSC.requests).NotTo(Receive()) - Consistently(buf.Contents()).Should(HaveLen(0)) + It("emits an info log", func() { + var lsr *collogspb.ExportLogsServiceRequest + Expect(spyLSC.requests).To(Receive(&lsr)) + + expectedReq := &collogspb.ExportLogsServiceRequest{ + ResourceLogs: []*logspb.ResourceLogs{ + { + ScopeLogs: []*logspb.ScopeLogs{ + { + LogRecords: []*logspb.LogRecord{ + { + ObservedTimeUnixNano: uint64(time.Now().UnixNano()), + TimeUnixNano: uint64(1257894000000000000), + SeverityText: logspb.SeverityNumber_SEVERITY_NUMBER_INFO.String(), + SeverityNumber: logspb.SeverityNumber_SEVERITY_NUMBER_INFO, + Body: &commonpb.AnyValue{ + Value: &commonpb.AnyValue_StringValue{ + StringValue: "log message", + }, + }, + Attributes: []*commonpb.KeyValue{ + { + Key: "direction", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "egress"}}, + }, + { + Key: "instance_id", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-instance-id"}}, + }, + { + Key: "origin", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-origin.some-vm"}}, + }, + { + Key: "source_id", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-source-id"}}, + }, + }, + }, + }, + }, + }, + }, + }, + } + dict := protocmp.SortRepeated(func(x *commonpb.KeyValue, y *commonpb.KeyValue) bool { + return x.Key < y.Key + }) + Expect(lsr.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano).NotTo(BeZero()) + expectedReq.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano = lsr.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano + Expect(cmp.Diff(lsr, expectedReq, protocmp.Transform(), dict)).To(BeEmpty()) }) }) - Context("when given an event", func() { + Context("when given a stderr log", func() { BeforeEach(func() { - envelope = &loggregator_v2.Envelope{Message: &loggregator_v2.Envelope_Event{}} + envelope = &loggregator_v2.Envelope{ + Timestamp: 1257894000000000000, + SourceId: "fake-source-id", + InstanceId: "fake-instance-id", + Tags: map[string]string{ + "direction": "egress", + "origin": "fake-origin.some-vm", + }, + Message: &loggregator_v2.Envelope_Log{ + Log: &loggregator_v2.Log{ + Payload: []byte("log error message"), + Type: loggregator_v2.Log_ERR, + }, + }, + } }) It("returns nil", func() { Expect(returnedErr).NotTo(HaveOccurred()) }) - It("does nothing", func() { - Expect(spyMSC.requests).NotTo(Receive()) - Consistently(buf.Contents()).Should(HaveLen(0)) + It("emits an error log", func() { + var lsr *collogspb.ExportLogsServiceRequest + Expect(spyLSC.requests).To(Receive(&lsr)) + + expectedReq := &collogspb.ExportLogsServiceRequest{ + ResourceLogs: []*logspb.ResourceLogs{ + { + ScopeLogs: []*logspb.ScopeLogs{ + { + LogRecords: []*logspb.LogRecord{ + { + ObservedTimeUnixNano: uint64(time.Now().UnixNano()), + TimeUnixNano: uint64(1257894000000000000), + SeverityText: logspb.SeverityNumber_SEVERITY_NUMBER_ERROR.String(), + SeverityNumber: logspb.SeverityNumber_SEVERITY_NUMBER_ERROR, + Body: &commonpb.AnyValue{ + Value: &commonpb.AnyValue_StringValue{ + StringValue: "log error message", + }, + }, + Attributes: []*commonpb.KeyValue{ + { + Key: "direction", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "egress"}}, + }, + { + Key: "instance_id", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-instance-id"}}, + }, + { + Key: "origin", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-origin.some-vm"}}, + }, + { + Key: "source_id", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-source-id"}}, + }, + }, + }, + }, + }, + }, + }, + }, + } + dict := protocmp.SortRepeated(func(x *commonpb.KeyValue, y *commonpb.KeyValue) bool { + return x.Key < y.Key + }) + Expect(lsr.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano).NotTo(BeZero()) + expectedReq.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano = lsr.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano + Expect(cmp.Diff(lsr, expectedReq, protocmp.Transform(), dict)).To(BeEmpty()) + }) + }) + + Context("when given event", func() { + BeforeEach(func() { + envelope = &loggregator_v2.Envelope{ + Timestamp: 1257894000000000000, + SourceId: "fake-source-id", + InstanceId: "fake-instance-id", + Tags: map[string]string{ + "origin": "fake-origin.some-vm", + }, + Message: &loggregator_v2.Envelope_Event{ + Event: &loggregator_v2.Event{ + Title: "event title", + Body: "event body", + }, + }, + } + }) + + It("returns nil", func() { + Expect(returnedErr).NotTo(HaveOccurred()) + }) + + It("emits an event log", func() { + var lsr *collogspb.ExportLogsServiceRequest + Expect(spyLSC.requests).To(Receive(&lsr)) + + expectedReq := &collogspb.ExportLogsServiceRequest{ + ResourceLogs: []*logspb.ResourceLogs{ + { + ScopeLogs: []*logspb.ScopeLogs{ + { + LogRecords: []*logspb.LogRecord{ + { + ObservedTimeUnixNano: uint64(time.Now().UnixNano()), + TimeUnixNano: uint64(1257894000000000000), + Body: &commonpb.AnyValue{ + Value: &commonpb.AnyValue_KvlistValue{ + KvlistValue: &commonpb.KeyValueList{ + Values: []*commonpb.KeyValue{ + { + Key: "title", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "event title"}}, + }, + { + Key: "body", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "event body"}}, + }, + }, + }, + }, + }, + Attributes: []*commonpb.KeyValue{ + { + Key: "instance_id", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-instance-id"}}, + }, + { + Key: "origin", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-origin.some-vm"}}, + }, + { + Key: "source_id", + Value: &commonpb.AnyValue{Value: &commonpb.AnyValue_StringValue{StringValue: "fake-source-id"}}, + }, + }, + }, + }, + }, + }, + }, + }, + } + dict := protocmp.SortRepeated(func(x *commonpb.KeyValue, y *commonpb.KeyValue) bool { + return x.Key < y.Key + }) + Expect(lsr.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano).NotTo(BeZero()) + expectedReq.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano = lsr.ResourceLogs[0].ScopeLogs[0].LogRecords[0].ObservedTimeUnixNano + Expect(cmp.Diff(lsr, expectedReq, protocmp.Transform(), dict)).To(BeEmpty()) }) }) @@ -827,6 +1040,19 @@ func (c *spyMetricsServiceClient) Export(ctx context.Context, in *colmetricspb.E return c.response, c.responseErr } +type spyLogsServiceClient struct { + requests chan *collogspb.ExportLogsServiceRequest + response *collogspb.ExportLogsServiceResponse + responseErr error + ctx context.Context +} + +func (c *spyLogsServiceClient) Export(ctx context.Context, in *collogspb.ExportLogsServiceRequest, opts ...grpc.CallOption) (*collogspb.ExportLogsServiceResponse, error) { + c.requests <- in + c.ctx = ctx + return c.response, c.responseErr +} + type spyTraceServiceClient struct { requests chan *coltracepb.ExportTraceServiceRequest response *coltracepb.ExportTraceServiceResponse diff --git a/src/pkg/otelcolclient/signal_batcher.go b/src/pkg/otelcolclient/signal_batcher.go index 285fdf090..82cecc039 100644 --- a/src/pkg/otelcolclient/signal_batcher.go +++ b/src/pkg/otelcolclient/signal_batcher.go @@ -5,15 +5,16 @@ import ( "time" "code.cloudfoundry.org/go-batching" + logspb "go.opentelemetry.io/proto/otlp/logs/v1" metricspb "go.opentelemetry.io/proto/otlp/metrics/v1" tracepb "go.opentelemetry.io/proto/otlp/trace/v1" ) // SignalBatcher batches OpenTelemetry signals. type SignalBatcher struct { - metricsBatcher, traceBatcher *batching.Batcher - w Writer - mu sync.Mutex + metricsBatcher, traceBatcher, logsBatcher *batching.Batcher + w Writer + mu sync.Mutex } // Writer is used to submit the completed batches of OpenTelemetry signals. The @@ -23,6 +24,8 @@ type Writer interface { WriteMetrics(batch []*metricspb.Metric) // WriteTrace submits the batch. WriteTrace(batch []*tracepb.ResourceSpans) + // WriteLogs submits the batch. + WriteLogs(batch []*logspb.ResourceLogs) Close() error } @@ -42,10 +45,17 @@ func NewSignalBatcher(size int, interval time.Duration, writer Writer) *SignalBa } writer.WriteTrace(envBatch) }) - + logsWriter := batching.WriterFunc(func(batch []any) { + envBatch := make([]*logspb.ResourceLogs, 0, len(batch)) + for _, element := range batch { + envBatch = append(envBatch, element.(*logspb.ResourceLogs)) + } + writer.WriteLogs(envBatch) + }) sb := &SignalBatcher{ metricsBatcher: batching.NewBatcher(size, interval, metricsWriter), traceBatcher: batching.NewBatcher(size, interval, traceWriter), + logsBatcher: batching.NewBatcher(size, interval, logsWriter), w: writer, } go func() { @@ -75,8 +85,17 @@ func (b *SignalBatcher) WriteTrace(data *tracepb.ResourceSpans) { b.traceBatcher.Write(data) } +// WriteLogs stores data to the log batch. It will not submit the batch to +// the writer until either the batch has been filled, or the interval has +// lapsed. +func (b *SignalBatcher) WriteLog(data *logspb.ResourceLogs) { + b.mu.Lock() + defer b.mu.Unlock() + b.logsBatcher.Write(data) +} + // Flush will write a partial batch if there is data and the interval has -// lapsed. Otherwise it is a NOP. This method should be called freqently to +// lapsed. Otherwise it is a NOP. This method should be called frequently to // make sure batches do not stick around for long periods of time. As a result // it would be a bad idea to call Flush after an operation that might block // for an un-specified amount of time. @@ -85,4 +104,5 @@ func (b *SignalBatcher) Flush() { defer b.mu.Unlock() b.metricsBatcher.Flush() b.traceBatcher.Flush() + b.logsBatcher.Flush() } diff --git a/src/pkg/otelcolclient/signal_batcher_test.go b/src/pkg/otelcolclient/signal_batcher_test.go index 99e0b6d99..2808d7785 100644 --- a/src/pkg/otelcolclient/signal_batcher_test.go +++ b/src/pkg/otelcolclient/signal_batcher_test.go @@ -6,6 +6,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + logspb "go.opentelemetry.io/proto/otlp/logs/v1" metricspb "go.opentelemetry.io/proto/otlp/metrics/v1" tracepb "go.opentelemetry.io/proto/otlp/trace/v1" ) @@ -33,6 +34,16 @@ var _ = Describe("SignalBatcher", func() { Expect(writer.TraceBatchLen()).To(Equal(2)) }) + It("batches logs", func() { + writer := &spySignalWriter{} + b := NewSignalBatcher(2, time.Minute, writer) + b.WriteLog(&logspb.ResourceLogs{}) + Expect(writer.LogsBatchLen()).To(Equal(0)) + + b.WriteLog(&logspb.ResourceLogs{}) + Expect(writer.LogsBatchLen()).To(Equal(2)) + }) + Context("when no writes have occurred for a while", func() { It("flushes pending writes", func() { writer := &spySignalWriter{} @@ -50,6 +61,7 @@ var _ = Describe("SignalBatcher", func() { type spySignalWriter struct { metrics []*metricspb.Metric trace []*tracepb.ResourceSpans + logs []*logspb.ResourceLogs mu sync.Mutex } @@ -65,6 +77,12 @@ func (w *spySignalWriter) WriteTrace(batch []*tracepb.ResourceSpans) { w.trace = batch } +func (w *spySignalWriter) WriteLogs(batch []*logspb.ResourceLogs) { + w.mu.Lock() + defer w.mu.Unlock() + w.logs = batch +} + func (w *spySignalWriter) MetricsBatchLen() int { w.mu.Lock() defer w.mu.Unlock() @@ -77,6 +95,12 @@ func (w *spySignalWriter) TraceBatchLen() int { return len(w.trace) } +func (w *spySignalWriter) LogsBatchLen() int { + w.mu.Lock() + defer w.mu.Unlock() + return len(w.logs) +} + func (w *spySignalWriter) Close() error { return nil } diff --git a/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service.pb.go b/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service.pb.go new file mode 100644 index 000000000..978efdde9 --- /dev/null +++ b/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service.pb.go @@ -0,0 +1,367 @@ +// Copyright 2020, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.21.6 +// source: opentelemetry/proto/collector/logs/v1/logs_service.proto + +package v1 + +import ( + v1 "go.opentelemetry.io/proto/otlp/logs/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ExportLogsServiceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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. + ResourceLogs []*v1.ResourceLogs `protobuf:"bytes,1,rep,name=resource_logs,json=resourceLogs,proto3" json:"resource_logs,omitempty"` +} + +func (x *ExportLogsServiceRequest) Reset() { + *x = ExportLogsServiceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportLogsServiceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportLogsServiceRequest) ProtoMessage() {} + +func (x *ExportLogsServiceRequest) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportLogsServiceRequest.ProtoReflect.Descriptor instead. +func (*ExportLogsServiceRequest) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescGZIP(), []int{0} +} + +func (x *ExportLogsServiceRequest) GetResourceLogs() []*v1.ResourceLogs { + if x != nil { + return x.ResourceLogs + } + return nil +} + +type ExportLogsServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The details of a partially successful export request. + // + // If the request is only partially accepted + // (i.e. when the server accepts only parts of the data and rejects the rest) + // the server MUST initialize the `partial_success` field and MUST + // set the `rejected_` with the number of items it rejected. + // + // Servers MAY also make use of the `partial_success` field to convey + // warnings/suggestions to senders even when the request was fully accepted. + // In such cases, the `rejected_` MUST have a value of `0` and + // the `error_message` MUST be non-empty. + // + // A `partial_success` message with an empty value (rejected_ = 0 and + // `error_message` = "") is equivalent to it not being set/present. Senders + // SHOULD interpret it the same way as in the full success case. + PartialSuccess *ExportLogsPartialSuccess `protobuf:"bytes,1,opt,name=partial_success,json=partialSuccess,proto3" json:"partial_success,omitempty"` +} + +func (x *ExportLogsServiceResponse) Reset() { + *x = ExportLogsServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportLogsServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportLogsServiceResponse) ProtoMessage() {} + +func (x *ExportLogsServiceResponse) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportLogsServiceResponse.ProtoReflect.Descriptor instead. +func (*ExportLogsServiceResponse) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescGZIP(), []int{1} +} + +func (x *ExportLogsServiceResponse) GetPartialSuccess() *ExportLogsPartialSuccess { + if x != nil { + return x.PartialSuccess + } + return nil +} + +type ExportLogsPartialSuccess struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The number of rejected log records. + // + // A `rejected_` field holding a `0` value indicates that the + // request was fully accepted. + RejectedLogRecords int64 `protobuf:"varint,1,opt,name=rejected_log_records,json=rejectedLogRecords,proto3" json:"rejected_log_records,omitempty"` + // A developer-facing human-readable message in English. It should be used + // either to explain why the server rejected parts of the data during a partial + // success or to convey warnings/suggestions during a full success. The message + // should offer guidance on how users can address such issues. + // + // error_message is an optional field. An error_message with an empty value + // is equivalent to it not being set. + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (x *ExportLogsPartialSuccess) Reset() { + *x = ExportLogsPartialSuccess{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportLogsPartialSuccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportLogsPartialSuccess) ProtoMessage() {} + +func (x *ExportLogsPartialSuccess) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportLogsPartialSuccess.ProtoReflect.Descriptor instead. +func (*ExportLogsPartialSuccess) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ExportLogsPartialSuccess) GetRejectedLogRecords() int64 { + if x != nil { + return x.RejectedLogRecords + } + return 0 +} + +func (x *ExportLogsPartialSuccess) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +var File_opentelemetry_proto_collector_logs_v1_logs_service_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc = []byte{ + 0x0a, 0x38, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, + 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, + 0x31, 0x1a, 0x26, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6c, + 0x6f, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x18, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x19, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f, 0x67, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x0e, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x71, 0x0a, + 0x18, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x61, 0x6c, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x72, 0x65, 0x6a, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, + 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x32, 0x9d, 0x01, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x8d, 0x01, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3f, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f, 0x67, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f, 0x67, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x98, 0x01, 0x0a, 0x28, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x4c, + 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x30, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, + 0x70, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x73, + 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x25, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescOnce sync.Once + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData = file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc +) + +func file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData) + }) + return file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData +} + +var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_goTypes = []interface{}{ + (*ExportLogsServiceRequest)(nil), // 0: opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + (*ExportLogsServiceResponse)(nil), // 1: opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + (*ExportLogsPartialSuccess)(nil), // 2: opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + (*v1.ResourceLogs)(nil), // 3: opentelemetry.proto.logs.v1.ResourceLogs +} +var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_depIdxs = []int32{ + 3, // 0: opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resource_logs:type_name -> opentelemetry.proto.logs.v1.ResourceLogs + 2, // 1: opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partial_success:type_name -> opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + 0, // 2: opentelemetry.proto.collector.logs.v1.LogsService.Export:input_type -> opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + 1, // 3: opentelemetry.proto.collector.logs.v1.LogsService.Export:output_type -> opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_collector_logs_v1_logs_service_proto_init() } +func file_opentelemetry_proto_collector_logs_v1_logs_service_proto_init() { + if File_opentelemetry_proto_collector_logs_v1_logs_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportLogsServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportLogsServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportLogsPartialSuccess); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_depIdxs, + MessageInfos: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes, + }.Build() + File_opentelemetry_proto_collector_logs_v1_logs_service_proto = out.File + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc = nil + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_goTypes = nil + file_opentelemetry_proto_collector_logs_v1_logs_service_proto_depIdxs = nil +} diff --git a/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service.pb.gw.go b/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service.pb.gw.go new file mode 100644 index 000000000..d34f32d91 --- /dev/null +++ b/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service.pb.gw.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: opentelemetry/proto/collector/logs/v1/logs_service.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_LogsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client LogsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExportLogsServiceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Export(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_LogsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, server LogsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExportLogsServiceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Export(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterLogsServiceHandlerServer registers the http handlers for service LogsService to "mux". +// UnaryRPC :call LogsServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLogsServiceHandlerFromEndpoint instead. +func RegisterLogsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LogsServiceServer) error { + + mux.Handle("POST", pattern_LogsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/opentelemetry.proto.collector.logs.v1.LogsService/Export", runtime.WithHTTPPathPattern("/v1/logs")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_LogsService_Export_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_LogsService_Export_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterLogsServiceHandlerFromEndpoint is same as RegisterLogsServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterLogsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterLogsServiceHandler(ctx, mux, conn) +} + +// RegisterLogsServiceHandler registers the http handlers for service LogsService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterLogsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterLogsServiceHandlerClient(ctx, mux, NewLogsServiceClient(conn)) +} + +// RegisterLogsServiceHandlerClient registers the http handlers for service LogsService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LogsServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LogsServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "LogsServiceClient" to call the correct interceptors. +func RegisterLogsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LogsServiceClient) error { + + mux.Handle("POST", pattern_LogsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/opentelemetry.proto.collector.logs.v1.LogsService/Export", runtime.WithHTTPPathPattern("/v1/logs")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_LogsService_Export_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_LogsService_Export_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_LogsService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "logs"}, "")) +) + +var ( + forward_LogsService_Export_0 = runtime.ForwardResponseMessage +) diff --git a/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service_grpc.pb.go b/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service_grpc.pb.go new file mode 100644 index 000000000..e1b7c457c --- /dev/null +++ b/src/vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.1.0 +// - protoc v3.21.6 +// source: opentelemetry/proto/collector/logs/v1/logs_service.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LogsServiceClient is the client API for LogsService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type LogsServiceClient interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(ctx context.Context, in *ExportLogsServiceRequest, opts ...grpc.CallOption) (*ExportLogsServiceResponse, error) +} + +type logsServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLogsServiceClient(cc grpc.ClientConnInterface) LogsServiceClient { + return &logsServiceClient{cc} +} + +func (c *logsServiceClient) Export(ctx context.Context, in *ExportLogsServiceRequest, opts ...grpc.CallOption) (*ExportLogsServiceResponse, error) { + out := new(ExportLogsServiceResponse) + err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.logs.v1.LogsService/Export", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LogsServiceServer is the server API for LogsService service. +// All implementations must embed UnimplementedLogsServiceServer +// for forward compatibility +type LogsServiceServer interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(context.Context, *ExportLogsServiceRequest) (*ExportLogsServiceResponse, error) + mustEmbedUnimplementedLogsServiceServer() +} + +// UnimplementedLogsServiceServer must be embedded to have forward compatible implementations. +type UnimplementedLogsServiceServer struct { +} + +func (UnimplementedLogsServiceServer) Export(context.Context, *ExportLogsServiceRequest) (*ExportLogsServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Export not implemented") +} +func (UnimplementedLogsServiceServer) mustEmbedUnimplementedLogsServiceServer() {} + +// UnsafeLogsServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LogsServiceServer will +// result in compilation errors. +type UnsafeLogsServiceServer interface { + mustEmbedUnimplementedLogsServiceServer() +} + +func RegisterLogsServiceServer(s grpc.ServiceRegistrar, srv LogsServiceServer) { + s.RegisterService(&LogsService_ServiceDesc, srv) +} + +func _LogsService_Export_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportLogsServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LogsServiceServer).Export(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/opentelemetry.proto.collector.logs.v1.LogsService/Export", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LogsServiceServer).Export(ctx, req.(*ExportLogsServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// LogsService_ServiceDesc is the grpc.ServiceDesc for LogsService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LogsService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "opentelemetry.proto.collector.logs.v1.LogsService", + HandlerType: (*LogsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Export", + Handler: _LogsService_Export_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "opentelemetry/proto/collector/logs/v1/logs_service.proto", +} diff --git a/src/vendor/go.opentelemetry.io/proto/otlp/logs/v1/logs.pb.go b/src/vendor/go.opentelemetry.io/proto/otlp/logs/v1/logs.pb.go new file mode 100644 index 000000000..e0246bb07 --- /dev/null +++ b/src/vendor/go.opentelemetry.io/proto/otlp/logs/v1/logs.pb.go @@ -0,0 +1,847 @@ +// Copyright 2020, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.21.6 +// source: opentelemetry/proto/logs/v1/logs.proto + +package v1 + +import ( + v11 "go.opentelemetry.io/proto/otlp/common/v1" + v1 "go.opentelemetry.io/proto/otlp/resource/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Possible values for LogRecord.SeverityNumber. +type SeverityNumber int32 + +const ( + // UNSPECIFIED is the default SeverityNumber, it MUST NOT be used. + SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED SeverityNumber = 0 + SeverityNumber_SEVERITY_NUMBER_TRACE SeverityNumber = 1 + SeverityNumber_SEVERITY_NUMBER_TRACE2 SeverityNumber = 2 + SeverityNumber_SEVERITY_NUMBER_TRACE3 SeverityNumber = 3 + SeverityNumber_SEVERITY_NUMBER_TRACE4 SeverityNumber = 4 + SeverityNumber_SEVERITY_NUMBER_DEBUG SeverityNumber = 5 + SeverityNumber_SEVERITY_NUMBER_DEBUG2 SeverityNumber = 6 + SeverityNumber_SEVERITY_NUMBER_DEBUG3 SeverityNumber = 7 + SeverityNumber_SEVERITY_NUMBER_DEBUG4 SeverityNumber = 8 + SeverityNumber_SEVERITY_NUMBER_INFO SeverityNumber = 9 + SeverityNumber_SEVERITY_NUMBER_INFO2 SeverityNumber = 10 + SeverityNumber_SEVERITY_NUMBER_INFO3 SeverityNumber = 11 + SeverityNumber_SEVERITY_NUMBER_INFO4 SeverityNumber = 12 + SeverityNumber_SEVERITY_NUMBER_WARN SeverityNumber = 13 + SeverityNumber_SEVERITY_NUMBER_WARN2 SeverityNumber = 14 + SeverityNumber_SEVERITY_NUMBER_WARN3 SeverityNumber = 15 + SeverityNumber_SEVERITY_NUMBER_WARN4 SeverityNumber = 16 + SeverityNumber_SEVERITY_NUMBER_ERROR SeverityNumber = 17 + SeverityNumber_SEVERITY_NUMBER_ERROR2 SeverityNumber = 18 + SeverityNumber_SEVERITY_NUMBER_ERROR3 SeverityNumber = 19 + SeverityNumber_SEVERITY_NUMBER_ERROR4 SeverityNumber = 20 + SeverityNumber_SEVERITY_NUMBER_FATAL SeverityNumber = 21 + SeverityNumber_SEVERITY_NUMBER_FATAL2 SeverityNumber = 22 + SeverityNumber_SEVERITY_NUMBER_FATAL3 SeverityNumber = 23 + SeverityNumber_SEVERITY_NUMBER_FATAL4 SeverityNumber = 24 +) + +// Enum value maps for SeverityNumber. +var ( + SeverityNumber_name = map[int32]string{ + 0: "SEVERITY_NUMBER_UNSPECIFIED", + 1: "SEVERITY_NUMBER_TRACE", + 2: "SEVERITY_NUMBER_TRACE2", + 3: "SEVERITY_NUMBER_TRACE3", + 4: "SEVERITY_NUMBER_TRACE4", + 5: "SEVERITY_NUMBER_DEBUG", + 6: "SEVERITY_NUMBER_DEBUG2", + 7: "SEVERITY_NUMBER_DEBUG3", + 8: "SEVERITY_NUMBER_DEBUG4", + 9: "SEVERITY_NUMBER_INFO", + 10: "SEVERITY_NUMBER_INFO2", + 11: "SEVERITY_NUMBER_INFO3", + 12: "SEVERITY_NUMBER_INFO4", + 13: "SEVERITY_NUMBER_WARN", + 14: "SEVERITY_NUMBER_WARN2", + 15: "SEVERITY_NUMBER_WARN3", + 16: "SEVERITY_NUMBER_WARN4", + 17: "SEVERITY_NUMBER_ERROR", + 18: "SEVERITY_NUMBER_ERROR2", + 19: "SEVERITY_NUMBER_ERROR3", + 20: "SEVERITY_NUMBER_ERROR4", + 21: "SEVERITY_NUMBER_FATAL", + 22: "SEVERITY_NUMBER_FATAL2", + 23: "SEVERITY_NUMBER_FATAL3", + 24: "SEVERITY_NUMBER_FATAL4", + } + SeverityNumber_value = map[string]int32{ + "SEVERITY_NUMBER_UNSPECIFIED": 0, + "SEVERITY_NUMBER_TRACE": 1, + "SEVERITY_NUMBER_TRACE2": 2, + "SEVERITY_NUMBER_TRACE3": 3, + "SEVERITY_NUMBER_TRACE4": 4, + "SEVERITY_NUMBER_DEBUG": 5, + "SEVERITY_NUMBER_DEBUG2": 6, + "SEVERITY_NUMBER_DEBUG3": 7, + "SEVERITY_NUMBER_DEBUG4": 8, + "SEVERITY_NUMBER_INFO": 9, + "SEVERITY_NUMBER_INFO2": 10, + "SEVERITY_NUMBER_INFO3": 11, + "SEVERITY_NUMBER_INFO4": 12, + "SEVERITY_NUMBER_WARN": 13, + "SEVERITY_NUMBER_WARN2": 14, + "SEVERITY_NUMBER_WARN3": 15, + "SEVERITY_NUMBER_WARN4": 16, + "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, + } +) + +func (x SeverityNumber) Enum() *SeverityNumber { + p := new(SeverityNumber) + *p = x + return p +} + +func (x SeverityNumber) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SeverityNumber) Descriptor() protoreflect.EnumDescriptor { + return file_opentelemetry_proto_logs_v1_logs_proto_enumTypes[0].Descriptor() +} + +func (SeverityNumber) Type() protoreflect.EnumType { + return &file_opentelemetry_proto_logs_v1_logs_proto_enumTypes[0] +} + +func (x SeverityNumber) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SeverityNumber.Descriptor instead. +func (SeverityNumber) EnumDescriptor() ([]byte, []int) { + return file_opentelemetry_proto_logs_v1_logs_proto_rawDescGZIP(), []int{0} +} + +// LogRecordFlags represents constants used to interpret the +// LogRecord.flags field, which is protobuf 'fixed32' type and is to +// be used as bit-fields. Each non-zero value defined in this enum is +// a bit-mask. To extract the bit-field, for example, use an +// expression like: +// +// (logRecord.flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK) +// +type LogRecordFlags int32 + +const ( + // The zero value for the enum. Should not be used for comparisons. + // Instead use bitwise "and" with the appropriate mask as shown above. + LogRecordFlags_LOG_RECORD_FLAGS_DO_NOT_USE LogRecordFlags = 0 + // Bits 0-7 are used for trace flags. + LogRecordFlags_LOG_RECORD_FLAGS_TRACE_FLAGS_MASK LogRecordFlags = 255 +) + +// Enum value maps for LogRecordFlags. +var ( + LogRecordFlags_name = map[int32]string{ + 0: "LOG_RECORD_FLAGS_DO_NOT_USE", + 255: "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK", + } + LogRecordFlags_value = map[string]int32{ + "LOG_RECORD_FLAGS_DO_NOT_USE": 0, + "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK": 255, + } +) + +func (x LogRecordFlags) Enum() *LogRecordFlags { + p := new(LogRecordFlags) + *p = x + return p +} + +func (x LogRecordFlags) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LogRecordFlags) Descriptor() protoreflect.EnumDescriptor { + return file_opentelemetry_proto_logs_v1_logs_proto_enumTypes[1].Descriptor() +} + +func (LogRecordFlags) Type() protoreflect.EnumType { + return &file_opentelemetry_proto_logs_v1_logs_proto_enumTypes[1] +} + +func (x LogRecordFlags) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LogRecordFlags.Descriptor instead. +func (LogRecordFlags) EnumDescriptor() ([]byte, []int) { + return file_opentelemetry_proto_logs_v1_logs_proto_rawDescGZIP(), []int{1} +} + +// 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. +type LogsData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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. + ResourceLogs []*ResourceLogs `protobuf:"bytes,1,rep,name=resource_logs,json=resourceLogs,proto3" json:"resource_logs,omitempty"` +} + +func (x *LogsData) Reset() { + *x = LogsData{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogsData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogsData) ProtoMessage() {} + +func (x *LogsData) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogsData.ProtoReflect.Descriptor instead. +func (*LogsData) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_logs_v1_logs_proto_rawDescGZIP(), []int{0} +} + +func (x *LogsData) GetResourceLogs() []*ResourceLogs { + if x != nil { + return x.ResourceLogs + } + return nil +} + +// A collection of ScopeLogs from a Resource. +type ResourceLogs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource for the logs in this message. + // If this field is not set then resource info is unknown. + Resource *v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + // A list of ScopeLogs that originate from a resource. + ScopeLogs []*ScopeLogs `protobuf:"bytes,2,rep,name=scope_logs,json=scopeLogs,proto3" json:"scope_logs,omitempty"` + // The Schema URL, if known. This is the identifier of the Schema that the resource data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + // 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. + SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` +} + +func (x *ResourceLogs) Reset() { + *x = ResourceLogs{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceLogs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceLogs) ProtoMessage() {} + +func (x *ResourceLogs) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceLogs.ProtoReflect.Descriptor instead. +func (*ResourceLogs) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_logs_v1_logs_proto_rawDescGZIP(), []int{1} +} + +func (x *ResourceLogs) GetResource() *v1.Resource { + if x != nil { + return x.Resource + } + return nil +} + +func (x *ResourceLogs) GetScopeLogs() []*ScopeLogs { + if x != nil { + return x.ScopeLogs + } + return nil +} + +func (x *ResourceLogs) GetSchemaUrl() string { + if x != nil { + return x.SchemaUrl + } + return "" +} + +// A collection of Logs produced by a Scope. +type ScopeLogs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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). + Scope *v11.InstrumentationScope `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + // A list of log records. + LogRecords []*LogRecord `protobuf:"bytes,2,rep,name=log_records,json=logRecords,proto3" json:"log_records,omitempty"` + // The Schema URL, if known. This is the identifier of the Schema that the log data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + // This schema_url applies to all logs in the "logs" field. + SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` +} + +func (x *ScopeLogs) Reset() { + *x = ScopeLogs{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScopeLogs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScopeLogs) ProtoMessage() {} + +func (x *ScopeLogs) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScopeLogs.ProtoReflect.Descriptor instead. +func (*ScopeLogs) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_logs_v1_logs_proto_rawDescGZIP(), []int{2} +} + +func (x *ScopeLogs) GetScope() *v11.InstrumentationScope { + if x != nil { + return x.Scope + } + return nil +} + +func (x *ScopeLogs) GetLogRecords() []*LogRecord { + if x != nil { + return x.LogRecords + } + return nil +} + +func (x *ScopeLogs) GetSchemaUrl() string { + if x != nil { + return x.SchemaUrl + } + return "" +} + +// A log record according to OpenTelemetry Log Data Model: +// https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md +type LogRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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. + TimeUnixNano uint64 `protobuf:"fixed64,1,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // 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. + ObservedTimeUnixNano uint64 `protobuf:"fixed64,11,opt,name=observed_time_unix_nano,json=observedTimeUnixNano,proto3" json:"observed_time_unix_nano,omitempty"` + // Numerical value of the severity, normalized to values described in Log Data Model. + // [Optional]. + SeverityNumber SeverityNumber `protobuf:"varint,2,opt,name=severity_number,json=severityNumber,proto3,enum=opentelemetry.proto.logs.v1.SeverityNumber" json:"severity_number,omitempty"` + // The severity text (also known as log level). The original string representation as + // it is known at the source. [Optional]. + SeverityText string `protobuf:"bytes,3,opt,name=severity_text,json=severityText,proto3" json:"severity_text,omitempty"` + // 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]. + Body *v11.AnyValue `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` + // 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). + Attributes []*v11.KeyValue `protobuf:"bytes,6,rep,name=attributes,proto3" json:"attributes,omitempty"` + DroppedAttributesCount uint32 `protobuf:"varint,7,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` + // 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 & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional]. + Flags uint32 `protobuf:"fixed32,8,opt,name=flags,proto3" json:"flags,omitempty"` + // 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 OR + // of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + // is zero-length and thus is also invalid). + // + // This field is optional. + // + // The receivers SHOULD assume that the log record is not associated with a + // trace if any of the following is true: + // - the field is not present, + // - the field contains an invalid value. + TraceId []byte `protobuf:"bytes,9,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + // 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 OR of length + // other than 8 bytes is considered invalid (empty string in OTLP/JSON + // is zero-length and thus is also invalid). + // + // This field is optional. If the sender specifies a valid span_id then it SHOULD also + // specify a valid trace_id. + // + // The receivers SHOULD assume that the log record is not associated with a + // span if any of the following is true: + // - the field is not present, + // - the field contains an invalid value. + SpanId []byte `protobuf:"bytes,10,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` +} + +func (x *LogRecord) Reset() { + *x = LogRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRecord) ProtoMessage() {} + +func (x *LogRecord) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogRecord.ProtoReflect.Descriptor instead. +func (*LogRecord) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_logs_v1_logs_proto_rawDescGZIP(), []int{3} +} + +func (x *LogRecord) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *LogRecord) GetObservedTimeUnixNano() uint64 { + if x != nil { + return x.ObservedTimeUnixNano + } + return 0 +} + +func (x *LogRecord) GetSeverityNumber() SeverityNumber { + if x != nil { + return x.SeverityNumber + } + return SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED +} + +func (x *LogRecord) GetSeverityText() string { + if x != nil { + return x.SeverityText + } + return "" +} + +func (x *LogRecord) GetBody() *v11.AnyValue { + if x != nil { + return x.Body + } + return nil +} + +func (x *LogRecord) GetAttributes() []*v11.KeyValue { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *LogRecord) GetDroppedAttributesCount() uint32 { + if x != nil { + return x.DroppedAttributesCount + } + return 0 +} + +func (x *LogRecord) GetFlags() uint32 { + if x != nil { + return x.Flags + } + return 0 +} + +func (x *LogRecord) GetTraceId() []byte { + if x != nil { + return x.TraceId + } + return nil +} + +func (x *LogRecord) GetSpanId() []byte { + if x != nil { + return x.SpanId + } + return nil +} + +var File_opentelemetry_proto_logs_v1_logs_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_logs_v1_logs_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, + 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6c, 0x6f, + 0x67, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x2a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x5a, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4e, 0x0a, + 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, + 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0xc3, 0x01, + 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x45, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x6c, + 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4c, 0x6f, 0x67, + 0x73, 0x52, 0x09, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x55, 0x72, 0x6c, 0x4a, 0x06, 0x08, 0xe8, 0x07, + 0x10, 0xe9, 0x07, 0x22, 0xbe, 0x01, 0x0a, 0x09, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4c, 0x6f, 0x67, + 0x73, 0x12, 0x49, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x33, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x47, 0x0a, 0x0b, + 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0a, 0x6c, 0x6f, 0x67, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x55, 0x72, 0x6c, 0x22, 0xf3, 0x03, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, + 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, + 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x35, 0x0a, 0x17, 0x6f, 0x62, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, + 0x61, 0x6e, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x06, 0x52, 0x14, 0x6f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, + 0x54, 0x0a, 0x0f, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6c, + 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0e, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, + 0x79, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, + 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x54, 0x65, 0x78, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, + 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, + 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, + 0x61, 0x6e, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x2a, 0xc3, 0x05, 0x0a, 0x0e, 0x53, + 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x0a, + 0x1b, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, + 0x0a, 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, + 0x52, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, + 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x54, 0x52, 0x41, + 0x43, 0x45, 0x32, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, + 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x33, 0x10, + 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, + 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x34, 0x10, 0x04, 0x12, 0x19, 0x0a, + 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, + 0x5f, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x42, 0x55, + 0x47, 0x32, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, + 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x42, 0x55, 0x47, 0x33, 0x10, 0x07, + 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, + 0x42, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x42, 0x55, 0x47, 0x34, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, + 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, + 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x09, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, + 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x32, 0x10, + 0x0a, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, + 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x33, 0x10, 0x0b, 0x12, 0x19, 0x0a, 0x15, + 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, + 0x49, 0x4e, 0x46, 0x4f, 0x34, 0x10, 0x0c, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x56, 0x45, 0x52, + 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x10, + 0x0d, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, + 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x32, 0x10, 0x0e, 0x12, 0x19, 0x0a, 0x15, + 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, + 0x57, 0x41, 0x52, 0x4e, 0x33, 0x10, 0x0f, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, + 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x34, + 0x10, 0x10, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, + 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x11, 0x12, 0x1a, 0x0a, + 0x16, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x32, 0x10, 0x12, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, + 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x33, 0x10, 0x13, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, + 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x34, 0x10, + 0x14, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, + 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, 0x15, 0x12, 0x1a, 0x0a, 0x16, + 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, + 0x46, 0x41, 0x54, 0x41, 0x4c, 0x32, 0x10, 0x16, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x46, 0x41, 0x54, 0x41, + 0x4c, 0x33, 0x10, 0x17, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, + 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x34, 0x10, 0x18, + 0x2a, 0x59, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x46, 0x6c, 0x61, + 0x67, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x4c, 0x4f, 0x47, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, + 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x4f, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x55, 0x53, + 0x45, 0x10, 0x00, 0x12, 0x26, 0x0a, 0x21, 0x4c, 0x4f, 0x47, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52, + 0x44, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x46, 0x4c, + 0x41, 0x47, 0x53, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x10, 0xff, 0x01, 0x42, 0x73, 0x0a, 0x1e, 0x69, + 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x4c, + 0x6f, 0x67, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x2f, + 0x76, 0x31, 0xaa, 0x02, 0x1b, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, + 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x2e, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_logs_v1_logs_proto_rawDescOnce sync.Once + file_opentelemetry_proto_logs_v1_logs_proto_rawDescData = file_opentelemetry_proto_logs_v1_logs_proto_rawDesc +) + +func file_opentelemetry_proto_logs_v1_logs_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_logs_v1_logs_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_logs_v1_logs_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_logs_v1_logs_proto_rawDescData) + }) + return file_opentelemetry_proto_logs_v1_logs_proto_rawDescData +} + +var file_opentelemetry_proto_logs_v1_logs_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_opentelemetry_proto_logs_v1_logs_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_opentelemetry_proto_logs_v1_logs_proto_goTypes = []interface{}{ + (SeverityNumber)(0), // 0: opentelemetry.proto.logs.v1.SeverityNumber + (LogRecordFlags)(0), // 1: opentelemetry.proto.logs.v1.LogRecordFlags + (*LogsData)(nil), // 2: opentelemetry.proto.logs.v1.LogsData + (*ResourceLogs)(nil), // 3: opentelemetry.proto.logs.v1.ResourceLogs + (*ScopeLogs)(nil), // 4: opentelemetry.proto.logs.v1.ScopeLogs + (*LogRecord)(nil), // 5: opentelemetry.proto.logs.v1.LogRecord + (*v1.Resource)(nil), // 6: opentelemetry.proto.resource.v1.Resource + (*v11.InstrumentationScope)(nil), // 7: opentelemetry.proto.common.v1.InstrumentationScope + (*v11.AnyValue)(nil), // 8: opentelemetry.proto.common.v1.AnyValue + (*v11.KeyValue)(nil), // 9: opentelemetry.proto.common.v1.KeyValue +} +var file_opentelemetry_proto_logs_v1_logs_proto_depIdxs = []int32{ + 3, // 0: opentelemetry.proto.logs.v1.LogsData.resource_logs:type_name -> opentelemetry.proto.logs.v1.ResourceLogs + 6, // 1: opentelemetry.proto.logs.v1.ResourceLogs.resource:type_name -> opentelemetry.proto.resource.v1.Resource + 4, // 2: opentelemetry.proto.logs.v1.ResourceLogs.scope_logs:type_name -> opentelemetry.proto.logs.v1.ScopeLogs + 7, // 3: opentelemetry.proto.logs.v1.ScopeLogs.scope:type_name -> opentelemetry.proto.common.v1.InstrumentationScope + 5, // 4: opentelemetry.proto.logs.v1.ScopeLogs.log_records:type_name -> opentelemetry.proto.logs.v1.LogRecord + 0, // 5: opentelemetry.proto.logs.v1.LogRecord.severity_number:type_name -> opentelemetry.proto.logs.v1.SeverityNumber + 8, // 6: opentelemetry.proto.logs.v1.LogRecord.body:type_name -> opentelemetry.proto.common.v1.AnyValue + 9, // 7: opentelemetry.proto.logs.v1.LogRecord.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_logs_v1_logs_proto_init() } +func file_opentelemetry_proto_logs_v1_logs_proto_init() { + if File_opentelemetry_proto_logs_v1_logs_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogsData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceLogs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScopeLogs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_logs_v1_logs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_logs_v1_logs_proto_rawDesc, + NumEnums: 2, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_opentelemetry_proto_logs_v1_logs_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_logs_v1_logs_proto_depIdxs, + EnumInfos: file_opentelemetry_proto_logs_v1_logs_proto_enumTypes, + MessageInfos: file_opentelemetry_proto_logs_v1_logs_proto_msgTypes, + }.Build() + File_opentelemetry_proto_logs_v1_logs_proto = out.File + file_opentelemetry_proto_logs_v1_logs_proto_rawDesc = nil + file_opentelemetry_proto_logs_v1_logs_proto_goTypes = nil + file_opentelemetry_proto_logs_v1_logs_proto_depIdxs = nil +} diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt index 4142f3fe4..cb503540a 100644 --- a/src/vendor/modules.txt +++ b/src/vendor/modules.txt @@ -167,9 +167,11 @@ github.com/valyala/fasthttp/fasthttputil github.com/valyala/fasthttp/stackless # go.opentelemetry.io/proto/otlp v1.3.1 ## explicit; go 1.17 +go.opentelemetry.io/proto/otlp/collector/logs/v1 go.opentelemetry.io/proto/otlp/collector/metrics/v1 go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 +go.opentelemetry.io/proto/otlp/logs/v1 go.opentelemetry.io/proto/otlp/metrics/v1 go.opentelemetry.io/proto/otlp/resource/v1 go.opentelemetry.io/proto/otlp/trace/v1