From ba9d42f1ddd320985e7eaf969a604f4abb1f088b Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Wed, 15 May 2024 15:50:42 +0200 Subject: [PATCH 01/14] Initial import of lightstepreceiver --- .../components/lightstepreceiver/DESIGN.md | 30 + .../lightstepreceiver/big_endian_converter.go | 37 + .../components/lightstepreceiver/config.go | 64 ++ .../lightstepreceiver/config_test.go | 121 +++ .../components/lightstepreceiver/factory.go | 55 ++ .../lightstepreceiver/factory_test.go | 41 + collector/components/lightstepreceiver/go.mod | 73 ++ collector/components/lightstepreceiver/go.sum | 182 ++++ .../internal/collectorpb/collector.pb.go | 885 ++++++++++++++++++ .../internal/metadata/generated_status.go | 12 + .../lightstepreceiver/metadata.yaml | 11 + .../testdata/bad_no_proto_config.yaml | 1 + .../testdata/bad_proto_config.yaml | 3 + .../lightstepreceiver/testdata/config.yaml | 15 + .../lightstepreceiver/testdata/default.yaml | 2 + .../lightstepreceiver/testdata/only_http.yaml | 3 + .../testdata/only_http_empty_map.yaml | 3 + .../testdata/only_http_null.yaml | 3 + .../testdata/typo_default_proto_config.yaml | 2 + .../components/lightstepreceiver/to_traces.go | 143 +++ .../lightstepreceiver/to_traces_test.go | 560 +++++++++++ .../lightstepreceiver/trace_receiver.go | 148 +++ .../lightstepreceiver/trace_receiver_test.go | 79 ++ collector/otelcol-builder.yaml | 4 + 24 files changed, 2477 insertions(+) create mode 100644 collector/components/lightstepreceiver/DESIGN.md create mode 100644 collector/components/lightstepreceiver/big_endian_converter.go create mode 100644 collector/components/lightstepreceiver/config.go create mode 100644 collector/components/lightstepreceiver/config_test.go create mode 100644 collector/components/lightstepreceiver/factory.go create mode 100644 collector/components/lightstepreceiver/factory_test.go create mode 100644 collector/components/lightstepreceiver/go.mod create mode 100644 collector/components/lightstepreceiver/go.sum create mode 100644 collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go create mode 100644 collector/components/lightstepreceiver/internal/metadata/generated_status.go create mode 100644 collector/components/lightstepreceiver/metadata.yaml create mode 100644 collector/components/lightstepreceiver/testdata/bad_no_proto_config.yaml create mode 100644 collector/components/lightstepreceiver/testdata/bad_proto_config.yaml create mode 100644 collector/components/lightstepreceiver/testdata/config.yaml create mode 100644 collector/components/lightstepreceiver/testdata/default.yaml create mode 100644 collector/components/lightstepreceiver/testdata/only_http.yaml create mode 100644 collector/components/lightstepreceiver/testdata/only_http_empty_map.yaml create mode 100644 collector/components/lightstepreceiver/testdata/only_http_null.yaml create mode 100644 collector/components/lightstepreceiver/testdata/typo_default_proto_config.yaml create mode 100644 collector/components/lightstepreceiver/to_traces.go create mode 100644 collector/components/lightstepreceiver/to_traces_test.go create mode 100644 collector/components/lightstepreceiver/trace_receiver.go create mode 100644 collector/components/lightstepreceiver/trace_receiver_test.go diff --git a/collector/components/lightstepreceiver/DESIGN.md b/collector/components/lightstepreceiver/DESIGN.md new file mode 100644 index 0000000..7446601 --- /dev/null +++ b/collector/components/lightstepreceiver/DESIGN.md @@ -0,0 +1,30 @@ +# Design + +## Summary + +This receiver mimics what is provided by the Lightstep Microsatellites: + +* Clock correction: The legacy tracers and this receiver send each other + timestamp values in order to sync up any missmatched clocks. + - `ReportRequest`: `TimestampOffsetMicros` includes an offset that MUST + be applied to all timestamps being reported. This value is zero if + no clock correction is required. + - `ReportResponse`: This receiver sends two timestamps, `Receive` and + `Transmit`, with the times at which the latest request was received + and later answered with a response, in order to help the tracers + adjust their offsets. + +## TODO + +* Implement gRPC support. +* Implement OBSReport. +* Consider mapping semantic conventions: + - Values that can be consumed within the processor, e.g. detect event names from Logs, detect `StatusKind` from error tags. + - Values that affect the entire OT ecosystem. Probably can be offered as a separate processor instead. + - Lightstep-specific tags (attributes) that _may_ need to be mapped to become useful for OTel processors. +* `Baggage` is being sent as part of Lightstep's `SpanContext`, but it is not exported in any way at this point. +* Find all special Tags (e.g. "lightstep.component_name") and think which ones we should map + (there is already a document about this somewhere). +* Legacy tracers send payloads using the `application/octet-stream` content type and using the + `/api/v2/reports` path. We don't check for it but worth verifying this. +* Top level `ReporterId` is not being used at this moment. diff --git a/collector/components/lightstepreceiver/big_endian_converter.go b/collector/components/lightstepreceiver/big_endian_converter.go new file mode 100644 index 0000000..ebe932f --- /dev/null +++ b/collector/components/lightstepreceiver/big_endian_converter.go @@ -0,0 +1,37 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Copied from github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/idutils + +package lightstepreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lightstepreceiver" + +import ( + "encoding/binary" + + "go.opentelemetry.io/collector/pdata/pcommon" +) + +// UInt64ToTraceID converts the pair of uint64 representation of a TraceID to pcommon.TraceID. +func UInt64ToTraceID(high, low uint64) pcommon.TraceID { + traceID := [16]byte{} + binary.BigEndian.PutUint64(traceID[:8], high) + binary.BigEndian.PutUint64(traceID[8:], low) + return traceID +} + +// TraceIDToUInt64Pair converts the pcommon.TraceID to a pair of uint64 representation. +func TraceIDToUInt64Pair(traceID pcommon.TraceID) (uint64, uint64) { + return binary.BigEndian.Uint64(traceID[:8]), binary.BigEndian.Uint64(traceID[8:]) +} + +// UInt64ToSpanID converts the uint64 representation of a SpanID to pcommon.SpanID. +func UInt64ToSpanID(id uint64) pcommon.SpanID { + spanID := [8]byte{} + binary.BigEndian.PutUint64(spanID[:], id) + return pcommon.SpanID(spanID) +} + +// SpanIDToUInt64 converts the pcommon.SpanID to uint64 representation. +func SpanIDToUInt64(spanID pcommon.SpanID) uint64 { + return binary.BigEndian.Uint64(spanID[:]) +} diff --git a/collector/components/lightstepreceiver/config.go b/collector/components/lightstepreceiver/config.go new file mode 100644 index 0000000..179f717 --- /dev/null +++ b/collector/components/lightstepreceiver/config.go @@ -0,0 +1,64 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lightstepreceiver" + +import ( + "errors" + "fmt" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/confmap" +) + +const ( + protocolsFieldName = "protocols" + protoHTTP = "http" +) + +type HTTPConfig struct { + *confighttp.ServerConfig `mapstructure:",squash"` +} + +// Protocols is the configuration for the supported protocols. +type Protocols struct { + HTTP *HTTPConfig `mapstructure:"http"` +} + +// Config defines configuration for the Lightstep receiver. +type Config struct { + // Protocols is the configuration for the supported protocols, currently HTTP. + Protocols `mapstructure:"protocols"` +} + +var _ component.Config = (*Config)(nil) + +// Validate checks the receiver configuration is valid +func (cfg *Config) Validate() error { + if cfg.HTTP == nil { + return errors.New("must specify at least one protocol when using the Lightstep receiver") + } + return nil +} + +// Unmarshal a confmap.Conf into the config struct. +func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error { + if componentParser == nil { + return fmt.Errorf("nil config for lightstepreceiver") + } + + err := componentParser.Unmarshal(cfg) + if err != nil { + return err + } + protocols, err := componentParser.Sub(protocolsFieldName) + if err != nil { + return err + } + + if !protocols.IsSet(protoHTTP) { + cfg.HTTP = nil + } + return nil +} diff --git a/collector/components/lightstepreceiver/config_test.go b/collector/components/lightstepreceiver/config_test.go new file mode 100644 index 0000000..8018271 --- /dev/null +++ b/collector/components/lightstepreceiver/config_test.go @@ -0,0 +1,121 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver + +import ( + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/config/configtls" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/confmap/confmaptest" +) + +func TestUnmarshalDefaultConfig(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "default.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.Equal(t, factory.CreateDefaultConfig(), cfg) +} + +func TestUnmarshalConfigOnlyHTTP(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "only_http.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + + defaultOnlyHTTP := factory.CreateDefaultConfig().(*Config) + assert.Equal(t, defaultOnlyHTTP, cfg) +} + +func TestUnmarshalConfigOnlyHTTPNull(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "only_http_null.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + + defaultOnlyHTTP := factory.CreateDefaultConfig().(*Config) + assert.Equal(t, defaultOnlyHTTP, cfg) +} + +func TestUnmarshalConfigOnlyHTTPEmptyMap(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "only_http_empty_map.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + + defaultOnlyHTTP := factory.CreateDefaultConfig().(*Config) + assert.Equal(t, defaultOnlyHTTP, cfg) +} + +func TestUnmarshalConfig(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.Equal(t, + &Config{ + Protocols: Protocols{ + HTTP: &HTTPConfig{ + ServerConfig: &confighttp.ServerConfig{ + Endpoint: "0.0.0.0:443", + TLSSetting: &configtls.ServerConfig{ + Config: configtls.Config{ + CertFile: "test.crt", + KeyFile: "test.key", + }, + }, + CORS: &confighttp.CORSConfig{ + AllowedOrigins: []string{"https://*.test.com", "https://test.com"}, + MaxAge: 7200, + }, + }, + }, + }, + }, cfg) + +} + +func TestUnmarshalConfigTypoDefaultProtocol(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "typo_default_proto_config.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.EqualError(t, component.UnmarshalConfig(cm, cfg), "1 error(s) decoding:\n\n* 'protocols' has invalid keys: htttp") +} + +func TestUnmarshalConfigInvalidProtocol(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "bad_proto_config.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.EqualError(t, component.UnmarshalConfig(cm, cfg), "1 error(s) decoding:\n\n* 'protocols' has invalid keys: thrift") +} + +func TestUnmarshalConfigEmptyProtocols(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "bad_no_proto_config.yaml")) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.EqualError(t, component.ValidateConfig(cfg), "must specify at least one protocol when using the Lightstep receiver") +} + +func TestUnmarshalConfigEmpty(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NoError(t, component.UnmarshalConfig(confmap.New(), cfg)) + assert.EqualError(t, component.ValidateConfig(cfg), "must specify at least one protocol when using the Lightstep receiver") +} diff --git a/collector/components/lightstepreceiver/factory.go b/collector/components/lightstepreceiver/factory.go new file mode 100644 index 0000000..11a9f6f --- /dev/null +++ b/collector/components/lightstepreceiver/factory.go @@ -0,0 +1,55 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lightstepreceiver" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver" + + "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/metadata" +) + +// This file implements factory bits for the Lightstep receiver. + +const ( + // TODO: Define a new port for us to use. + defaultBindEndpoint = "0.0.0.0:443" +) + +// NewFactory creates a new Lightstep receiver factory +func NewFactory() receiver.Factory { + return receiver.NewFactory( + component.MustNewType(metadata.Type), + createDefaultConfig, + receiver.WithTraces(createTracesReceiver, metadata.TracesStability), + ) +} + +// createDefaultConfig creates the default configuration for Lightstep receiver. +func createDefaultConfig() component.Config { + return &Config{ + Protocols: Protocols { + HTTP: &HTTPConfig { + ServerConfig: &confighttp.ServerConfig{ + Endpoint: defaultBindEndpoint, + }, + }, + }, + } +} + +// createTracesReceiver creates a trace receiver based on provided config. +func createTracesReceiver( + _ context.Context, + set receiver.CreateSettings, + cfg component.Config, + consumer consumer.Traces, +) (receiver.Traces, error) { + rCfg := cfg.(*Config) + return newReceiver(rCfg, consumer, set) +} diff --git a/collector/components/lightstepreceiver/factory_test.go b/collector/components/lightstepreceiver/factory_test.go new file mode 100644 index 0000000..231932a --- /dev/null +++ b/collector/components/lightstepreceiver/factory_test.go @@ -0,0 +1,41 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestCreateDefaultConfig(t *testing.T) { + cfg := createDefaultConfig() + assert.NotNil(t, cfg, "failed to create default config") + assert.NoError(t, componenttest.CheckConfigStruct(cfg)) +} + +func TestCreateReceiver(t *testing.T) { + cfg := createDefaultConfig() + + tReceiver, err := createTracesReceiver( + context.Background(), + receivertest.NewNopCreateSettings(), + cfg, + consumertest.NewNop()) + assert.NoError(t, err, "receiver creation failed") + assert.NotNil(t, tReceiver, "receiver creation failed") + + tReceiver, err = createTracesReceiver( + context.Background(), + receivertest.NewNopCreateSettings(), + cfg, + consumertest.NewNop()) + assert.NoError(t, err, "receiver creation failed") + assert.NotNil(t, tReceiver, "receiver creation failed") +} diff --git a/collector/components/lightstepreceiver/go.mod b/collector/components/lightstepreceiver/go.mod new file mode 100644 index 0000000..a451ccd --- /dev/null +++ b/collector/components/lightstepreceiver/go.mod @@ -0,0 +1,73 @@ +module github.com/lightstep/sn-collector/collector/lightstepreceiver + +go 1.21 + +require ( + github.com/golang/protobuf v1.5.3 + github.com/stretchr/testify v1.9.0 + go.opentelemetry.io/collector/component v0.98.0 + go.opentelemetry.io/collector/config/confighttp v0.98.0 + go.opentelemetry.io/collector/config/configtls v0.98.0 + go.opentelemetry.io/collector/confmap v0.98.0 + go.opentelemetry.io/collector/consumer v0.98.0 + go.opentelemetry.io/collector/pdata v1.5.0 + go.opentelemetry.io/collector/receiver v0.98.0 + go.opentelemetry.io/collector/semconv v0.98.0 + golang.org/x/net v0.24.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.0 +) + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.8 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.1.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.48.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/rs/cors v1.10.1 // indirect + go.opentelemetry.io/collector v0.98.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.98.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.5.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.5.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.98.0 // indirect + go.opentelemetry.io/collector/config/internal v0.98.0 // indirect + go.opentelemetry.io/collector/extension v0.98.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.98.0 // indirect + go.opentelemetry.io/collector/featuregate v1.5.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.25.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.47.0 // indirect + go.opentelemetry.io/otel/metric v1.25.0 // indirect + go.opentelemetry.io/otel/sdk v1.25.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.25.0 // indirect + go.opentelemetry.io/otel/trace v1.25.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/collector/components/lightstepreceiver/go.sum b/collector/components/lightstepreceiver/go.sum new file mode 100644 index 0000000..bfcc18a --- /dev/null +++ b/collector/components/lightstepreceiver/go.sum @@ -0,0 +1,182 @@ +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= +github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector v0.98.0 h1:O7bpARGWzNfFQEYevLl4iigDrpGTJY3vV/kKqNZzMOk= +go.opentelemetry.io/collector v0.98.0/go.mod h1:fvPM+tBML07uvAP1MV2msYPSYJ9U/lgE1jDb3AFBaMM= +go.opentelemetry.io/collector/component v0.98.0 h1:0TMaBOyCdABiVLFdGOgG8zd/1IeGldCinYonbY08xWk= +go.opentelemetry.io/collector/component v0.98.0/go.mod h1:F6zyQLsoExl6r2q6WWZm8rmSSALbwG2zwIHLrMzZVio= +go.opentelemetry.io/collector/config/configauth v0.98.0 h1:FPffZ1dRL6emStrDUEGpL0rCChbUZNAQgpArXD0SESI= +go.opentelemetry.io/collector/config/configauth v0.98.0/go.mod h1:5pMzf2zgFwS7tujNq0AtOOli5vxIvnrNi7JlZwrBOFo= +go.opentelemetry.io/collector/config/configcompression v1.5.0 h1:FTxKbFPN4LznRCH/GQ+b+0tAWmg80Y2eEka79S2sLZ0= +go.opentelemetry.io/collector/config/configcompression v1.5.0/go.mod h1:O0fOPCADyGwGLLIf5lf7N3960NsnIfxsm6dr/mIpL+M= +go.opentelemetry.io/collector/config/confighttp v0.98.0 h1:pW7gR34TTXcrCHJgemL6A4VBVBS2NyDAkruSMvQj1Vo= +go.opentelemetry.io/collector/config/confighttp v0.98.0/go.mod h1:M9PMtiKrTJMG8i3SqJ+AUVKhR6sa3G/8S2F1+Dxkkr0= +go.opentelemetry.io/collector/config/configopaque v1.5.0 h1:WJzgmsFU2v63BypPBNGL31ACwWn6PwumPJNpLZplcdE= +go.opentelemetry.io/collector/config/configopaque v1.5.0/go.mod h1:/otnfj2E8r5EfaAdNV4qHkTclmiBCZXaahV5EcLwT7k= +go.opentelemetry.io/collector/config/configtelemetry v0.98.0 h1:f8RNZ1l/kYPPoxFmKKvTUli8iON7CMsm85KM38PVNts= +go.opentelemetry.io/collector/config/configtelemetry v0.98.0/go.mod h1:YV5PaOdtnU1xRomPcYqoHmyCr48tnaAREeGO96EZw8o= +go.opentelemetry.io/collector/config/configtls v0.98.0 h1:g+MADy01ge8iGC6v2tbJ5G27CWNG1BaJtmYdmpvm8e4= +go.opentelemetry.io/collector/config/configtls v0.98.0/go.mod h1:9RHArziz0mNEEkti0kz5LIdvbQGT7/Unu/0whKKazHQ= +go.opentelemetry.io/collector/config/internal v0.98.0 h1:wz/6ncawMX5cfIiXJEYSUm1g1U6iE/VxFRm4/WhVBPI= +go.opentelemetry.io/collector/config/internal v0.98.0/go.mod h1:xPnEE6QaTSXr+ctYMSTBxI2qwTntTUM4cYk7OTm6Ugc= +go.opentelemetry.io/collector/confmap v0.98.0 h1:qQreBlrqio1y7uhrAvr+W86YbQ6fw7StgkbYpvJ2vVc= +go.opentelemetry.io/collector/confmap v0.98.0/go.mod h1:BWKPIpYeUzSG6ZgCJMjF7xsLvyrvJCfYURl57E5vhiQ= +go.opentelemetry.io/collector/consumer v0.98.0 h1:47zJ5HFKXVA0RciuwkZnPU5W8j0TYUxToB1/zzzgEhs= +go.opentelemetry.io/collector/consumer v0.98.0/go.mod h1:c2edTq38uVJET/NE6VV7/Qpyznnlz8b6VE7J6TXD57c= +go.opentelemetry.io/collector/extension v0.98.0 h1:08B5ipEsoNmPHY96j5EUsUrFre01GOZ4zgttUDtPUkY= +go.opentelemetry.io/collector/extension v0.98.0/go.mod h1:fZ1Hnnahszl5j3xcW2sMRJ0FLWDOFkFMQeVDP0Se7i8= +go.opentelemetry.io/collector/extension/auth v0.98.0 h1:7b1jioijJbTMqaOCrz5Hoqf+zJn2iPlGmtN7pXLNWbA= +go.opentelemetry.io/collector/extension/auth v0.98.0/go.mod h1:gssWC4AxAwAEKI2CqS93lhjWffsVdzD8q7UGL6LaRr0= +go.opentelemetry.io/collector/featuregate v1.5.0 h1:uK8qnYQKz1TMkK+FDTFsywg/EybW/gbnOUaPNUkRznM= +go.opentelemetry.io/collector/featuregate v1.5.0/go.mod h1:w7nUODKxEi3FLf1HslCiE6YWtMtOOrMnSwsDam8Mg9w= +go.opentelemetry.io/collector/pdata v1.5.0 h1:1fKTmUpr0xCOhP/B0VEvtz7bYPQ45luQ8XFyA07j8LE= +go.opentelemetry.io/collector/pdata v1.5.0/go.mod h1:TYj8aKRWZyT/KuKQXKyqSEvK/GV+slFaDMEI+Ke64Yw= +go.opentelemetry.io/collector/pdata/testdata v0.98.0 h1:8gohV+LFXqMzuDwfOOQy9GcZBOX0C9xGoQkoeXFTzmI= +go.opentelemetry.io/collector/pdata/testdata v0.98.0/go.mod h1:B/IaHcf6+RtxI292CZu9TjfYQdi1n4+v6b8rHEonpKs= +go.opentelemetry.io/collector/receiver v0.98.0 h1:qw6JYwm+sHcZvM1DByo3QlGe6yGHuwd0yW4hEPVqYKU= +go.opentelemetry.io/collector/receiver v0.98.0/go.mod h1:AwIWn+KnquTR+kbhXQrMH+i2PvTCFldSIJznBWFYs0s= +go.opentelemetry.io/collector/semconv v0.98.0 h1:zO4L4TmlxXoYu8UgPeYElGY19BW7wPjM+quL5CzoOoY= +go.opentelemetry.io/collector/semconv v0.98.0/go.mod h1:8ElcRZ8Cdw5JnvhTOQOdYizkJaQ10Z2fS+R6djOnj6A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k= +go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg= +go.opentelemetry.io/otel/exporters/prometheus v0.47.0 h1:OL6yk1Z/pEGdDnrBbxSsH+t4FY1zXfBRGd7bjwhlMLU= +go.opentelemetry.io/otel/exporters/prometheus v0.47.0/go.mod h1:xF3N4OSICZDVbbYZydz9MHFro1RjmkPUKEvar2utG+Q= +go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA= +go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s= +go.opentelemetry.io/otel/sdk v1.25.0 h1:PDryEJPC8YJZQSyLY5eqLeafHtG+X7FWnf3aXMtxbqo= +go.opentelemetry.io/otel/sdk v1.25.0/go.mod h1:oFgzCM2zdsxKzz6zwpTZYLLQsFwc+K0daArPdIhuxkw= +go.opentelemetry.io/otel/sdk/metric v1.25.0 h1:7CiHOy08LbrxMAp4vWpbiPcklunUshVpAvGBrdDRlGw= +go.opentelemetry.io/otel/sdk/metric v1.25.0/go.mod h1:LzwoKptdbBBdYfvtGCzGwk6GWMA3aUzBOwtQpR6Nz7o= +go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM= +go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go new file mode 100644 index 0000000..e39b8e5 --- /dev/null +++ b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go @@ -0,0 +1,885 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: lightstep/collector/collector.proto + +/* +Package collectorpb is a generated protocol buffer package. + +It is generated from these files: + lightstep/collector/collector.proto + +It has these top-level messages: + SpanContext + KeyValue + Log + Reference + Span + Reporter + MetricsSample + InternalMetrics + Auth + ReportRequest + Command + ReportResponse +*/ +package collectorpb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/timestamp" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type Reference_Relationship int32 + +const ( + Reference_CHILD_OF Reference_Relationship = 0 + Reference_FOLLOWS_FROM Reference_Relationship = 1 +) + +var Reference_Relationship_name = map[int32]string{ + 0: "CHILD_OF", + 1: "FOLLOWS_FROM", +} +var Reference_Relationship_value = map[string]int32{ + "CHILD_OF": 0, + "FOLLOWS_FROM": 1, +} + +func (x Reference_Relationship) String() string { + return proto.EnumName(Reference_Relationship_name, int32(x)) +} +func (Reference_Relationship) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 0} } + +type SpanContext struct { + TraceId uint64 `protobuf:"varint,1,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` + SpanId uint64 `protobuf:"varint,2,opt,name=span_id,json=spanId" json:"span_id,omitempty"` + Baggage map[string]string `protobuf:"bytes,3,rep,name=baggage" json:"baggage,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *SpanContext) Reset() { *m = SpanContext{} } +func (m *SpanContext) String() string { return proto.CompactTextString(m) } +func (*SpanContext) ProtoMessage() {} +func (*SpanContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SpanContext) GetTraceId() uint64 { + if m != nil { + return m.TraceId + } + return 0 +} + +func (m *SpanContext) GetSpanId() uint64 { + if m != nil { + return m.SpanId + } + return 0 +} + +func (m *SpanContext) GetBaggage() map[string]string { + if m != nil { + return m.Baggage + } + return nil +} + +// Represent both tags and log fields. +type KeyValue struct { + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Types that are valid to be assigned to Value: + // *KeyValue_StringValue + // *KeyValue_IntValue + // *KeyValue_DoubleValue + // *KeyValue_BoolValue + // *KeyValue_JsonValue + Value isKeyValue_Value `protobuf_oneof:"value"` +} + +func (m *KeyValue) Reset() { *m = KeyValue{} } +func (m *KeyValue) String() string { return proto.CompactTextString(m) } +func (*KeyValue) ProtoMessage() {} +func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type isKeyValue_Value interface { + isKeyValue_Value() +} + +type KeyValue_StringValue struct { + StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,oneof"` +} +type KeyValue_IntValue struct { + IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,oneof"` +} +type KeyValue_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,oneof"` +} +type KeyValue_BoolValue struct { + BoolValue bool `protobuf:"varint,5,opt,name=bool_value,json=boolValue,oneof"` +} +type KeyValue_JsonValue struct { + JsonValue string `protobuf:"bytes,6,opt,name=json_value,json=jsonValue,oneof"` +} + +func (*KeyValue_StringValue) isKeyValue_Value() {} +func (*KeyValue_IntValue) isKeyValue_Value() {} +func (*KeyValue_DoubleValue) isKeyValue_Value() {} +func (*KeyValue_BoolValue) isKeyValue_Value() {} +func (*KeyValue_JsonValue) isKeyValue_Value() {} + +func (m *KeyValue) GetValue() isKeyValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *KeyValue) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *KeyValue) GetStringValue() string { + if x, ok := m.GetValue().(*KeyValue_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *KeyValue) GetIntValue() int64 { + if x, ok := m.GetValue().(*KeyValue_IntValue); ok { + return x.IntValue + } + return 0 +} + +func (m *KeyValue) GetDoubleValue() float64 { + if x, ok := m.GetValue().(*KeyValue_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *KeyValue) GetBoolValue() bool { + if x, ok := m.GetValue().(*KeyValue_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (m *KeyValue) GetJsonValue() string { + if x, ok := m.GetValue().(*KeyValue_JsonValue); ok { + return x.JsonValue + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*KeyValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _KeyValue_OneofMarshaler, _KeyValue_OneofUnmarshaler, _KeyValue_OneofSizer, []interface{}{ + (*KeyValue_StringValue)(nil), + (*KeyValue_IntValue)(nil), + (*KeyValue_DoubleValue)(nil), + (*KeyValue_BoolValue)(nil), + (*KeyValue_JsonValue)(nil), + } +} + +func _KeyValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*KeyValue) + // value + switch x := m.Value.(type) { + case *KeyValue_StringValue: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *KeyValue_IntValue: + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntValue)) + case *KeyValue_DoubleValue: + b.EncodeVarint(4<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case *KeyValue_BoolValue: + t := uint64(0) + if x.BoolValue { + t = 1 + } + b.EncodeVarint(5<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *KeyValue_JsonValue: + b.EncodeVarint(6<<3 | proto.WireBytes) + b.EncodeStringBytes(x.JsonValue) + case nil: + default: + return fmt.Errorf("KeyValue.Value has unexpected type %T", x) + } + return nil +} + +func _KeyValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*KeyValue) + switch tag { + case 2: // value.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Value = &KeyValue_StringValue{x} + return true, err + case 3: // value.int_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &KeyValue_IntValue{int64(x)} + return true, err + case 4: // value.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Value = &KeyValue_DoubleValue{math.Float64frombits(x)} + return true, err + case 5: // value.bool_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &KeyValue_BoolValue{x != 0} + return true, err + case 6: // value.json_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Value = &KeyValue_JsonValue{x} + return true, err + default: + return false, nil + } +} + +func _KeyValue_OneofSizer(msg proto.Message) (n int) { + m := msg.(*KeyValue) + // value + switch x := m.Value.(type) { + case *KeyValue_StringValue: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *KeyValue_IntValue: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntValue)) + case *KeyValue_DoubleValue: + n += proto.SizeVarint(4<<3 | proto.WireFixed64) + n += 8 + case *KeyValue_BoolValue: + n += proto.SizeVarint(5<<3 | proto.WireVarint) + n += 1 + case *KeyValue_JsonValue: + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.JsonValue))) + n += len(x.JsonValue) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type Log struct { + Timestamp *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp,omitempty"` + Fields []*KeyValue `protobuf:"bytes,2,rep,name=fields" json:"fields,omitempty"` +} + +func (m *Log) Reset() { *m = Log{} } +func (m *Log) String() string { return proto.CompactTextString(m) } +func (*Log) ProtoMessage() {} +func (*Log) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Log) GetTimestamp() *google_protobuf.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *Log) GetFields() []*KeyValue { + if m != nil { + return m.Fields + } + return nil +} + +type Reference struct { + Relationship Reference_Relationship `protobuf:"varint,1,opt,name=relationship,enum=lightstep.collector.Reference_Relationship" json:"relationship,omitempty"` + SpanContext *SpanContext `protobuf:"bytes,2,opt,name=span_context,json=spanContext" json:"span_context,omitempty"` +} + +func (m *Reference) Reset() { *m = Reference{} } +func (m *Reference) String() string { return proto.CompactTextString(m) } +func (*Reference) ProtoMessage() {} +func (*Reference) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Reference) GetRelationship() Reference_Relationship { + if m != nil { + return m.Relationship + } + return Reference_CHILD_OF +} + +func (m *Reference) GetSpanContext() *SpanContext { + if m != nil { + return m.SpanContext + } + return nil +} + +type Span struct { + SpanContext *SpanContext `protobuf:"bytes,1,opt,name=span_context,json=spanContext" json:"span_context,omitempty"` + OperationName string `protobuf:"bytes,2,opt,name=operation_name,json=operationName" json:"operation_name,omitempty"` + References []*Reference `protobuf:"bytes,3,rep,name=references" json:"references,omitempty"` + StartTimestamp *google_protobuf.Timestamp `protobuf:"bytes,4,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"` + DurationMicros uint64 `protobuf:"varint,5,opt,name=duration_micros,json=durationMicros" json:"duration_micros,omitempty"` + Tags []*KeyValue `protobuf:"bytes,6,rep,name=tags" json:"tags,omitempty"` + Logs []*Log `protobuf:"bytes,7,rep,name=logs" json:"logs,omitempty"` +} + +func (m *Span) Reset() { *m = Span{} } +func (m *Span) String() string { return proto.CompactTextString(m) } +func (*Span) ProtoMessage() {} +func (*Span) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Span) GetSpanContext() *SpanContext { + if m != nil { + return m.SpanContext + } + return nil +} + +func (m *Span) GetOperationName() string { + if m != nil { + return m.OperationName + } + return "" +} + +func (m *Span) GetReferences() []*Reference { + if m != nil { + return m.References + } + return nil +} + +func (m *Span) GetStartTimestamp() *google_protobuf.Timestamp { + if m != nil { + return m.StartTimestamp + } + return nil +} + +func (m *Span) GetDurationMicros() uint64 { + if m != nil { + return m.DurationMicros + } + return 0 +} + +func (m *Span) GetTags() []*KeyValue { + if m != nil { + return m.Tags + } + return nil +} + +func (m *Span) GetLogs() []*Log { + if m != nil { + return m.Logs + } + return nil +} + +type Reporter struct { + ReporterId uint64 `protobuf:"varint,1,opt,name=reporter_id,json=reporterId" json:"reporter_id,omitempty"` + Tags []*KeyValue `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` +} + +func (m *Reporter) Reset() { *m = Reporter{} } +func (m *Reporter) String() string { return proto.CompactTextString(m) } +func (*Reporter) ProtoMessage() {} +func (*Reporter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *Reporter) GetReporterId() uint64 { + if m != nil { + return m.ReporterId + } + return 0 +} + +func (m *Reporter) GetTags() []*KeyValue { + if m != nil { + return m.Tags + } + return nil +} + +type MetricsSample struct { + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Types that are valid to be assigned to Value: + // *MetricsSample_IntValue + // *MetricsSample_DoubleValue + Value isMetricsSample_Value `protobuf_oneof:"value"` +} + +func (m *MetricsSample) Reset() { *m = MetricsSample{} } +func (m *MetricsSample) String() string { return proto.CompactTextString(m) } +func (*MetricsSample) ProtoMessage() {} +func (*MetricsSample) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type isMetricsSample_Value interface { + isMetricsSample_Value() +} + +type MetricsSample_IntValue struct { + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,oneof"` +} +type MetricsSample_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"` +} + +func (*MetricsSample_IntValue) isMetricsSample_Value() {} +func (*MetricsSample_DoubleValue) isMetricsSample_Value() {} + +func (m *MetricsSample) GetValue() isMetricsSample_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *MetricsSample) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MetricsSample) GetIntValue() int64 { + if x, ok := m.GetValue().(*MetricsSample_IntValue); ok { + return x.IntValue + } + return 0 +} + +func (m *MetricsSample) GetDoubleValue() float64 { + if x, ok := m.GetValue().(*MetricsSample_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*MetricsSample) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _MetricsSample_OneofMarshaler, _MetricsSample_OneofUnmarshaler, _MetricsSample_OneofSizer, []interface{}{ + (*MetricsSample_IntValue)(nil), + (*MetricsSample_DoubleValue)(nil), + } +} + +func _MetricsSample_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*MetricsSample) + // value + switch x := m.Value.(type) { + case *MetricsSample_IntValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntValue)) + case *MetricsSample_DoubleValue: + b.EncodeVarint(3<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case nil: + default: + return fmt.Errorf("MetricsSample.Value has unexpected type %T", x) + } + return nil +} + +func _MetricsSample_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*MetricsSample) + switch tag { + case 2: // value.int_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &MetricsSample_IntValue{int64(x)} + return true, err + case 3: // value.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Value = &MetricsSample_DoubleValue{math.Float64frombits(x)} + return true, err + default: + return false, nil + } +} + +func _MetricsSample_OneofSizer(msg proto.Message) (n int) { + m := msg.(*MetricsSample) + // value + switch x := m.Value.(type) { + case *MetricsSample_IntValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntValue)) + case *MetricsSample_DoubleValue: + n += proto.SizeVarint(3<<3 | proto.WireFixed64) + n += 8 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type InternalMetrics struct { + StartTimestamp *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"` + DurationMicros uint64 `protobuf:"varint,2,opt,name=duration_micros,json=durationMicros" json:"duration_micros,omitempty"` + Logs []*Log `protobuf:"bytes,3,rep,name=logs" json:"logs,omitempty"` + Counts []*MetricsSample `protobuf:"bytes,4,rep,name=counts" json:"counts,omitempty"` + Gauges []*MetricsSample `protobuf:"bytes,5,rep,name=gauges" json:"gauges,omitempty"` +} + +func (m *InternalMetrics) Reset() { *m = InternalMetrics{} } +func (m *InternalMetrics) String() string { return proto.CompactTextString(m) } +func (*InternalMetrics) ProtoMessage() {} +func (*InternalMetrics) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *InternalMetrics) GetStartTimestamp() *google_protobuf.Timestamp { + if m != nil { + return m.StartTimestamp + } + return nil +} + +func (m *InternalMetrics) GetDurationMicros() uint64 { + if m != nil { + return m.DurationMicros + } + return 0 +} + +func (m *InternalMetrics) GetLogs() []*Log { + if m != nil { + return m.Logs + } + return nil +} + +func (m *InternalMetrics) GetCounts() []*MetricsSample { + if m != nil { + return m.Counts + } + return nil +} + +func (m *InternalMetrics) GetGauges() []*MetricsSample { + if m != nil { + return m.Gauges + } + return nil +} + +type Auth struct { + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` +} + +func (m *Auth) Reset() { *m = Auth{} } +func (m *Auth) String() string { return proto.CompactTextString(m) } +func (*Auth) ProtoMessage() {} +func (*Auth) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *Auth) GetAccessToken() string { + if m != nil { + return m.AccessToken + } + return "" +} + +type ReportRequest struct { + Reporter *Reporter `protobuf:"bytes,1,opt,name=reporter" json:"reporter,omitempty"` + Auth *Auth `protobuf:"bytes,2,opt,name=auth" json:"auth,omitempty"` + Spans []*Span `protobuf:"bytes,3,rep,name=spans" json:"spans,omitempty"` + TimestampOffsetMicros int32 `protobuf:"varint,5,opt,name=timestamp_offset_micros,json=timestampOffsetMicros" json:"timestamp_offset_micros,omitempty"` + InternalMetrics *InternalMetrics `protobuf:"bytes,6,opt,name=internal_metrics,json=internalMetrics" json:"internal_metrics,omitempty"` +} + +func (m *ReportRequest) Reset() { *m = ReportRequest{} } +func (m *ReportRequest) String() string { return proto.CompactTextString(m) } +func (*ReportRequest) ProtoMessage() {} +func (*ReportRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ReportRequest) GetReporter() *Reporter { + if m != nil { + return m.Reporter + } + return nil +} + +func (m *ReportRequest) GetAuth() *Auth { + if m != nil { + return m.Auth + } + return nil +} + +func (m *ReportRequest) GetSpans() []*Span { + if m != nil { + return m.Spans + } + return nil +} + +func (m *ReportRequest) GetTimestampOffsetMicros() int32 { + if m != nil { + return m.TimestampOffsetMicros + } + return 0 +} + +func (m *ReportRequest) GetInternalMetrics() *InternalMetrics { + if m != nil { + return m.InternalMetrics + } + return nil +} + +type Command struct { + Disable bool `protobuf:"varint,1,opt,name=disable" json:"disable,omitempty"` +} + +func (m *Command) Reset() { *m = Command{} } +func (m *Command) String() string { return proto.CompactTextString(m) } +func (*Command) ProtoMessage() {} +func (*Command) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *Command) GetDisable() bool { + if m != nil { + return m.Disable + } + return false +} + +type ReportResponse struct { + Commands []*Command `protobuf:"bytes,1,rep,name=commands" json:"commands,omitempty"` + ReceiveTimestamp *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=receive_timestamp,json=receiveTimestamp" json:"receive_timestamp,omitempty"` + TransmitTimestamp *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=transmit_timestamp,json=transmitTimestamp" json:"transmit_timestamp,omitempty"` + Errors []string `protobuf:"bytes,4,rep,name=errors" json:"errors,omitempty"` +} + +func (m *ReportResponse) Reset() { *m = ReportResponse{} } +func (m *ReportResponse) String() string { return proto.CompactTextString(m) } +func (*ReportResponse) ProtoMessage() {} +func (*ReportResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ReportResponse) GetCommands() []*Command { + if m != nil { + return m.Commands + } + return nil +} + +func (m *ReportResponse) GetReceiveTimestamp() *google_protobuf.Timestamp { + if m != nil { + return m.ReceiveTimestamp + } + return nil +} + +func (m *ReportResponse) GetTransmitTimestamp() *google_protobuf.Timestamp { + if m != nil { + return m.TransmitTimestamp + } + return nil +} + +func (m *ReportResponse) GetErrors() []string { + if m != nil { + return m.Errors + } + return nil +} + +func init() { + proto.RegisterType((*SpanContext)(nil), "lightstep.collector.SpanContext") + proto.RegisterType((*KeyValue)(nil), "lightstep.collector.KeyValue") + proto.RegisterType((*Log)(nil), "lightstep.collector.Log") + proto.RegisterType((*Reference)(nil), "lightstep.collector.Reference") + proto.RegisterType((*Span)(nil), "lightstep.collector.Span") + proto.RegisterType((*Reporter)(nil), "lightstep.collector.Reporter") + proto.RegisterType((*MetricsSample)(nil), "lightstep.collector.MetricsSample") + proto.RegisterType((*InternalMetrics)(nil), "lightstep.collector.InternalMetrics") + proto.RegisterType((*Auth)(nil), "lightstep.collector.Auth") + proto.RegisterType((*ReportRequest)(nil), "lightstep.collector.ReportRequest") + proto.RegisterType((*Command)(nil), "lightstep.collector.Command") + proto.RegisterType((*ReportResponse)(nil), "lightstep.collector.ReportResponse") + proto.RegisterEnum("lightstep.collector.Reference_Relationship", Reference_Relationship_name, Reference_Relationship_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for CollectorService service + +type CollectorServiceClient interface { + Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) +} + +type collectorServiceClient struct { + cc *grpc.ClientConn +} + +func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { + return &collectorServiceClient{cc} +} + +func (c *collectorServiceClient) Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) { + out := new(ReportResponse) + err := grpc.Invoke(ctx, "/lightstep.collector.CollectorService/Report", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for CollectorService service + +type CollectorServiceServer interface { + Report(context.Context, *ReportRequest) (*ReportResponse, error) +} + +func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { + s.RegisterService(&_CollectorService_serviceDesc, srv) +} + +func _CollectorService_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CollectorServiceServer).Report(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lightstep.collector.CollectorService/Report", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CollectorServiceServer).Report(ctx, req.(*ReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CollectorService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "lightstep.collector.CollectorService", + HandlerType: (*CollectorServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Report", + Handler: _CollectorService_Report_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "lightstep/collector/collector.proto", +} + +func init() { proto.RegisterFile("lightstep/collector/collector.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1039 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0xae, 0x13, 0x37, 0x3f, 0x27, 0x69, 0x9b, 0x1d, 0x7e, 0x36, 0xad, 0xb6, 0x34, 0x38, 0x20, + 0xca, 0xcf, 0x26, 0x6a, 0x10, 0xa8, 0xf4, 0x02, 0x89, 0x06, 0xba, 0x8d, 0x48, 0xc9, 0x6a, 0xba, + 0x02, 0x69, 0x2f, 0x88, 0x26, 0xce, 0xd4, 0x35, 0x6b, 0x7b, 0xcc, 0xcc, 0x24, 0xa2, 0x97, 0x70, + 0xc9, 0x2d, 0x6f, 0x80, 0xc4, 0x13, 0xf0, 0x0e, 0x5c, 0x83, 0x78, 0x05, 0x9e, 0x81, 0x6b, 0xe4, + 0x99, 0xb1, 0xe3, 0x82, 0xb7, 0xad, 0xd0, 0xde, 0x79, 0xce, 0x7c, 0xdf, 0x99, 0x33, 0xe7, 0xfb, + 0xce, 0x24, 0xd0, 0x0d, 0x7c, 0xef, 0x52, 0x0a, 0x49, 0xe3, 0xbe, 0xcb, 0x82, 0x80, 0xba, 0x92, + 0xf1, 0xd5, 0x57, 0x2f, 0xe6, 0x4c, 0x32, 0xf4, 0x52, 0x06, 0xea, 0x65, 0x5b, 0x3b, 0x7b, 0x1e, + 0x63, 0x5e, 0x40, 0xfb, 0x0a, 0x32, 0x5b, 0x5c, 0xf4, 0xa5, 0x1f, 0x52, 0x21, 0x49, 0x18, 0x6b, + 0xd6, 0xce, 0x03, 0x03, 0x20, 0xb1, 0xdf, 0x27, 0x51, 0xc4, 0x24, 0x91, 0x3e, 0x8b, 0x84, 0xde, + 0x75, 0x7e, 0xb3, 0xa0, 0x71, 0x1e, 0x93, 0x68, 0xc8, 0x22, 0x49, 0xbf, 0x93, 0x68, 0x1b, 0x6a, + 0x92, 0x13, 0x97, 0x4e, 0xfd, 0x79, 0xdb, 0xea, 0x58, 0xfb, 0x36, 0xae, 0xaa, 0xf5, 0x68, 0x8e, + 0xee, 0x43, 0x55, 0xc4, 0x24, 0x4a, 0x76, 0x4a, 0x6a, 0xa7, 0x92, 0x2c, 0x47, 0x73, 0xf4, 0x08, + 0xaa, 0x33, 0xe2, 0x79, 0xc4, 0xa3, 0xed, 0x72, 0xa7, 0xbc, 0xdf, 0x18, 0x3c, 0xec, 0x15, 0x54, + 0xda, 0xcb, 0x1d, 0xd3, 0x3b, 0xd6, 0xf8, 0xcf, 0x22, 0xc9, 0xaf, 0x70, 0xca, 0xde, 0x39, 0x82, + 0x66, 0x7e, 0x03, 0xb5, 0xa0, 0xfc, 0x8c, 0x5e, 0xa9, 0x3a, 0xea, 0x38, 0xf9, 0x44, 0x2f, 0xc3, + 0xfa, 0x92, 0x04, 0x0b, 0xaa, 0x2a, 0xa8, 0x63, 0xbd, 0x38, 0x2a, 0x1d, 0x5a, 0xce, 0xef, 0x16, + 0xd4, 0x3e, 0xa7, 0x57, 0x5f, 0x26, 0x81, 0x02, 0x62, 0x17, 0x9a, 0x42, 0x72, 0x3f, 0xf2, 0xa6, + 0x39, 0xfe, 0xe9, 0x1a, 0x6e, 0xe8, 0xa8, 0xa6, 0xed, 0x42, 0xdd, 0x8f, 0xa4, 0x41, 0x94, 0x3b, + 0xd6, 0x7e, 0xf9, 0x74, 0x0d, 0xd7, 0xfc, 0x48, 0xea, 0xed, 0x2e, 0x34, 0xe7, 0x6c, 0x31, 0x0b, + 0xa8, 0x41, 0xd8, 0x1d, 0x6b, 0xdf, 0x4a, 0x72, 0xe8, 0xa8, 0x06, 0xed, 0x01, 0xcc, 0x18, 0x0b, + 0x0c, 0x64, 0xbd, 0x63, 0xed, 0xd7, 0x4e, 0xd7, 0x70, 0x3d, 0x89, 0x65, 0x80, 0x6f, 0x04, 0x8b, + 0x0c, 0xa0, 0x62, 0xea, 0xa8, 0x27, 0x31, 0x05, 0x38, 0xae, 0x9a, 0x3b, 0x3a, 0x4b, 0x28, 0x8f, + 0x99, 0x87, 0x0e, 0xa1, 0x9e, 0x69, 0xaa, 0xae, 0xd4, 0x18, 0xec, 0xf4, 0xb4, 0xa8, 0xbd, 0x54, + 0xf5, 0xde, 0x93, 0x14, 0x81, 0x57, 0x60, 0xf4, 0x01, 0x54, 0x2e, 0x7c, 0x1a, 0xcc, 0x45, 0xbb, + 0xa4, 0x74, 0xd9, 0x2d, 0xd4, 0x25, 0xed, 0x1a, 0x36, 0x60, 0xe7, 0x0f, 0x0b, 0xea, 0x98, 0x5e, + 0x50, 0x4e, 0x23, 0x97, 0xa2, 0x09, 0x34, 0x39, 0x0d, 0xb4, 0x69, 0x2e, 0x7d, 0x5d, 0xc1, 0xe6, + 0xe0, 0xdd, 0xc2, 0x54, 0x19, 0xab, 0x87, 0x73, 0x14, 0x7c, 0x2d, 0x01, 0x1a, 0x42, 0x53, 0xf9, + 0xc8, 0xd5, 0x5e, 0x50, 0x52, 0x34, 0x06, 0x9d, 0xdb, 0x3c, 0x83, 0x1b, 0x62, 0xb5, 0x70, 0x7a, + 0xd0, 0xcc, 0x1f, 0x81, 0x9a, 0x50, 0x1b, 0x9e, 0x8e, 0xc6, 0x9f, 0x4e, 0x27, 0x27, 0xad, 0x35, + 0xd4, 0x82, 0xe6, 0xc9, 0x64, 0x3c, 0x9e, 0x7c, 0x75, 0x3e, 0x3d, 0xc1, 0x93, 0xb3, 0x96, 0xe5, + 0x7c, 0x5f, 0x06, 0x3b, 0x49, 0xf6, 0x9f, 0xd3, 0xad, 0xff, 0x71, 0x3a, 0x7a, 0x13, 0x36, 0x59, + 0x4c, 0xb9, 0x3a, 0x7e, 0x1a, 0x91, 0x30, 0xf5, 0xe3, 0x46, 0x16, 0xfd, 0x82, 0x84, 0x14, 0x7d, + 0x0c, 0xc0, 0xd3, 0x8e, 0x08, 0x33, 0x1b, 0xaf, 0xdd, 0xdc, 0x38, 0x9c, 0x63, 0xa0, 0x21, 0x6c, + 0x09, 0x49, 0xb8, 0x9c, 0xae, 0xf4, 0xb7, 0x6f, 0xd5, 0x7f, 0x53, 0x51, 0xb2, 0x35, 0x7a, 0x0b, + 0xb6, 0xe6, 0x0b, 0x53, 0x6a, 0xe8, 0xbb, 0x9c, 0x09, 0xe5, 0x4a, 0x1b, 0x6f, 0xa6, 0xe1, 0x33, + 0x15, 0x45, 0x07, 0x60, 0x4b, 0xe2, 0x89, 0x76, 0xe5, 0x2e, 0x5e, 0x51, 0x50, 0xf4, 0x1e, 0xd8, + 0x01, 0xf3, 0x44, 0xbb, 0xaa, 0x28, 0xed, 0x42, 0xca, 0x98, 0x79, 0x58, 0xa1, 0x9c, 0xaf, 0xa1, + 0x86, 0x69, 0xcc, 0xb8, 0xa4, 0x1c, 0xed, 0x41, 0x83, 0x9b, 0xef, 0xd5, 0x53, 0x03, 0x69, 0x68, + 0x34, 0xcf, 0xaa, 0xb1, 0xef, 0x5c, 0x8d, 0x13, 0xc3, 0xc6, 0x19, 0x95, 0xdc, 0x77, 0xc5, 0x39, + 0x09, 0xe3, 0x80, 0x22, 0x04, 0xb6, 0x12, 0x47, 0xbf, 0x03, 0xea, 0xfb, 0xfa, 0x8c, 0x97, 0x6e, + 0x9d, 0xf1, 0x72, 0xc1, 0x8c, 0xaf, 0x26, 0xf4, 0x97, 0x12, 0x6c, 0x8d, 0x22, 0x49, 0x79, 0x44, + 0x02, 0x73, 0x74, 0x91, 0x68, 0xd6, 0x8b, 0x10, 0xad, 0x54, 0x28, 0x5a, 0xaa, 0x40, 0xf9, 0x2e, + 0x0a, 0xa0, 0x23, 0xa8, 0xb8, 0x6c, 0x11, 0xc9, 0xb4, 0xad, 0x4e, 0x21, 0xfe, 0x5a, 0x13, 0xb1, + 0x61, 0x24, 0x5c, 0x8f, 0x2c, 0x3c, 0x9a, 0xd8, 0xe7, 0xce, 0x5c, 0xcd, 0x70, 0xde, 0x06, 0xfb, + 0x93, 0x85, 0xbc, 0x44, 0xaf, 0x43, 0x93, 0xb8, 0x2e, 0x15, 0x62, 0x2a, 0xd9, 0x33, 0x1a, 0x19, + 0x61, 0x1a, 0x3a, 0xf6, 0x24, 0x09, 0x39, 0xbf, 0x96, 0x60, 0x43, 0xbb, 0x04, 0xd3, 0x6f, 0x17, + 0x54, 0x48, 0xf4, 0x11, 0xd4, 0x52, 0x5f, 0x98, 0x4e, 0xee, 0x3e, 0x67, 0x86, 0x34, 0x08, 0x67, + 0x70, 0xf4, 0x10, 0x6c, 0xb2, 0x90, 0x97, 0xe6, 0x89, 0xd9, 0x2e, 0xa4, 0x25, 0x85, 0x61, 0x05, + 0x43, 0x7d, 0x58, 0x4f, 0xa6, 0x3c, 0xed, 0xe6, 0xf6, 0x73, 0x1f, 0x05, 0xac, 0x71, 0xe8, 0x43, + 0xb8, 0x9f, 0xa9, 0x3c, 0x65, 0x17, 0x17, 0x82, 0xca, 0xfc, 0x8c, 0xad, 0xe3, 0x57, 0xb2, 0xed, + 0x89, 0xda, 0x35, 0xaa, 0x4d, 0xa0, 0xe5, 0x1b, 0xdb, 0x4c, 0x43, 0xdd, 0x31, 0xf5, 0x4b, 0xd0, + 0x18, 0xbc, 0x51, 0x78, 0xe6, 0xbf, 0x3c, 0x86, 0xb7, 0xfc, 0xeb, 0x01, 0xa7, 0x0b, 0xd5, 0x21, + 0x0b, 0x43, 0x12, 0xcd, 0x51, 0x1b, 0xaa, 0x73, 0x5f, 0x90, 0x59, 0xa0, 0x7d, 0x5f, 0xc3, 0xe9, + 0xd2, 0xf9, 0xdb, 0x82, 0xcd, 0xb4, 0xb5, 0x22, 0x66, 0x91, 0xa0, 0xe8, 0x10, 0x6a, 0xae, 0xe6, + 0x89, 0xb6, 0xa5, 0x2e, 0xfd, 0xa0, 0xb0, 0x00, 0x93, 0x1c, 0x67, 0x68, 0xf4, 0x08, 0xee, 0x71, + 0xea, 0x52, 0x7f, 0x49, 0x73, 0x46, 0x2f, 0xdd, 0x6a, 0xf4, 0x96, 0x21, 0xad, 0xac, 0x3e, 0x02, + 0x24, 0x39, 0x89, 0x44, 0xe8, 0xe7, 0x47, 0xa6, 0x7c, 0x6b, 0xa6, 0x7b, 0x29, 0x6b, 0x95, 0xea, + 0x55, 0xa8, 0x50, 0xce, 0x19, 0xd7, 0xf6, 0xae, 0x63, 0xb3, 0x1a, 0xfc, 0x68, 0x41, 0x6b, 0x98, + 0xde, 0xe5, 0x9c, 0xf2, 0xa5, 0xef, 0x52, 0xb4, 0x84, 0x8a, 0x6e, 0x06, 0x72, 0x6e, 0xb0, 0x93, + 0x31, 0xe1, 0x4e, 0xf7, 0x46, 0x8c, 0xee, 0xa6, 0xd3, 0xfd, 0xe1, 0xcf, 0xbf, 0x7e, 0x2a, 0xed, + 0x3a, 0xd0, 0x5f, 0x1e, 0xf4, 0xb5, 0x09, 0x8f, 0xac, 0x77, 0x9e, 0x36, 0x51, 0x2e, 0x70, 0x7c, + 0x00, 0xdb, 0x2e, 0x0b, 0x73, 0xe9, 0xd4, 0xff, 0x2b, 0xde, 0xf3, 0x78, 0xec, 0x3e, 0xb6, 0x9e, + 0x36, 0xb2, 0xec, 0xf1, 0xec, 0xe7, 0x92, 0x3d, 0x3e, 0x7f, 0x7c, 0x3c, 0xab, 0xa8, 0xeb, 0xbf, + 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0x92, 0x1b, 0x06, 0x26, 0x0a, 0x00, 0x00, +} diff --git a/collector/components/lightstepreceiver/internal/metadata/generated_status.go b/collector/components/lightstepreceiver/internal/metadata/generated_status.go new file mode 100644 index 0000000..06ac010 --- /dev/null +++ b/collector/components/lightstepreceiver/internal/metadata/generated_status.go @@ -0,0 +1,12 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" +) + +const ( + Type = "lightstep" + TracesStability = component.StabilityLevelBeta +) diff --git a/collector/components/lightstepreceiver/metadata.yaml b/collector/components/lightstepreceiver/metadata.yaml new file mode 100644 index 0000000..5f6d882 --- /dev/null +++ b/collector/components/lightstepreceiver/metadata.yaml @@ -0,0 +1,11 @@ +type: lightstep + +status: + class: receiver + stability: + beta: [traces] + distributions: + - core + - contrib + codeowners: + active: [carlosalberto] diff --git a/collector/components/lightstepreceiver/testdata/bad_no_proto_config.yaml b/collector/components/lightstepreceiver/testdata/bad_no_proto_config.yaml new file mode 100644 index 0000000..96ae057 --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/bad_no_proto_config.yaml @@ -0,0 +1 @@ +protocols: diff --git a/collector/components/lightstepreceiver/testdata/bad_proto_config.yaml b/collector/components/lightstepreceiver/testdata/bad_proto_config.yaml new file mode 100644 index 0000000..9be6260 --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/bad_proto_config.yaml @@ -0,0 +1,3 @@ +protocols: + thrift: + endpoint: "127.0.0.1:1234" diff --git a/collector/components/lightstepreceiver/testdata/config.yaml b/collector/components/lightstepreceiver/testdata/config.yaml new file mode 100644 index 0000000..1122fab --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/config.yaml @@ -0,0 +1,15 @@ +protocols: + http: + # The following entry demonstrates how to specify TLS credentials for the server. + # Note: These files do not exist. If the receiver is started with this configuration, it will fail. + tls: + cert_file: test.crt + key_file: test.key + + # The following entry demonstrates how to configure the Lightstep receiver to allow Cross-Origin Resource Sharing (CORS). + # Both fully qualified domain names and the use of wildcards are supported. + cors: + allowed_origins: + - https://*.test.com # Wildcard subdomain. Allows domains like https://www.test.com and https://foo.test.com but not https://wwwtest.com. + - https://test.com # Fully qualified domain name. Allows https://test.com only. + max_age: 7200 diff --git a/collector/components/lightstepreceiver/testdata/default.yaml b/collector/components/lightstepreceiver/testdata/default.yaml new file mode 100644 index 0000000..72ae86b --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/default.yaml @@ -0,0 +1,2 @@ +protocols: + http: diff --git a/collector/components/lightstepreceiver/testdata/only_http.yaml b/collector/components/lightstepreceiver/testdata/only_http.yaml new file mode 100644 index 0000000..8eb1e0c --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/only_http.yaml @@ -0,0 +1,3 @@ +# The following entry initializes the default Lightstep receiver with only http support. +protocols: + http: diff --git a/collector/components/lightstepreceiver/testdata/only_http_empty_map.yaml b/collector/components/lightstepreceiver/testdata/only_http_empty_map.yaml new file mode 100644 index 0000000..448c8e8 --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/only_http_empty_map.yaml @@ -0,0 +1,3 @@ +# The following entry initializes the default Lightstep receiver with only http support by setting it explicitly to an empty map. +protocols: + http: {} diff --git a/collector/components/lightstepreceiver/testdata/only_http_null.yaml b/collector/components/lightstepreceiver/testdata/only_http_null.yaml new file mode 100644 index 0000000..4a68044 --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/only_http_null.yaml @@ -0,0 +1,3 @@ +# The following entry initializes the default Lightstep receiver with only http support by setting it explicitly to null. +protocols: + http: null diff --git a/collector/components/lightstepreceiver/testdata/typo_default_proto_config.yaml b/collector/components/lightstepreceiver/testdata/typo_default_proto_config.yaml new file mode 100644 index 0000000..16a404a --- /dev/null +++ b/collector/components/lightstepreceiver/testdata/typo_default_proto_config.yaml @@ -0,0 +1,2 @@ +protocols: + htttp: diff --git a/collector/components/lightstepreceiver/to_traces.go b/collector/components/lightstepreceiver/to_traces.go new file mode 100644 index 0000000..eb3cc12 --- /dev/null +++ b/collector/components/lightstepreceiver/to_traces.go @@ -0,0 +1,143 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lightstepreceiver" + +import ( + "errors" + "fmt" + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" + semconv "go.opentelemetry.io/collector/semconv/v1.18.0" + + "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb" +) + +const ( + InstrumentationScopeName = "lightstep-receiver" + InstrumentationScopeVersion = "0.0.1" // TODO: Use the actual internal version? +) + +func ToTraces(req *collectorpb.ReportRequest) (ptrace.Traces, error) { + td := ptrace.NewTraces() + if req.Reporter == nil { + return td, errors.New("Reporter in ReportRequest cannot be null.") + } + if req.GetSpans() == nil || len(req.GetSpans()) == 0 { + return td, nil + } + + reporter := req.GetReporter() + rss := td.ResourceSpans().AppendEmpty() + resource := rss.Resource() + translateTagsToAttrs(reporter.GetTags(), resource.Attributes()) + + serviceName := getServiceName(reporter.GetTags()) + resource.Attributes().PutStr(semconv.AttributeServiceName, serviceName) + sss := rss.ScopeSpans().AppendEmpty() + scope := sss.Scope() + scope.SetName(InstrumentationScopeName) + scope.SetVersion(InstrumentationScopeVersion) + + spans := sss.Spans() + spans.EnsureCapacity(len(req.GetSpans())) + tstampOffset, _ := time.ParseDuration(fmt.Sprintf("%dus", req.GetTimestampOffsetMicros())) + + for _, lspan := range req.GetSpans() { + span := spans.AppendEmpty() + translateToSpan(lspan, span, tstampOffset) + } + + return td, nil +} + +func translateToSpan(lspan *collectorpb.Span, span ptrace.Span, offset time.Duration) { + span.SetName(lspan.GetOperationName()) + translateTagsToAttrs(lspan.GetTags(), span.Attributes()) + + ts := lspan.GetStartTimestamp() + startt := time.Unix(ts.GetSeconds(), int64(ts.GetNanos())) + + duration, _ := time.ParseDuration(fmt.Sprintf("%dus", int64(lspan.GetDurationMicros()))) + span.SetStartTimestamp(pcommon.NewTimestampFromTime(startt.Add(offset))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(startt.Add(duration).Add(offset))) + + // We store our ids using the left-most part of TraceID. + span.SetTraceID(UInt64ToTraceID(0, lspan.GetSpanContext().GetTraceId())) + span.SetSpanID(UInt64ToSpanID(lspan.GetSpanContext().GetSpanId())) + setSpanParents(span, lspan.GetReferences()) + + translateLogsToEvents(span, lspan.GetLogs(), offset) +} + +func translateTagsToAttrs(tags []*collectorpb.KeyValue, attrs pcommon.Map) { + attrs.EnsureCapacity(len(tags)) + for _, kv := range tags { + key := kv.GetKey() + value := kv.GetValue() + switch x := value.(type) { + case *collectorpb.KeyValue_StringValue: + attrs.PutStr(key, x.StringValue) + case *collectorpb.KeyValue_JsonValue: + attrs.PutStr(key, x.JsonValue) + case *collectorpb.KeyValue_IntValue: + attrs.PutInt(key, x.IntValue) + case *collectorpb.KeyValue_DoubleValue: + attrs.PutDouble(key, x.DoubleValue) + case *collectorpb.KeyValue_BoolValue: + attrs.PutBool(key, x.BoolValue) + } + } +} + +func getServiceName(tags []*collectorpb.KeyValue) string { + for _, tag := range tags { + if tag.GetKey() == "lightstep.component_name" { + return tag.GetStringValue() + } + } + + // Identifier used by the SDKs when no service is specified, so we use it too. + return "unknown_service" +} + +func setSpanParents(span ptrace.Span, refs []*collectorpb.Reference) { + if len(refs) == 0 { + return + } + if len(refs) == 1 { // Common case, no need to do extra steps. + span.SetParentSpanID(UInt64ToSpanID(refs[0].GetSpanContext().GetSpanId())) + return + } + + links := span.Links() + links.EnsureCapacity(len(refs)) + is_main_parent_set := false + for _, ref := range refs { + if !is_main_parent_set { + span.SetParentSpanID(UInt64ToSpanID(ref.GetSpanContext().GetSpanId())) + is_main_parent_set = true + } else { + link := links.AppendEmpty() + link.SetSpanID(UInt64ToSpanID(ref.GetSpanContext().GetSpanId())); + link.SetTraceID(UInt64ToTraceID(0, ref.GetSpanContext().GetTraceId())) + } + } +} + +func translateLogsToEvents(span ptrace.Span, logs []*collectorpb.Log, offset time.Duration) { + if len(logs) == 0 { + return + } + + events := span.Events() + events.EnsureCapacity(len(logs)) + for _, log := range logs { + tstamp := time.Unix(log.GetTimestamp().GetSeconds(), int64(log.GetTimestamp().GetNanos())).Add(offset) + event := events.AppendEmpty() + event.SetTimestamp(pcommon.NewTimestampFromTime(tstamp)) + translateTagsToAttrs(log.GetFields(), event.Attributes()) + } +} diff --git a/collector/components/lightstepreceiver/to_traces_test.go b/collector/components/lightstepreceiver/to_traces_test.go new file mode 100644 index 0000000..fa86709 --- /dev/null +++ b/collector/components/lightstepreceiver/to_traces_test.go @@ -0,0 +1,560 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lightstepreceiver" + +import ( + "errors" + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb" +) + +const ( + TraceID1 = 5208512171318403364 + TraceID2 = 1645381947485011451 + SpanID1 = 4819382048639779717 + SpanID2 = 5060571933882717101 + SpanID3 = 1174406194215929934 +) + +func TestTranslateAllMembersNil(t *testing.T) { + req := &collectorpb.ReportRequest{ + Reporter: nil, + Spans: nil, + Auth: nil, + TimestampOffsetMicros: 0, + InternalMetrics: nil, + } + traces, err := ToTraces(req) + assert.Equal(t, errors.New("Reporter in ReportRequest cannot be null."), err) + assert.Equal(t, ptrace.NewTraces(), traces) +} + +func TestTranslateEmptySpans(t *testing.T) { + req := &collectorpb.ReportRequest{ + Reporter: &collectorpb.Reporter{ + Tags: []*collectorpb.KeyValue{ + { + Key: "lightstep.component_name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "GatewayService", + }, + }, + }, + }, + Spans: []*collectorpb.Span{}, + } + traces, err := ToTraces(req) + assert.NoError(t, err) + assert.Equal(t, traces, ptrace.NewTraces()) +} + +func TestAttributes(t *testing.T) { + req := &collectorpb.ReportRequest{ + Reporter: &collectorpb.Reporter{ + Tags: []*collectorpb.KeyValue{ + { + Key: "lightstep.component_name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "GatewayService", + }, + }, + { + Key: "strTag", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "strValue", + }, + }, + { + Key: "intTag", + Value: &collectorpb.KeyValue_IntValue{ + IntValue: 123456789, + }, + }, + { + Key: "doubleTag", + Value: &collectorpb.KeyValue_DoubleValue{ + DoubleValue: 123456.789, + }, + }, + { + Key: "boolTag", + Value: &collectorpb.KeyValue_BoolValue{ + BoolValue: true, + }, + }, + { + Key: "jsonTag", + Value: &collectorpb.KeyValue_JsonValue{ + JsonValue: "{\"foo\": \"bar\"}", + }, + }, + }, + }, + Spans: []*collectorpb.Span{ + { + OperationName: "span1", + Tags: []*collectorpb.KeyValue{ + { + Key: "spanStrTag", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "spanStrValue", + }, + }, + { + Key: "spanIntTag", + Value: &collectorpb.KeyValue_IntValue{ + IntValue: 123456789, + }, + }, + { + Key: "spanDoubleTag", + Value: &collectorpb.KeyValue_DoubleValue{ + DoubleValue: 123456.789, + }, + }, + { + Key: "spanBoolTag", + Value: &collectorpb.KeyValue_BoolValue{ + BoolValue: false, + }, + }, + { + Key: "spanJsonTag", + Value: &collectorpb.KeyValue_JsonValue{ + JsonValue: "{\"foo\": \"bar\"}", + }, + }, + }, + Logs: []*collectorpb.Log{ + { + Fields: []*collectorpb.KeyValue{ + { + Key: "logStrTag", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "logStrValue", + }, + }, + { + Key: "logIntTag", + Value: &collectorpb.KeyValue_IntValue{ + IntValue: 123456789, + }, + }, + { + Key: "logDoubleTag", + Value: &collectorpb.KeyValue_DoubleValue{ + DoubleValue: 123456.789, + }, + }, + { + Key: "logBoolTag", + Value: &collectorpb.KeyValue_BoolValue{ + BoolValue: false, + }, + }, + { + Key: "logJsonTag", + Value: &collectorpb.KeyValue_JsonValue{ + JsonValue: "{\"foo\": \"bar\"}", + }, + }, + }, + }, + }, + }, + }, + } + traces, err := ToTraces(req) + assert.NoError(t, err) + assert.Equal(t, traces, func() ptrace.Traces { + td := ptrace.NewTraces() + rs := td.ResourceSpans().AppendEmpty() + + r := rs.Resource() + rattrs := r.Attributes() + rattrs.PutStr("lightstep.component_name", "GatewayService") + rattrs.PutStr("strTag", "strValue") + rattrs.PutInt("intTag", 123456789) + rattrs.PutDouble("doubleTag", 123456.789) + rattrs.PutBool("boolTag", true) + rattrs.PutStr("jsonTag", "{\"foo\": \"bar\"}") + rattrs.PutStr("service.name", "GatewayService") // derived + + sss := rs.ScopeSpans().AppendEmpty() + scope := sss.Scope() + scope.SetName("lightstep-receiver") + scope.SetVersion("0.0.1") + + spans := sss.Spans() + span1 := spans.AppendEmpty() + span1.SetName("span1") + s1attrs := span1.Attributes() + s1attrs.PutStr("spanStrTag", "spanStrValue") + s1attrs.PutInt("spanIntTag", 123456789) + s1attrs.PutDouble("spanDoubleTag", 123456.789) + s1attrs.PutBool("spanBoolTag", false) + s1attrs.PutStr("spanJsonTag", "{\"foo\": \"bar\"}") + ev := span1.Events().AppendEmpty() + evattrs := ev.Attributes() + evattrs.PutStr("logStrTag", "logStrValue") + evattrs.PutInt("logIntTag", 123456789) + evattrs.PutDouble("logDoubleTag", 123456.789) + evattrs.PutBool("logBoolTag", false) + evattrs.PutStr("logJsonTag", "{\"foo\": \"bar\"}") + + return td + }()) +} + +func TestReferences(t *testing.T) { + req := &collectorpb.ReportRequest{ + Reporter: &collectorpb.Reporter{ + Tags: []*collectorpb.KeyValue{ + { + Key: "lightstep.component_name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "GatewayService", + }, + }, + }, + }, + Spans: []*collectorpb.Span{ + { + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID1, + }, + OperationName: "span1", + }, + { + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID2, + }, + OperationName: "span2", + References: []*collectorpb.Reference{ + { // Parent + Relationship: collectorpb.Reference_CHILD_OF, + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID1, + }, + }, + }, + }, + { + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID3, + }, + OperationName: "span3", + References: []*collectorpb.Reference{ + { // Parent + Relationship: collectorpb.Reference_CHILD_OF, + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID2, + }, + }, + { // Link + Relationship: collectorpb.Reference_FOLLOWS_FROM, + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID1, + }, + }, + { // Link outside the Trace + Relationship: collectorpb.Reference_FOLLOWS_FROM, + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID2, + }, + }, + }, + }, + }, + } + traces, err := ToTraces(req) + assert.NoError(t, err) + assert.Equal(t, traces, func() ptrace.Traces { + td := ptrace.NewTraces() + rs := td.ResourceSpans().AppendEmpty() + + r := rs.Resource() + rattrs := r.Attributes() + rattrs.PutStr("lightstep.component_name", "GatewayService") + rattrs.PutStr("service.name", "GatewayService") // derived + + sss := rs.ScopeSpans().AppendEmpty() + scope := sss.Scope() + scope.SetName("lightstep-receiver") + scope.SetVersion("0.0.1") + + spans := sss.Spans() + span1 := spans.AppendEmpty() + span1.SetName("span1") + span1.SetTraceID(UInt64ToTraceID(0, TraceID1)) + span1.SetSpanID(UInt64ToSpanID(SpanID1)) + + span2 := spans.AppendEmpty() + span2.SetName("span2") + span2.SetTraceID(UInt64ToTraceID(0, TraceID1)) + span2.SetSpanID(UInt64ToSpanID(SpanID2)) + span2.SetParentSpanID(UInt64ToSpanID(SpanID1)) + + span3 := spans.AppendEmpty() + span3.SetName("span3") + span3.SetTraceID(UInt64ToTraceID(0, TraceID1)) + span3.SetSpanID(UInt64ToSpanID(SpanID3)) + span3.SetParentSpanID(UInt64ToSpanID(SpanID2)) + link := span3.Links().AppendEmpty() + link.SetTraceID(UInt64ToTraceID(0, TraceID1)) + link.SetSpanID(UInt64ToSpanID(SpanID1)) + link2 := span3.Links().AppendEmpty() + link2.SetTraceID(UInt64ToTraceID(0, TraceID2)) + + return td + }()) +} + +// ReportRequest has a TimestampOffsetMicros field +// which needs to be added to all the timestamps here, +// if defined. +func TestTimestampOffset(t *testing.T) { + duration, _ := time.ParseDuration(fmt.Sprintf("%dus", 743100000)) + offset, _ := time.ParseDuration(fmt.Sprintf("%dus", 13571113)) + start_t := time.Now() + end_t := start_t.Add(duration) + req := &collectorpb.ReportRequest{ + Reporter: &collectorpb.Reporter{ + ReporterId: 0000000000001, + Tags: []*collectorpb.KeyValue{ + { + Key: "lightstep.component_name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "GatewayService", + }, + }, + }, + }, + // Important parameter. + TimestampOffsetMicros: int32(offset.Microseconds()), + Spans: []*collectorpb.Span{ + { + OperationName: "span1", + StartTimestamp: timestamppb.New(start_t), + DurationMicros: uint64(duration.Microseconds()), + Logs: []*collectorpb.Log{ + { + Timestamp: timestamppb.New(start_t), + Fields: []*collectorpb.KeyValue{ + { + Key: "event.name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "requestStarted", + }, + }, + }, + }, + { + Timestamp: timestamppb.New(end_t), + Fields: []*collectorpb.KeyValue{ + { + Key: "event.name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "requestEnded", + }, + }, + }, + }, + }, + }, + }, + } + traces, err := ToTraces(req) + assert.NoError(t, err) + assert.Equal(t, traces, func() ptrace.Traces { + td := ptrace.NewTraces() + rs := td.ResourceSpans().AppendEmpty() + + r := rs.Resource() + rattrs := r.Attributes() + rattrs.PutStr("lightstep.component_name", "GatewayService") + rattrs.PutStr("service.name", "GatewayService") // derived + + sss := rs.ScopeSpans().AppendEmpty() + scope := sss.Scope() + scope.SetName("lightstep-receiver") + scope.SetVersion("0.0.1") + + spans := sss.Spans() + span1 := spans.AppendEmpty() + span1.SetName("span1") + span1.SetStartTimestamp(pcommon.NewTimestampFromTime(start_t.Add(offset))) + span1.SetEndTimestamp(pcommon.NewTimestampFromTime(end_t.Add(offset))) + ev1 := span1.Events().AppendEmpty() + ev1.SetTimestamp(pcommon.NewTimestampFromTime(start_t.Add(offset))) + ev1.Attributes().PutStr("event.name", "requestStarted") + ev2 := span1.Events().AppendEmpty() + ev2.SetTimestamp(pcommon.NewTimestampFromTime(end_t.Add(offset))) + ev2.Attributes().PutStr("event.name", "requestEnded") + + return td + }()) +} + +func TestTranslateFullSimple(t *testing.T) { + duration, err := time.ParseDuration(fmt.Sprintf("%dus", 743100000)) + start_t := time.Now() + end_t := start_t.Add(duration) + req := &collectorpb.ReportRequest{ + Reporter: &collectorpb.Reporter{ + Tags: []*collectorpb.KeyValue{ + { + Key: "lightstep.component_name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "GatewayService", + }, + }, + { + Key: "custom.id", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "ac2ec213-4251-4ca5-93a9-14a94827c51e", + }, + }, + }, + }, + Spans: []*collectorpb.Span{ + { + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID1, + }, + OperationName: "parent", + StartTimestamp: timestamppb.New(start_t), + DurationMicros: uint64(duration.Microseconds()), + Tags: []*collectorpb.KeyValue{ + { + Key: "status.code", + Value: &collectorpb.KeyValue_IntValue{ + IntValue: 201, + }, + }, + }, + Logs: []*collectorpb.Log{ + { + Timestamp: timestamppb.New(end_t), + Fields: []*collectorpb.KeyValue{ + { + Key: "flush.count", + Value: &collectorpb.KeyValue_IntValue{ + IntValue: 13, + }, + }, + }, + }, + }, + }, + { + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID2, + }, + OperationName: "child", + References: []*collectorpb.Reference{ + { // Parent + Relationship: collectorpb.Reference_CHILD_OF, + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID1, + }, + }, + { // Link + Relationship: collectorpb.Reference_FOLLOWS_FROM, + SpanContext: &collectorpb.SpanContext{ + TraceId: TraceID1, + SpanId: SpanID3, + }, + }, + }, + StartTimestamp: timestamppb.New(start_t), + DurationMicros: uint64(duration.Microseconds()), + Tags: []*collectorpb.KeyValue{ + { + Key: "retry.success", + Value: &collectorpb.KeyValue_BoolValue{ + BoolValue: true, + }, + }, + }, + Logs: []*collectorpb.Log{ + { + Timestamp: timestamppb.New(end_t), + Fields: []*collectorpb.KeyValue{ + { + Key: "gc.count", + Value: &collectorpb.KeyValue_IntValue{ + IntValue: 71, + }, + }, + }, + }, + }, + }, + }, + } + traces, err := ToTraces(req) + assert.NoError(t, err) + assert.Equal(t, traces, func() ptrace.Traces { + td := ptrace.NewTraces() + rs := td.ResourceSpans().AppendEmpty() + + r := rs.Resource() + rattrs := r.Attributes() + rattrs.PutStr("lightstep.component_name", "GatewayService") + rattrs.PutStr("custom.id", "ac2ec213-4251-4ca5-93a9-14a94827c51e") + rattrs.PutStr("service.name", "GatewayService") // derived + + sss := rs.ScopeSpans().AppendEmpty() + scope := sss.Scope() + scope.SetName("lightstep-receiver") + scope.SetVersion("0.0.1") + + spans := sss.Spans() + span1 := spans.AppendEmpty() + span1.SetName("parent") + span1.SetTraceID(UInt64ToTraceID(0, TraceID1)) + span1.SetSpanID(UInt64ToSpanID(SpanID1)) + span1.SetStartTimestamp(pcommon.NewTimestampFromTime(start_t)) + span1.SetEndTimestamp(pcommon.NewTimestampFromTime(end_t)) + span1.Attributes().PutInt("status.code", 201) + ev1 := span1.Events().AppendEmpty() + ev1.SetTimestamp(pcommon.NewTimestampFromTime(end_t)) + ev1.Attributes().PutInt("flush.count", 13) + + span2 := spans.AppendEmpty() + span2.SetName("child") + span2.SetTraceID(UInt64ToTraceID(0, TraceID1)) + span2.SetSpanID(UInt64ToSpanID(SpanID2)) + span2.SetParentSpanID(UInt64ToSpanID(SpanID1)) + span2.SetStartTimestamp(pcommon.NewTimestampFromTime(start_t)) + span2.SetEndTimestamp(pcommon.NewTimestampFromTime(end_t)) + span2.Attributes().PutBool("retry.success", true) + link := span2.Links().AppendEmpty() + link.SetTraceID(UInt64ToTraceID(0, TraceID1)) + link.SetSpanID(UInt64ToSpanID(SpanID3)) + ev2 := span2.Events().AppendEmpty() + ev2.SetTimestamp(pcommon.NewTimestampFromTime(end_t)) + ev2.Attributes().PutInt("gc.count", 71) + + return td + }()) +} diff --git a/collector/components/lightstepreceiver/trace_receiver.go b/collector/components/lightstepreceiver/trace_receiver.go new file mode 100644 index 0000000..637e1c3 --- /dev/null +++ b/collector/components/lightstepreceiver/trace_receiver.go @@ -0,0 +1,148 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lightstepreceiver" + +import ( + "context" + "errors" + "io" + "net" + "net/http" + "sync" + "time" + + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/receiver" + + "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb" +) + +const ( + ContentTypeOctetStream = "application/octet-stream" +) + +var errNextConsumerRespBody = []byte(`"Internal Server Error"`) + +// lightstepReceiver type is used to handle spans received in the Lightstep format. +type lightstepReceiver struct { + consumer consumer.Traces + + shutdownWG sync.WaitGroup + server *http.Server + config *Config + + settings receiver.CreateSettings +} + +var _ http.Handler = (*lightstepReceiver)(nil) + +// newReceiver creates a new lightstepReceiver reference. +func newReceiver(config *Config, consumer consumer.Traces, settings receiver.CreateSettings) (*lightstepReceiver, error) { + lr := &lightstepReceiver{ + consumer: consumer, + config: config, + settings: settings, + } + return lr, nil +} + +// Start spins up the receiver's HTTP server and makes the receiver start its processing. +func (lr *lightstepReceiver) Start(_ context.Context, host component.Host) error { + if host == nil { + return errors.New("nil host") + } + + var err error + lr.server, err = lr.config.HTTP.ToServer(host, lr.settings.TelemetrySettings, lr) + if err != nil { + return err + } + + var listener net.Listener + listener, err = lr.config.HTTP.ToListener() + if err != nil { + return err + } + lr.shutdownWG.Add(1) + go func() { + defer lr.shutdownWG.Done() + + if errHTTP := lr.server.Serve(listener); !errors.Is(errHTTP, http.ErrServerClosed) && errHTTP != nil { + lr.settings.TelemetrySettings.ReportStatus(component.NewFatalErrorEvent(errHTTP)) + } + }() + + return nil +} + +// Shutdown tells the receiver that should stop reception, +// giving it a chance to perform any necessary clean-up and shutting down +// its HTTP server. +func (lr *lightstepReceiver) Shutdown(context.Context) error { + var err error + if lr.server != nil { + err = lr.server.Close() + } + lr.shutdownWG.Wait() + return err +} + +// The lightstepReceiver receives spans from endpoint /api/v2/reports +// unmarshalls them and sends them along to `consumer`. +// Observe we don't actually check for the endpoint path here. +func (lr *lightstepReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { + receive := time.Now() + ctx := r.Context() + + // Now deserialize and process the spans. + pr := r.Body + slurp, _ := io.ReadAll(pr) + if c, ok := pr.(io.Closer); ok { + _ = c.Close() + } + _ = r.Body.Close() + + var reportRequest = &collectorpb.ReportRequest{} + err := proto.Unmarshal(slurp, reportRequest) + + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + var td ptrace.Traces + td, err = ToTraces(reportRequest) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + consumerErr := lr.consumer.ConsumeTraces(ctx, td) + + if consumerErr != nil { + // Transient error, due to some internal condition. + w.WriteHeader(http.StatusInternalServerError) + _, _ = w.Write(errNextConsumerRespBody) + return + } + + resp := &collectorpb.ReportResponse{ + ReceiveTimestamp: timestamppb.New(receive), + TransmitTimestamp: timestamppb.New(time.Now()), + } + bytes, err := proto.Marshal(resp) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + // Finally send back the response "Accepted" + w.WriteHeader(http.StatusAccepted) + w.Header().Set("Content-Type", ContentTypeOctetStream) + w.Write(bytes) +} diff --git a/collector/components/lightstepreceiver/trace_receiver_test.go b/collector/components/lightstepreceiver/trace_receiver_test.go new file mode 100644 index 0000000..d8e7d08 --- /dev/null +++ b/collector/components/lightstepreceiver/trace_receiver_test.go @@ -0,0 +1,79 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package lightstepreceiver + +import ( + "context" + "net" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestNew(t *testing.T) { + type args struct { + address string + nextConsumer consumer.Traces + } + tests := []struct { + name string + args args + wantErr error + }{ + { + name: "happy path", + args: args{ + nextConsumer: consumertest.NewNop(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cfg := &Config{ + Protocols: Protocols{ + HTTP: &HTTPConfig{ + ServerConfig: &confighttp.ServerConfig{ + Endpoint: "0.0.0.0:443", + }, + }, + }, + } + + got, err := newReceiver(cfg, tt.args.nextConsumer, receivertest.NewNopCreateSettings()) + require.Equal(t, tt.wantErr, err) + if tt.wantErr == nil { + require.NotNil(t, got) + } else { + require.Nil(t, got) + } + }) + } +} + +func TestReceiverPortAlreadyInUse(t *testing.T) { + l, err := net.Listen("tcp", "localhost:") + require.NoError(t, err, "failed to open a port: %v", err) + defer l.Close() + _, portStr, err := net.SplitHostPort(l.Addr().String()) + require.NoError(t, err, "failed to split listener address: %v", err) + cfg := &Config{ + Protocols: Protocols{ + HTTP: &HTTPConfig{ + ServerConfig: &confighttp.ServerConfig{ + Endpoint: "localhost:" + portStr, + }, + }, + }, + } + traceReceiver, err := newReceiver(cfg, consumertest.NewNop(), receivertest.NewNopCreateSettings()) + require.NoError(t, err, "Failed to create receiver: %v", err) + err = traceReceiver.Start(context.Background(), componenttest.NewNopHost()) + require.Error(t, err) +} + diff --git a/collector/otelcol-builder.yaml b/collector/otelcol-builder.yaml index 2475964..3de60e1 100644 --- a/collector/otelcol-builder.yaml +++ b/collector/otelcol-builder.yaml @@ -63,6 +63,10 @@ receivers: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.98.0 - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.98.0 + - gomod: "github.com/lightstep/sn-collector/collector/lightstepreceiver v0.0.1" + name: "lightstepreceiver" + path: "./components/lightstepreceiver" + connectors: - gomod: From 3ccea9961e85f09518cf05f70f64a486a781f52b Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Fri, 31 May 2024 19:29:42 +0200 Subject: [PATCH 02/14] Fix format. --- collector/components/lightstepreceiver/config.go | 4 ++-- collector/components/lightstepreceiver/factory.go | 4 ++-- .../internal/collectorpb/collector.pb.go | 2 ++ collector/components/lightstepreceiver/to_traces.go | 4 ++-- .../components/lightstepreceiver/trace_receiver.go | 12 ++++++------ .../lightstepreceiver/trace_receiver_test.go | 1 - 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/collector/components/lightstepreceiver/config.go b/collector/components/lightstepreceiver/config.go index 179f717..c44acd5 100644 --- a/collector/components/lightstepreceiver/config.go +++ b/collector/components/lightstepreceiver/config.go @@ -14,7 +14,7 @@ import ( const ( protocolsFieldName = "protocols" - protoHTTP = "http" + protoHTTP = "http" ) type HTTPConfig struct { @@ -37,7 +37,7 @@ var _ component.Config = (*Config)(nil) // Validate checks the receiver configuration is valid func (cfg *Config) Validate() error { if cfg.HTTP == nil { - return errors.New("must specify at least one protocol when using the Lightstep receiver") + return errors.New("must specify at least one protocol when using the Lightstep receiver") } return nil } diff --git a/collector/components/lightstepreceiver/factory.go b/collector/components/lightstepreceiver/factory.go index 11a9f6f..5dc4d85 100644 --- a/collector/components/lightstepreceiver/factory.go +++ b/collector/components/lightstepreceiver/factory.go @@ -33,8 +33,8 @@ func NewFactory() receiver.Factory { // createDefaultConfig creates the default configuration for Lightstep receiver. func createDefaultConfig() component.Config { return &Config{ - Protocols: Protocols { - HTTP: &HTTPConfig { + Protocols: Protocols{ + HTTP: &HTTPConfig{ ServerConfig: &confighttp.ServerConfig{ Endpoint: defaultBindEndpoint, }, diff --git a/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go index e39b8e5..5dd8307 100644 --- a/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go +++ b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go @@ -5,9 +5,11 @@ Package collectorpb is a generated protocol buffer package. It is generated from these files: + lightstep/collector/collector.proto It has these top-level messages: + SpanContext KeyValue Log diff --git a/collector/components/lightstepreceiver/to_traces.go b/collector/components/lightstepreceiver/to_traces.go index eb3cc12..a36f5bd 100644 --- a/collector/components/lightstepreceiver/to_traces.go +++ b/collector/components/lightstepreceiver/to_traces.go @@ -16,7 +16,7 @@ import ( ) const ( - InstrumentationScopeName = "lightstep-receiver" + InstrumentationScopeName = "lightstep-receiver" InstrumentationScopeVersion = "0.0.1" // TODO: Use the actual internal version? ) @@ -121,7 +121,7 @@ func setSpanParents(span ptrace.Span, refs []*collectorpb.Reference) { is_main_parent_set = true } else { link := links.AppendEmpty() - link.SetSpanID(UInt64ToSpanID(ref.GetSpanContext().GetSpanId())); + link.SetSpanID(UInt64ToSpanID(ref.GetSpanContext().GetSpanId())) link.SetTraceID(UInt64ToTraceID(0, ref.GetSpanContext().GetTraceId())) } } diff --git a/collector/components/lightstepreceiver/trace_receiver.go b/collector/components/lightstepreceiver/trace_receiver.go index 637e1c3..513990c 100644 --- a/collector/components/lightstepreceiver/trace_receiver.go +++ b/collector/components/lightstepreceiver/trace_receiver.go @@ -13,11 +13,11 @@ import ( "time" "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/types/known/timestamppb" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/receiver" + "google.golang.org/protobuf/types/known/timestamppb" "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb" ) @@ -36,7 +36,7 @@ type lightstepReceiver struct { server *http.Server config *Config - settings receiver.CreateSettings + settings receiver.CreateSettings } var _ http.Handler = (*lightstepReceiver)(nil) @@ -44,9 +44,9 @@ var _ http.Handler = (*lightstepReceiver)(nil) // newReceiver creates a new lightstepReceiver reference. func newReceiver(config *Config, consumer consumer.Traces, settings receiver.CreateSettings) (*lightstepReceiver, error) { lr := &lightstepReceiver{ - consumer: consumer, - config: config, - settings: settings, + consumer: consumer, + config: config, + settings: settings, } return lr, nil } @@ -132,7 +132,7 @@ func (lr *lightstepReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { } resp := &collectorpb.ReportResponse{ - ReceiveTimestamp: timestamppb.New(receive), + ReceiveTimestamp: timestamppb.New(receive), TransmitTimestamp: timestamppb.New(time.Now()), } bytes, err := proto.Marshal(resp) diff --git a/collector/components/lightstepreceiver/trace_receiver_test.go b/collector/components/lightstepreceiver/trace_receiver_test.go index d8e7d08..3fdca54 100644 --- a/collector/components/lightstepreceiver/trace_receiver_test.go +++ b/collector/components/lightstepreceiver/trace_receiver_test.go @@ -76,4 +76,3 @@ func TestReceiverPortAlreadyInUse(t *testing.T) { err = traceReceiver.Start(context.Background(), componenttest.NewNopHost()) require.Error(t, err) } - From 2c3477a039487dabe0110cf6b0f2165b6c67b70b Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Tue, 4 Jun 2024 16:42:41 +0200 Subject: [PATCH 03/14] Add a full reception test to increase coverage. We already test our translation layer extensively but want to do a full operation test as well. --- .../lightstepreceiver/big_endian_converter.go | 12 +- .../lightstepreceiver/to_traces_test.go | 33 ++++++ .../lightstepreceiver/trace_receiver_test.go | 107 ++++++++++++++++++ 3 files changed, 141 insertions(+), 11 deletions(-) diff --git a/collector/components/lightstepreceiver/big_endian_converter.go b/collector/components/lightstepreceiver/big_endian_converter.go index ebe932f..68cbd97 100644 --- a/collector/components/lightstepreceiver/big_endian_converter.go +++ b/collector/components/lightstepreceiver/big_endian_converter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Copied from github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/idutils +// Partially copied from github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/idutils package lightstepreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lightstepreceiver" @@ -19,19 +19,9 @@ func UInt64ToTraceID(high, low uint64) pcommon.TraceID { return traceID } -// TraceIDToUInt64Pair converts the pcommon.TraceID to a pair of uint64 representation. -func TraceIDToUInt64Pair(traceID pcommon.TraceID) (uint64, uint64) { - return binary.BigEndian.Uint64(traceID[:8]), binary.BigEndian.Uint64(traceID[8:]) -} - // UInt64ToSpanID converts the uint64 representation of a SpanID to pcommon.SpanID. func UInt64ToSpanID(id uint64) pcommon.SpanID { spanID := [8]byte{} binary.BigEndian.PutUint64(spanID[:], id) return pcommon.SpanID(spanID) } - -// SpanIDToUInt64 converts the pcommon.SpanID to uint64 representation. -func SpanIDToUInt64(spanID pcommon.SpanID) uint64 { - return binary.BigEndian.Uint64(spanID[:]) -} diff --git a/collector/components/lightstepreceiver/to_traces_test.go b/collector/components/lightstepreceiver/to_traces_test.go index fa86709..e30c286 100644 --- a/collector/components/lightstepreceiver/to_traces_test.go +++ b/collector/components/lightstepreceiver/to_traces_test.go @@ -57,6 +57,39 @@ func TestTranslateEmptySpans(t *testing.T) { assert.Equal(t, traces, ptrace.NewTraces()) } +func TestTranslatNoComponentName(t *testing.T) { + req := &collectorpb.ReportRequest{ + Reporter: &collectorpb.Reporter{}, + Spans: []*collectorpb.Span{ + { + OperationName: "span1", + }, + }, + } + traces, err := ToTraces(req) + assert.NoError(t, err) + assert.Equal(t, traces, func() ptrace.Traces { + td := ptrace.NewTraces() + rs := td.ResourceSpans().AppendEmpty() + + r := rs.Resource() + rattrs := r.Attributes() + rattrs.PutStr("service.name", "unknown_service") // fallback + + sss := rs.ScopeSpans().AppendEmpty() + scope := sss.Scope() + scope.SetName("lightstep-receiver") + scope.SetVersion("0.0.1") + + spans := sss.Spans() + span1 := spans.AppendEmpty() + span1.SetName("span1") + + return td + }()) + +} + func TestAttributes(t *testing.T) { req := &collectorpb.ReportRequest{ Reporter: &collectorpb.Reporter{ diff --git a/collector/components/lightstepreceiver/trace_receiver_test.go b/collector/components/lightstepreceiver/trace_receiver_test.go index 3fdca54..7e5a3fd 100644 --- a/collector/components/lightstepreceiver/trace_receiver_test.go +++ b/collector/components/lightstepreceiver/trace_receiver_test.go @@ -4,16 +4,23 @@ package lightstepreceiver import ( + "bytes" "context" "net" + "net/http" "testing" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/receiver/receivertest" + + "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb" ) func TestNew(t *testing.T) { @@ -76,3 +83,103 @@ func TestReceiverPortAlreadyInUse(t *testing.T) { err = traceReceiver.Start(context.Background(), componenttest.NewNopHost()) require.Error(t, err) } + +func TestSimpleRequest(t *testing.T) { + addr := findAvailableAddress(t) + cfg := &Config{ + Protocols: Protocols{ + HTTP: &HTTPConfig{ + ServerConfig: &confighttp.ServerConfig{ + Endpoint: addr, + }, + }, + }, + } + sink := new(consumertest.TracesSink) + + traceReceiver, err := newReceiver(cfg, sink, receivertest.NewNopCreateSettings()) + require.NoError(t, err, "Failed to create receiver: %v", err) + err = traceReceiver.Start(context.Background(), componenttest.NewNopHost()) + require.NoError(t, err, "Failed to start receiver: %v", err) + t.Cleanup(func() { require.NoError(t, traceReceiver.Shutdown(context.Background())) }) + + httpReq, err := createHttpRequest(addr, createSimpleRequest()) + require.NoError(t, err) + + client := http.Client{} + httpResp, err := client.Do(httpReq) + require.NoError(t, err) + require.Equal(t, httpResp.StatusCode, 202) + + traces := sink.AllTraces() + assert.Equal(t, len(traces), 1) + assert.Equal(t, traces[0], func() ptrace.Traces { + td := ptrace.NewTraces() + rs := td.ResourceSpans().AppendEmpty() + + r := rs.Resource() + rattrs := r.Attributes() + rattrs.PutStr("lightstep.component_name", "GatewayService") + rattrs.PutStr("service.name", "GatewayService") // derived + + sss := rs.ScopeSpans().AppendEmpty() + scope := sss.Scope() + scope.SetName("lightstep-receiver") + scope.SetVersion("0.0.1") + + spans := sss.Spans() + span1 := spans.AppendEmpty() + span1.SetName("span1") + return td + }()) +} + +func createHttpRequest(addr string, req *collectorpb.ReportRequest) (*http.Request, error) { + buff, err := proto.Marshal(req) + if err != nil { + return nil, err + } + + requestBody := bytes.NewReader(buff) + request, err := http.NewRequest("POST", "http://"+addr, requestBody) + if err != nil { + return nil, err + } + + request.Header.Set("Content-Type", ContentTypeOctetStream) + request.Header.Set("Accept", ContentTypeOctetStream) + + return request, nil +} + +func createSimpleRequest() *collectorpb.ReportRequest { + return &collectorpb.ReportRequest{ + Reporter: &collectorpb.Reporter{ + Tags: []*collectorpb.KeyValue{ + { + Key: "lightstep.component_name", + Value: &collectorpb.KeyValue_StringValue{ + StringValue: "GatewayService", + }, + }, + }, + }, + Spans: []*collectorpb.Span{ + { + OperationName: "span1", + }, + }, + } +} + +// Copied from the testutils package in the main collector repo. +func findAvailableAddress(t testing.TB) string { + ln, err := net.Listen("tcp", "localhost:0") + require.NoError(t, err, "Failed to get a free local port") + // There is a possible race if something else takes this same port before + // the test uses it, however, that is unlikely in practice. + defer func() { + assert.NoError(t, ln.Close()) + }() + return ln.Addr().String() +} From ae6b96a4b8e3c39aade4620c4e503d2b3fb0d960 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Fri, 7 Jun 2024 17:39:24 +0200 Subject: [PATCH 04/14] Expand notes. --- .../components/lightstepreceiver/DESIGN.md | 33 +++++++++++++------ .../components/lightstepreceiver/to_traces.go | 2 +- .../lightstepreceiver/trace_receiver.go | 3 +- .../lightstepreceiver/trace_receiver_test.go | 2 +- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/collector/components/lightstepreceiver/DESIGN.md b/collector/components/lightstepreceiver/DESIGN.md index 7446601..c272b26 100644 --- a/collector/components/lightstepreceiver/DESIGN.md +++ b/collector/components/lightstepreceiver/DESIGN.md @@ -2,10 +2,21 @@ ## Summary -This receiver mimics what is provided by the Lightstep Microsatellites: +This receiver exposes *very* basic functionality, with only http/protobuf support +(initially). Details are: -* Clock correction: The legacy tracers and this receiver send each other - timestamp values in order to sync up any missmatched clocks. +* `ReportRequest` is the protobuf we send/receive, with `ReportRequest.Report` + being similar to `Resource` (e.g. `Resource` has attributes in its `Tags` attribute). +* Legacy tracers send the service name as `lightstep.component_name` in + `ReportRequest.Report.Tags`, and we derive the actual OTel `service.name` + from it, falling back to `unknown_service`. +* We do a **raw** ingestion/conversion, meaning we don't do any semconv mapping, + other than deriving `service.name` from `lightstep.component_name`. See + TODO below. +* Legacy tracers send 64 bits TraceIds, which we convert to 128 bytes OTel ids. +* Clock correction: Some legacy tracers (Java) perform clock correction, sending + along a timeoffset to be applied, and expecting back Receive/Transmit + timestamps from the microsatellites/collector: - `ReportRequest`: `TimestampOffsetMicros` includes an offset that MUST be applied to all timestamps being reported. This value is zero if no clock correction is required. @@ -16,15 +27,17 @@ This receiver mimics what is provided by the Lightstep Microsatellites: ## TODO -* Implement gRPC support. * Implement OBSReport. +* Legacy tracers send payloads using the `application/octet-stream` content type and using the + `/api/v2/reports` path. We don't check for it but worth verifying this (at least the + content-type). +* Top level `ReporterId` is not being used at this moment. +* `Baggage` is being sent as part of Lightstep's `SpanContext`, but it is not exported in any way at this point. +* Find all special Tags (e.g. "lightstep.*") and think which ones we should map. +* Implement gRPC support. +* Implement Thrift support. * Consider mapping semantic conventions: - Values that can be consumed within the processor, e.g. detect event names from Logs, detect `StatusKind` from error tags. + - Consider using the OpenTracing compatibilty section in the Specification, which states how to process errors and multiple parents. - Values that affect the entire OT ecosystem. Probably can be offered as a separate processor instead. - Lightstep-specific tags (attributes) that _may_ need to be mapped to become useful for OTel processors. -* `Baggage` is being sent as part of Lightstep's `SpanContext`, but it is not exported in any way at this point. -* Find all special Tags (e.g. "lightstep.component_name") and think which ones we should map - (there is already a document about this somewhere). -* Legacy tracers send payloads using the `application/octet-stream` content type and using the - `/api/v2/reports` path. We don't check for it but worth verifying this. -* Top level `ReporterId` is not being used at this moment. diff --git a/collector/components/lightstepreceiver/to_traces.go b/collector/components/lightstepreceiver/to_traces.go index a36f5bd..2dc65ce 100644 --- a/collector/components/lightstepreceiver/to_traces.go +++ b/collector/components/lightstepreceiver/to_traces.go @@ -64,7 +64,7 @@ func translateToSpan(lspan *collectorpb.Span, span ptrace.Span, offset time.Dura span.SetStartTimestamp(pcommon.NewTimestampFromTime(startt.Add(offset))) span.SetEndTimestamp(pcommon.NewTimestampFromTime(startt.Add(duration).Add(offset))) - // We store our ids using the left-most part of TraceID. + // Legacy tracers use TraceIds of only 64 bit length. span.SetTraceID(UInt64ToTraceID(0, lspan.GetSpanContext().GetTraceId())) span.SetSpanID(UInt64ToSpanID(lspan.GetSpanContext().GetSpanId())) setSpanParents(span, lspan.GetReferences()) diff --git a/collector/components/lightstepreceiver/trace_receiver.go b/collector/components/lightstepreceiver/trace_receiver.go index 513990c..06dadaf 100644 --- a/collector/components/lightstepreceiver/trace_receiver.go +++ b/collector/components/lightstepreceiver/trace_receiver.go @@ -23,6 +23,7 @@ import ( ) const ( + ContentType = "Content-Type" ContentTypeOctetStream = "application/octet-stream" ) @@ -143,6 +144,6 @@ func (lr *lightstepReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Finally send back the response "Accepted" w.WriteHeader(http.StatusAccepted) - w.Header().Set("Content-Type", ContentTypeOctetStream) + w.Header().Set(ContentType, ContentTypeOctetStream) w.Write(bytes) } diff --git a/collector/components/lightstepreceiver/trace_receiver_test.go b/collector/components/lightstepreceiver/trace_receiver_test.go index 7e5a3fd..5d3f097 100644 --- a/collector/components/lightstepreceiver/trace_receiver_test.go +++ b/collector/components/lightstepreceiver/trace_receiver_test.go @@ -146,7 +146,7 @@ func createHttpRequest(addr string, req *collectorpb.ReportRequest) (*http.Reque return nil, err } - request.Header.Set("Content-Type", ContentTypeOctetStream) + request.Header.Set(ContentType, ContentTypeOctetStream) request.Header.Set("Accept", ContentTypeOctetStream) return request, nil From b118a31175d73113a56cad8dc7bab4e7f0c213d6 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 09:40:18 -0700 Subject: [PATCH 05/14] Update build to 102.x --- collector/Makefile | 2 +- collector/otelcol-builder.yaml | 64 ++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/collector/Makefile b/collector/Makefile index 22e09c0..bce9f19 100644 --- a/collector/Makefile +++ b/collector/Makefile @@ -38,7 +38,7 @@ install-tools: install-builder .PHONY: install-builder - Install the builder install-builder: - go install "go.opentelemetry.io/collector/cmd/builder@v0.98.0" + go install "go.opentelemetry.io/collector/cmd/builder@v0.102.1" .PHONY: docker - Build docker image docker: diff --git a/collector/otelcol-builder.yaml b/collector/otelcol-builder.yaml index 01899d7..d8b1456 100644 --- a/collector/otelcol-builder.yaml +++ b/collector/otelcol-builder.yaml @@ -2,76 +2,78 @@ dist: name: otelcol-servicenow description: ServiceNow-flavored OpenTelemetry Collector distro output_path: ./otelcol-servicenow - otelcol_version: 0.98.0 + otelcol_version: 0.102.1 version: 0.0.14 exporters: - gomod: - go.opentelemetry.io/collector/exporter/debugexporter v0.98.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.102.1 # Logging exporter is deprecated, but it's here to support the default OpenTelemetry Collector Helm chart as of 2/23/24 - gomod: - go.opentelemetry.io/collector/exporter/loggingexporter v0.98.0 + go.opentelemetry.io/collector/exporter/loggingexporter v0.102.1 - gomod: - go.opentelemetry.io/collector/exporter/otlpexporter v0.98.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.102.1 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.102.0 - gomod: "github.com/lightstep/sn-collector/collector/servicenowexporter v0.0.1" name: "servicenowexporter" path: "./components/servicenowexporter" - - gomod: github.com/open-telemetry/otel-arrow/collector v0.22.0 - import: github.com/open-telemetry/otel-arrow/collector/exporter/otelarrowexporter + - gomod: + github.com/open-telemetry/otel-arrow/collector/exporter/otelarrowexporter v0.24.0 processors: - - gomod: github.com/open-telemetry/otel-arrow/collector v0.22.0 - import: github.com/open-telemetry/otel-arrow/collector/processor/concurrentbatchprocessor - gomod: - go.opentelemetry.io/collector/processor/batchprocessor v0.98.0 + github.com/open-telemetry/otel-arrow/collector/processor/concurrentbatchprocessor v0.24.0 + - gomod: + go.opentelemetry.io/collector/processor/batchprocessor v0.102.1 # We don't recommend memory limiter, but it's here to support the default OpenTelemetry Collector Helm chart as of 2/23/24 - gomod: - go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.98.0 + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.102.1 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.102.0 receivers: - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/osqueryreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/osqueryreceiver v0.102.0 + - gomod: + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azuremonitorreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azuremonitorreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sobjectsreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sobjectsreceiver v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.98.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.102.1 - gomod: - go.opentelemetry.io/collector/receiver/otlpreceiver v0.98.0 + github.com/open-telemetry/otel-arrow/collector/receiver/otelarrowreceiver v0.24.0 connectors: - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector v0.102.0 extensions: - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.102.0 - gomod: - github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.98.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.102.0 From 37fd38fe4e743721d0595177127f1c474656770a Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 09:42:00 -0700 Subject: [PATCH 06/14] tidy --- .../components/servicenowexporter/go.mod | 43 ++++--- .../components/servicenowexporter/go.sum | 118 +++++++++--------- 2 files changed, 77 insertions(+), 84 deletions(-) diff --git a/collector/components/servicenowexporter/go.mod b/collector/components/servicenowexporter/go.mod index a276e24..dcca616 100644 --- a/collector/components/servicenowexporter/go.mod +++ b/collector/components/servicenowexporter/go.mod @@ -1,18 +1,18 @@ module github.com/lightstep/sn-collector/collector/servicenowexporter -go 1.21 +go 1.21.0 -toolchain go1.21.3 +toolchain go1.22.2 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.98.0 - go.opentelemetry.io/collector/config/configopaque v1.5.0 - go.opentelemetry.io/collector/config/configretry v0.98.0 - go.opentelemetry.io/collector/exporter v0.98.0 - go.opentelemetry.io/collector/pdata v1.5.0 - go.opentelemetry.io/otel/metric v1.25.0 - go.opentelemetry.io/otel/trace v1.25.0 + go.opentelemetry.io/collector/component v0.102.1 + go.opentelemetry.io/collector/config/configopaque v1.9.0 + go.opentelemetry.io/collector/config/configretry v0.102.1 + go.opentelemetry.io/collector/exporter v0.102.1 + go.opentelemetry.io/collector/pdata v1.9.0 + go.opentelemetry.io/otel/metric v1.27.0 + go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/zap v1.27.0 ) @@ -21,7 +21,6 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -31,18 +30,18 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector v0.98.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.98.0 // indirect - go.opentelemetry.io/collector/confmap v0.98.0 // indirect - go.opentelemetry.io/collector/consumer v0.98.0 // indirect - go.opentelemetry.io/collector/extension v0.98.0 // indirect - go.opentelemetry.io/otel v1.25.0 // indirect + go.opentelemetry.io/collector v0.102.1 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect + go.opentelemetry.io/collector/confmap v0.102.1 // indirect + go.opentelemetry.io/collector/consumer v0.102.1 // indirect + go.opentelemetry.io/collector/extension v0.102.1 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect - google.golang.org/grpc v1.62.1 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collector/components/servicenowexporter/go.sum b/collector/components/servicenowexporter/go.sum index e859a7f..4c42ffe 100644 --- a/collector/components/servicenowexporter/go.sum +++ b/collector/components/servicenowexporter/go.sum @@ -2,8 +2,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -15,10 +15,6 @@ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsM github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -49,14 +45,14 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -65,42 +61,42 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector v0.98.0 h1:O7bpARGWzNfFQEYevLl4iigDrpGTJY3vV/kKqNZzMOk= -go.opentelemetry.io/collector v0.98.0/go.mod h1:fvPM+tBML07uvAP1MV2msYPSYJ9U/lgE1jDb3AFBaMM= -go.opentelemetry.io/collector/component v0.98.0 h1:0TMaBOyCdABiVLFdGOgG8zd/1IeGldCinYonbY08xWk= -go.opentelemetry.io/collector/component v0.98.0/go.mod h1:F6zyQLsoExl6r2q6WWZm8rmSSALbwG2zwIHLrMzZVio= -go.opentelemetry.io/collector/config/configopaque v1.5.0 h1:WJzgmsFU2v63BypPBNGL31ACwWn6PwumPJNpLZplcdE= -go.opentelemetry.io/collector/config/configopaque v1.5.0/go.mod h1:/otnfj2E8r5EfaAdNV4qHkTclmiBCZXaahV5EcLwT7k= -go.opentelemetry.io/collector/config/configretry v0.98.0 h1:gZRenX9oMLJmQ/CD8YwFNl9YYl68RtcD0RYSCJhrMAk= -go.opentelemetry.io/collector/config/configretry v0.98.0/go.mod h1:uRdmPeCkrW9Zsadh2WEbQ1AGXGYJ02vCfmmT+0g69nY= -go.opentelemetry.io/collector/config/configtelemetry v0.98.0 h1:f8RNZ1l/kYPPoxFmKKvTUli8iON7CMsm85KM38PVNts= -go.opentelemetry.io/collector/config/configtelemetry v0.98.0/go.mod h1:YV5PaOdtnU1xRomPcYqoHmyCr48tnaAREeGO96EZw8o= -go.opentelemetry.io/collector/confmap v0.98.0 h1:qQreBlrqio1y7uhrAvr+W86YbQ6fw7StgkbYpvJ2vVc= -go.opentelemetry.io/collector/confmap v0.98.0/go.mod h1:BWKPIpYeUzSG6ZgCJMjF7xsLvyrvJCfYURl57E5vhiQ= -go.opentelemetry.io/collector/consumer v0.98.0 h1:47zJ5HFKXVA0RciuwkZnPU5W8j0TYUxToB1/zzzgEhs= -go.opentelemetry.io/collector/consumer v0.98.0/go.mod h1:c2edTq38uVJET/NE6VV7/Qpyznnlz8b6VE7J6TXD57c= -go.opentelemetry.io/collector/exporter v0.98.0 h1:eN2qtkiwpeX9gBu9JZw1k/CZ3N9wZE1aGJ1A0EvwJ7w= -go.opentelemetry.io/collector/exporter v0.98.0/go.mod h1:GCW46a0VAuW7nljlW//GgFXI+8mSrJjrdEKVO9icExE= -go.opentelemetry.io/collector/extension v0.98.0 h1:08B5ipEsoNmPHY96j5EUsUrFre01GOZ4zgttUDtPUkY= -go.opentelemetry.io/collector/extension v0.98.0/go.mod h1:fZ1Hnnahszl5j3xcW2sMRJ0FLWDOFkFMQeVDP0Se7i8= -go.opentelemetry.io/collector/pdata v1.5.0 h1:1fKTmUpr0xCOhP/B0VEvtz7bYPQ45luQ8XFyA07j8LE= -go.opentelemetry.io/collector/pdata v1.5.0/go.mod h1:TYj8aKRWZyT/KuKQXKyqSEvK/GV+slFaDMEI+Ke64Yw= -go.opentelemetry.io/collector/pdata/testdata v0.98.0 h1:8gohV+LFXqMzuDwfOOQy9GcZBOX0C9xGoQkoeXFTzmI= -go.opentelemetry.io/collector/pdata/testdata v0.98.0/go.mod h1:B/IaHcf6+RtxI292CZu9TjfYQdi1n4+v6b8rHEonpKs= -go.opentelemetry.io/collector/receiver v0.98.0 h1:qw6JYwm+sHcZvM1DByo3QlGe6yGHuwd0yW4hEPVqYKU= -go.opentelemetry.io/collector/receiver v0.98.0/go.mod h1:AwIWn+KnquTR+kbhXQrMH+i2PvTCFldSIJznBWFYs0s= -go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k= -go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg= -go.opentelemetry.io/otel/exporters/prometheus v0.47.0 h1:OL6yk1Z/pEGdDnrBbxSsH+t4FY1zXfBRGd7bjwhlMLU= -go.opentelemetry.io/otel/exporters/prometheus v0.47.0/go.mod h1:xF3N4OSICZDVbbYZydz9MHFro1RjmkPUKEvar2utG+Q= -go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA= -go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s= -go.opentelemetry.io/otel/sdk v1.25.0 h1:PDryEJPC8YJZQSyLY5eqLeafHtG+X7FWnf3aXMtxbqo= -go.opentelemetry.io/otel/sdk v1.25.0/go.mod h1:oFgzCM2zdsxKzz6zwpTZYLLQsFwc+K0daArPdIhuxkw= -go.opentelemetry.io/otel/sdk/metric v1.25.0 h1:7CiHOy08LbrxMAp4vWpbiPcklunUshVpAvGBrdDRlGw= -go.opentelemetry.io/otel/sdk/metric v1.25.0/go.mod h1:LzwoKptdbBBdYfvtGCzGwk6GWMA3aUzBOwtQpR6Nz7o= -go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM= -go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I= +go.opentelemetry.io/collector v0.102.1 h1:M/ciCcReQsSDYG9bJ2Qwqk7pQILDJ2bM/l0MdeCAvJE= +go.opentelemetry.io/collector v0.102.1/go.mod h1:yF1lDRgL/Eksb4/LUnkMjvLvHHpi6wqBVlzp+dACnPM= +go.opentelemetry.io/collector/component v0.102.1 h1:66z+LN5dVCXhvuVKD1b56/3cYLK+mtYSLIwlskYA9IQ= +go.opentelemetry.io/collector/component v0.102.1/go.mod h1:XfkiSeImKYaewT2DavA80l0VZ3JjvGndZ8ayPXfp8d0= +go.opentelemetry.io/collector/config/configopaque v1.9.0 h1:jocenLdK/rVG9UoGlnpiBxXLXgH5NhIXCrVSTyKVYuA= +go.opentelemetry.io/collector/config/configopaque v1.9.0/go.mod h1:8v1yaH4iYjcigbbyEaP/tzVXeFm4AaAsKBF9SBeqaG4= +go.opentelemetry.io/collector/config/configretry v0.102.1 h1:J5/tXBL8P7d7HT5dxsp2H+//SkwDXR66Z9UTgRgtAzk= +go.opentelemetry.io/collector/config/configretry v0.102.1/go.mod h1:P+RA0IA+QoxnDn4072uyeAk1RIoYiCbxYsjpKX5eFC4= +go.opentelemetry.io/collector/config/configtelemetry v0.102.1 h1:f/CYcrOkaHd+COIJ2lWnEgBCHfhEycpbow4ZhrGwAlA= +go.opentelemetry.io/collector/config/configtelemetry v0.102.1/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/confmap v0.102.1 h1:wZuH+d/P11Suz8wbp+xQCJ0BPE9m5pybtUe74c+rU7E= +go.opentelemetry.io/collector/confmap v0.102.1/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= +go.opentelemetry.io/collector/consumer v0.102.1 h1:0CkgHhxwx4lI/m+hWjh607xyjooW5CObZ8hFQy5vvo0= +go.opentelemetry.io/collector/consumer v0.102.1/go.mod h1:HoXqmrRV13jLnP3/Gg3fYNdRkDPoO7UW58hKiLyFF60= +go.opentelemetry.io/collector/exporter v0.102.1 h1:4VURYgBNJscxfMhZWitzcwA1cig5a6pH0xZSpdECDnM= +go.opentelemetry.io/collector/exporter v0.102.1/go.mod h1:1pmNxvrvvbWDW6PiGObICdj0eOSGV4Fzwpm5QA1GU54= +go.opentelemetry.io/collector/extension v0.102.1 h1:gAvE3w15q+Vv0Tj100jzcDpeMTyc8dAiemHRtJbspLg= +go.opentelemetry.io/collector/extension v0.102.1/go.mod h1:XBxUOXjZpwYLZYOK5u3GWlbBTOKmzStY5eU1R/aXkIo= +go.opentelemetry.io/collector/pdata v1.9.0 h1:qyXe3HEVYYxerIYu0rzgo1Tx2d1Zs6iF+TCckbHLFOw= +go.opentelemetry.io/collector/pdata v1.9.0/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w= +go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= +go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= +go.opentelemetry.io/collector/receiver v0.102.1 h1:353t4U3o0RdU007JcQ4sRRzl72GHCJZwXDr8cCOcEbI= +go.opentelemetry.io/collector/receiver v0.102.1/go.mod h1:pYjMzUkvUlxJ8xt+VbI1to8HMtVlv8AW/K/2GQQOTB0= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -116,20 +112,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -138,14 +134,12 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 74cb87562b53dd5c4df3628cea7fbafe56a0f293 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 10:05:27 -0700 Subject: [PATCH 07/14] more simplification --- collector/otelcol-builder.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/collector/otelcol-builder.yaml b/collector/otelcol-builder.yaml index d8b1456..5bc0dec 100644 --- a/collector/otelcol-builder.yaml +++ b/collector/otelcol-builder.yaml @@ -15,9 +15,8 @@ exporters: go.opentelemetry.io/collector/exporter/otlpexporter v0.102.1 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.102.0 - - gomod: "github.com/lightstep/sn-collector/collector/servicenowexporter v0.0.1" - name: "servicenowexporter" - path: "./components/servicenowexporter" + - gomod: + github.com/lightstep/sn-collector/collector/servicenowexporter v0.0.0 - gomod: github.com/open-telemetry/otel-arrow/collector/exporter/otelarrowexporter v0.24.0 @@ -77,3 +76,8 @@ extensions: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.102.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.102.0 + +replaces: + # This path is relative to the output_path working directory shown above, not this file's location. + - github.com/lightstep/sn-collector/collector/servicenowexporter v0.0.0 => ../components/servicenowexporter + From 7d2f476fb177a6e78c082d307436177328177684 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 10:16:52 -0700 Subject: [PATCH 08/14] update lightstepreceiver --- collector/components/lightstepreceiver/go.mod | 79 ++++----- collector/components/lightstepreceiver/go.sum | 158 +++++++++--------- 2 files changed, 116 insertions(+), 121 deletions(-) diff --git a/collector/components/lightstepreceiver/go.mod b/collector/components/lightstepreceiver/go.mod index a451ccd..98b54ba 100644 --- a/collector/components/lightstepreceiver/go.mod +++ b/collector/components/lightstepreceiver/go.mod @@ -1,27 +1,29 @@ module github.com/lightstep/sn-collector/collector/lightstepreceiver -go 1.21 +go 1.21.0 + +toolchain go1.22.2 require ( - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.98.0 - go.opentelemetry.io/collector/config/confighttp v0.98.0 - go.opentelemetry.io/collector/config/configtls v0.98.0 - go.opentelemetry.io/collector/confmap v0.98.0 - go.opentelemetry.io/collector/consumer v0.98.0 - go.opentelemetry.io/collector/pdata v1.5.0 - go.opentelemetry.io/collector/receiver v0.98.0 - go.opentelemetry.io/collector/semconv v0.98.0 - golang.org/x/net v0.24.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 - google.golang.org/grpc v1.62.1 - google.golang.org/protobuf v1.33.0 + go.opentelemetry.io/collector/component v0.102.1 + go.opentelemetry.io/collector/config/confighttp v0.102.1 + go.opentelemetry.io/collector/config/configtls v0.102.1 + go.opentelemetry.io/collector/confmap v0.102.1 + go.opentelemetry.io/collector/consumer v0.102.1 + go.opentelemetry.io/collector/pdata v1.9.0 + go.opentelemetry.io/collector/receiver v0.102.1 + go.opentelemetry.io/collector/semconv v0.102.1 + golang.org/x/net v0.25.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 + google.golang.org/grpc v1.64.0 + google.golang.org/protobuf v1.34.1 ) require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -31,7 +33,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.8 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -42,32 +44,31 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.48.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/procfs v0.15.0 // indirect github.com/rs/cors v1.10.1 // indirect - go.opentelemetry.io/collector v0.98.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.98.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.5.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.5.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.98.0 // indirect - go.opentelemetry.io/collector/config/internal v0.98.0 // indirect - go.opentelemetry.io/collector/extension v0.98.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.98.0 // indirect - go.opentelemetry.io/collector/featuregate v1.5.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/otel v1.25.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.47.0 // indirect - go.opentelemetry.io/otel/metric v1.25.0 // indirect - go.opentelemetry.io/otel/sdk v1.25.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.25.0 // indirect - go.opentelemetry.io/otel/trace v1.25.0 // indirect + go.opentelemetry.io/collector v0.102.1 // indirect + go.opentelemetry.io/collector/config/configauth v0.102.1 // indirect + go.opentelemetry.io/collector/config/configcompression v1.9.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.9.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect + go.opentelemetry.io/collector/config/internal v0.102.1 // indirect + go.opentelemetry.io/collector/extension v0.102.1 // indirect + go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect + go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/sdk v1.27.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collector/components/lightstepreceiver/go.sum b/collector/components/lightstepreceiver/go.sum index bfcc18a..e36b38e 100644 --- a/collector/components/lightstepreceiver/go.sum +++ b/collector/components/lightstepreceiver/go.sum @@ -1,7 +1,7 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -18,19 +18,17 @@ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsM github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -58,14 +56,14 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= @@ -76,56 +74,56 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector v0.98.0 h1:O7bpARGWzNfFQEYevLl4iigDrpGTJY3vV/kKqNZzMOk= -go.opentelemetry.io/collector v0.98.0/go.mod h1:fvPM+tBML07uvAP1MV2msYPSYJ9U/lgE1jDb3AFBaMM= -go.opentelemetry.io/collector/component v0.98.0 h1:0TMaBOyCdABiVLFdGOgG8zd/1IeGldCinYonbY08xWk= -go.opentelemetry.io/collector/component v0.98.0/go.mod h1:F6zyQLsoExl6r2q6WWZm8rmSSALbwG2zwIHLrMzZVio= -go.opentelemetry.io/collector/config/configauth v0.98.0 h1:FPffZ1dRL6emStrDUEGpL0rCChbUZNAQgpArXD0SESI= -go.opentelemetry.io/collector/config/configauth v0.98.0/go.mod h1:5pMzf2zgFwS7tujNq0AtOOli5vxIvnrNi7JlZwrBOFo= -go.opentelemetry.io/collector/config/configcompression v1.5.0 h1:FTxKbFPN4LznRCH/GQ+b+0tAWmg80Y2eEka79S2sLZ0= -go.opentelemetry.io/collector/config/configcompression v1.5.0/go.mod h1:O0fOPCADyGwGLLIf5lf7N3960NsnIfxsm6dr/mIpL+M= -go.opentelemetry.io/collector/config/confighttp v0.98.0 h1:pW7gR34TTXcrCHJgemL6A4VBVBS2NyDAkruSMvQj1Vo= -go.opentelemetry.io/collector/config/confighttp v0.98.0/go.mod h1:M9PMtiKrTJMG8i3SqJ+AUVKhR6sa3G/8S2F1+Dxkkr0= -go.opentelemetry.io/collector/config/configopaque v1.5.0 h1:WJzgmsFU2v63BypPBNGL31ACwWn6PwumPJNpLZplcdE= -go.opentelemetry.io/collector/config/configopaque v1.5.0/go.mod h1:/otnfj2E8r5EfaAdNV4qHkTclmiBCZXaahV5EcLwT7k= -go.opentelemetry.io/collector/config/configtelemetry v0.98.0 h1:f8RNZ1l/kYPPoxFmKKvTUli8iON7CMsm85KM38PVNts= -go.opentelemetry.io/collector/config/configtelemetry v0.98.0/go.mod h1:YV5PaOdtnU1xRomPcYqoHmyCr48tnaAREeGO96EZw8o= -go.opentelemetry.io/collector/config/configtls v0.98.0 h1:g+MADy01ge8iGC6v2tbJ5G27CWNG1BaJtmYdmpvm8e4= -go.opentelemetry.io/collector/config/configtls v0.98.0/go.mod h1:9RHArziz0mNEEkti0kz5LIdvbQGT7/Unu/0whKKazHQ= -go.opentelemetry.io/collector/config/internal v0.98.0 h1:wz/6ncawMX5cfIiXJEYSUm1g1U6iE/VxFRm4/WhVBPI= -go.opentelemetry.io/collector/config/internal v0.98.0/go.mod h1:xPnEE6QaTSXr+ctYMSTBxI2qwTntTUM4cYk7OTm6Ugc= -go.opentelemetry.io/collector/confmap v0.98.0 h1:qQreBlrqio1y7uhrAvr+W86YbQ6fw7StgkbYpvJ2vVc= -go.opentelemetry.io/collector/confmap v0.98.0/go.mod h1:BWKPIpYeUzSG6ZgCJMjF7xsLvyrvJCfYURl57E5vhiQ= -go.opentelemetry.io/collector/consumer v0.98.0 h1:47zJ5HFKXVA0RciuwkZnPU5W8j0TYUxToB1/zzzgEhs= -go.opentelemetry.io/collector/consumer v0.98.0/go.mod h1:c2edTq38uVJET/NE6VV7/Qpyznnlz8b6VE7J6TXD57c= -go.opentelemetry.io/collector/extension v0.98.0 h1:08B5ipEsoNmPHY96j5EUsUrFre01GOZ4zgttUDtPUkY= -go.opentelemetry.io/collector/extension v0.98.0/go.mod h1:fZ1Hnnahszl5j3xcW2sMRJ0FLWDOFkFMQeVDP0Se7i8= -go.opentelemetry.io/collector/extension/auth v0.98.0 h1:7b1jioijJbTMqaOCrz5Hoqf+zJn2iPlGmtN7pXLNWbA= -go.opentelemetry.io/collector/extension/auth v0.98.0/go.mod h1:gssWC4AxAwAEKI2CqS93lhjWffsVdzD8q7UGL6LaRr0= -go.opentelemetry.io/collector/featuregate v1.5.0 h1:uK8qnYQKz1TMkK+FDTFsywg/EybW/gbnOUaPNUkRznM= -go.opentelemetry.io/collector/featuregate v1.5.0/go.mod h1:w7nUODKxEi3FLf1HslCiE6YWtMtOOrMnSwsDam8Mg9w= -go.opentelemetry.io/collector/pdata v1.5.0 h1:1fKTmUpr0xCOhP/B0VEvtz7bYPQ45luQ8XFyA07j8LE= -go.opentelemetry.io/collector/pdata v1.5.0/go.mod h1:TYj8aKRWZyT/KuKQXKyqSEvK/GV+slFaDMEI+Ke64Yw= -go.opentelemetry.io/collector/pdata/testdata v0.98.0 h1:8gohV+LFXqMzuDwfOOQy9GcZBOX0C9xGoQkoeXFTzmI= -go.opentelemetry.io/collector/pdata/testdata v0.98.0/go.mod h1:B/IaHcf6+RtxI292CZu9TjfYQdi1n4+v6b8rHEonpKs= -go.opentelemetry.io/collector/receiver v0.98.0 h1:qw6JYwm+sHcZvM1DByo3QlGe6yGHuwd0yW4hEPVqYKU= -go.opentelemetry.io/collector/receiver v0.98.0/go.mod h1:AwIWn+KnquTR+kbhXQrMH+i2PvTCFldSIJznBWFYs0s= -go.opentelemetry.io/collector/semconv v0.98.0 h1:zO4L4TmlxXoYu8UgPeYElGY19BW7wPjM+quL5CzoOoY= -go.opentelemetry.io/collector/semconv v0.98.0/go.mod h1:8ElcRZ8Cdw5JnvhTOQOdYizkJaQ10Z2fS+R6djOnj6A= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k= -go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg= -go.opentelemetry.io/otel/exporters/prometheus v0.47.0 h1:OL6yk1Z/pEGdDnrBbxSsH+t4FY1zXfBRGd7bjwhlMLU= -go.opentelemetry.io/otel/exporters/prometheus v0.47.0/go.mod h1:xF3N4OSICZDVbbYZydz9MHFro1RjmkPUKEvar2utG+Q= -go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA= -go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s= -go.opentelemetry.io/otel/sdk v1.25.0 h1:PDryEJPC8YJZQSyLY5eqLeafHtG+X7FWnf3aXMtxbqo= -go.opentelemetry.io/otel/sdk v1.25.0/go.mod h1:oFgzCM2zdsxKzz6zwpTZYLLQsFwc+K0daArPdIhuxkw= -go.opentelemetry.io/otel/sdk/metric v1.25.0 h1:7CiHOy08LbrxMAp4vWpbiPcklunUshVpAvGBrdDRlGw= -go.opentelemetry.io/otel/sdk/metric v1.25.0/go.mod h1:LzwoKptdbBBdYfvtGCzGwk6GWMA3aUzBOwtQpR6Nz7o= -go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM= -go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I= +go.opentelemetry.io/collector v0.102.1 h1:M/ciCcReQsSDYG9bJ2Qwqk7pQILDJ2bM/l0MdeCAvJE= +go.opentelemetry.io/collector v0.102.1/go.mod h1:yF1lDRgL/Eksb4/LUnkMjvLvHHpi6wqBVlzp+dACnPM= +go.opentelemetry.io/collector/component v0.102.1 h1:66z+LN5dVCXhvuVKD1b56/3cYLK+mtYSLIwlskYA9IQ= +go.opentelemetry.io/collector/component v0.102.1/go.mod h1:XfkiSeImKYaewT2DavA80l0VZ3JjvGndZ8ayPXfp8d0= +go.opentelemetry.io/collector/config/configauth v0.102.1 h1:LuzijaZulMu4xmAUG8WA00ZKDlampH+ERjxclb40Q9g= +go.opentelemetry.io/collector/config/configauth v0.102.1/go.mod h1:kTzfI5fnbMJpm2wycVtQeWxFAtb7ns4HksSb66NIhX8= +go.opentelemetry.io/collector/config/configcompression v1.9.0 h1:B2q6XMO6xiF2s+14XjqAQHGY5UefR+PtkZ0WAlmSqpU= +go.opentelemetry.io/collector/config/configcompression v1.9.0/go.mod h1:6+m0GKCv7JKzaumn7u80A2dLNCuYf5wdR87HWreoBO0= +go.opentelemetry.io/collector/config/confighttp v0.102.1 h1:tPw1Xf2PfDdrXoBKLY5Sd4Dh8FNm5i+6DKuky9XraIM= +go.opentelemetry.io/collector/config/confighttp v0.102.1/go.mod h1:k4qscfjxuaDQmcAzioxmPujui9VSgW6oal3WLxp9CzI= +go.opentelemetry.io/collector/config/configopaque v1.9.0 h1:jocenLdK/rVG9UoGlnpiBxXLXgH5NhIXCrVSTyKVYuA= +go.opentelemetry.io/collector/config/configopaque v1.9.0/go.mod h1:8v1yaH4iYjcigbbyEaP/tzVXeFm4AaAsKBF9SBeqaG4= +go.opentelemetry.io/collector/config/configtelemetry v0.102.1 h1:f/CYcrOkaHd+COIJ2lWnEgBCHfhEycpbow4ZhrGwAlA= +go.opentelemetry.io/collector/config/configtelemetry v0.102.1/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/config/configtls v0.102.1 h1:7fr+PU9BRg0HRc1Pn3WmDW/4WBHRjuo7o1CdG2vQKoA= +go.opentelemetry.io/collector/config/configtls v0.102.1/go.mod h1:KHdrvo3cwosgDxclyiLWmtbovIwqvaIGeTXr3p5721A= +go.opentelemetry.io/collector/config/internal v0.102.1 h1:HFsFD3xpHUuNHb8/UTz5crJw1cMHzsJQf/86sgD44hw= +go.opentelemetry.io/collector/config/internal v0.102.1/go.mod h1:Vig3dfeJJnuRe1kBNpszBzPoj5eYnR51wXbeq36Zfpg= +go.opentelemetry.io/collector/confmap v0.102.1 h1:wZuH+d/P11Suz8wbp+xQCJ0BPE9m5pybtUe74c+rU7E= +go.opentelemetry.io/collector/confmap v0.102.1/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= +go.opentelemetry.io/collector/consumer v0.102.1 h1:0CkgHhxwx4lI/m+hWjh607xyjooW5CObZ8hFQy5vvo0= +go.opentelemetry.io/collector/consumer v0.102.1/go.mod h1:HoXqmrRV13jLnP3/Gg3fYNdRkDPoO7UW58hKiLyFF60= +go.opentelemetry.io/collector/extension v0.102.1 h1:gAvE3w15q+Vv0Tj100jzcDpeMTyc8dAiemHRtJbspLg= +go.opentelemetry.io/collector/extension v0.102.1/go.mod h1:XBxUOXjZpwYLZYOK5u3GWlbBTOKmzStY5eU1R/aXkIo= +go.opentelemetry.io/collector/extension/auth v0.102.1 h1:GP6oBmpFJjxuVruPb9X40bdf6PNu9779i8anxa+wW6U= +go.opentelemetry.io/collector/extension/auth v0.102.1/go.mod h1:U2JWz8AW1QXX2Ap3ofzo5Dn2fZU/Lglld97Vbh8BZS0= +go.opentelemetry.io/collector/featuregate v1.9.0 h1:mC4/HnR5cx/kkG1RKOQAvHxxg5Ktmd9gpFdttPEXQtA= +go.opentelemetry.io/collector/featuregate v1.9.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= +go.opentelemetry.io/collector/pdata v1.9.0 h1:qyXe3HEVYYxerIYu0rzgo1Tx2d1Zs6iF+TCckbHLFOw= +go.opentelemetry.io/collector/pdata v1.9.0/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w= +go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= +go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= +go.opentelemetry.io/collector/receiver v0.102.1 h1:353t4U3o0RdU007JcQ4sRRzl72GHCJZwXDr8cCOcEbI= +go.opentelemetry.io/collector/receiver v0.102.1/go.mod h1:pYjMzUkvUlxJ8xt+VbI1to8HMtVlv8AW/K/2GQQOTB0= +go.opentelemetry.io/collector/semconv v0.102.1 h1:zLhz2Gu//j7HHESFTGTrfKIaoS4r+lZFQDnGCOThggo= +go.opentelemetry.io/collector/semconv v0.102.1/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -141,20 +139,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -163,18 +161,14 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 4f5e711f7a0f157722ed901df1801770b05dada9 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 10:19:30 -0700 Subject: [PATCH 09/14] update lightstepreceiver for 0.102.1 --- collector/components/lightstepreceiver/trace_receiver.go | 6 +++--- collector/otelcol-builder.yaml | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/collector/components/lightstepreceiver/trace_receiver.go b/collector/components/lightstepreceiver/trace_receiver.go index 06dadaf..8621204 100644 --- a/collector/components/lightstepreceiver/trace_receiver.go +++ b/collector/components/lightstepreceiver/trace_receiver.go @@ -53,19 +53,19 @@ func newReceiver(config *Config, consumer consumer.Traces, settings receiver.Cre } // Start spins up the receiver's HTTP server and makes the receiver start its processing. -func (lr *lightstepReceiver) Start(_ context.Context, host component.Host) error { +func (lr *lightstepReceiver) Start(ctx context.Context, host component.Host) error { if host == nil { return errors.New("nil host") } var err error - lr.server, err = lr.config.HTTP.ToServer(host, lr.settings.TelemetrySettings, lr) + lr.server, err = lr.config.HTTP.ToServer(ctx, host, lr.settings.TelemetrySettings, lr) if err != nil { return err } var listener net.Listener - listener, err = lr.config.HTTP.ToListener() + listener, err = lr.config.HTTP.ToListener(ctx) if err != nil { return err } diff --git a/collector/otelcol-builder.yaml b/collector/otelcol-builder.yaml index 5bc0dec..97402e7 100644 --- a/collector/otelcol-builder.yaml +++ b/collector/otelcol-builder.yaml @@ -64,6 +64,8 @@ receivers: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.102.0 - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.102.1 + - gomod: + github.com/lightstep/sn-collector/collector/lightstepreceiver v0.0.0 - gomod: github.com/open-telemetry/otel-arrow/collector/receiver/otelarrowreceiver v0.24.0 @@ -78,6 +80,7 @@ extensions: github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.102.0 replaces: - # This path is relative to the output_path working directory shown above, not this file's location. + # These paths are relative to the output_path working directory shown above, not this file's location. - github.com/lightstep/sn-collector/collector/servicenowexporter v0.0.0 => ../components/servicenowexporter + - github.com/lightstep/sn-collector/collector/lightstepreceiver v0.0.0 => ../components/lightstepreceiver From 4e67e7cbf9909eece625bbc889779b05c4bb47e4 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 11:09:01 -0700 Subject: [PATCH 10/14] generate proto; eliminate very-old protobuf dep; re-run mdatagen (edit metadata.yaml) and fix some tests --- .../components/lightstepreceiver/factory.go | 2 +- .../generated_component_test.go | 69 + .../generated_package_test.go | 12 + collector/components/lightstepreceiver/go.mod | 4 +- collector/components/lightstepreceiver/go.sum | 2 - .../internal/collectorpb/collector.pb.go | 1682 +++++++++++------ .../internal/collectorpb/collector_grpc.pb.go | 109 ++ .../internal/metadata/generated_status.go | 5 +- .../lightstepreceiver/metadata.yaml | 6 + .../lightstepreceiver/proto/collector.proto | 116 ++ .../lightstepreceiver/proto/generate.sh | 12 + .../proto/google/api/annotations.proto | 31 + .../proto/google/api/http.proto | 318 ++++ .../proto/google/api/httpbody.proto | 78 + .../proto/google/protobuf/any.proto | 162 ++ .../proto/google/protobuf/api.proto | 207 ++ .../google/protobuf/compiler/plugin.proto | 168 ++ .../proto/google/protobuf/descriptor.proto | 1218 ++++++++++++ .../proto/google/protobuf/duration.proto | 115 ++ .../proto/google/protobuf/empty.proto | 51 + .../proto/google/protobuf/field_mask.proto | 245 +++ .../google/protobuf/source_context.proto | 48 + .../proto/google/protobuf/struct.proto | 95 + .../proto/google/protobuf/timestamp.proto | 144 ++ .../proto/google/protobuf/type.proto | 193 ++ .../proto/google/protobuf/wrappers.proto | 123 ++ .../lightstepreceiver/to_traces_test.go | 2 +- .../lightstepreceiver/trace_receiver.go | 11 +- .../lightstepreceiver/trace_receiver_test.go | 7 +- 29 files changed, 4633 insertions(+), 602 deletions(-) create mode 100644 collector/components/lightstepreceiver/generated_component_test.go create mode 100644 collector/components/lightstepreceiver/generated_package_test.go create mode 100644 collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go create mode 100644 collector/components/lightstepreceiver/proto/collector.proto create mode 100755 collector/components/lightstepreceiver/proto/generate.sh create mode 100644 collector/components/lightstepreceiver/proto/google/api/annotations.proto create mode 100644 collector/components/lightstepreceiver/proto/google/api/http.proto create mode 100644 collector/components/lightstepreceiver/proto/google/api/httpbody.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/any.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/api.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/compiler/plugin.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/descriptor.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/duration.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/empty.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/field_mask.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/source_context.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/struct.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/timestamp.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/type.proto create mode 100644 collector/components/lightstepreceiver/proto/google/protobuf/wrappers.proto diff --git a/collector/components/lightstepreceiver/factory.go b/collector/components/lightstepreceiver/factory.go index 5dc4d85..91577ed 100644 --- a/collector/components/lightstepreceiver/factory.go +++ b/collector/components/lightstepreceiver/factory.go @@ -24,7 +24,7 @@ const ( // NewFactory creates a new Lightstep receiver factory func NewFactory() receiver.Factory { return receiver.NewFactory( - component.MustNewType(metadata.Type), + metadata.Type, createDefaultConfig, receiver.WithTraces(createTracesReceiver, metadata.TracesStability), ) diff --git a/collector/components/lightstepreceiver/generated_component_test.go b/collector/components/lightstepreceiver/generated_component_test.go new file mode 100644 index 0000000..17b5320 --- /dev/null +++ b/collector/components/lightstepreceiver/generated_component_test.go @@ -0,0 +1,69 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package lightstepreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" +) + +func TestComponentFactoryType(t *testing.T) { + require.Equal(t, "lightstep", NewFactory().Type().String()) +} + +func TestComponentConfigStruct(t *testing.T) { + require.NoError(t, componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig())) +} + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/collector/components/lightstepreceiver/generated_package_test.go b/collector/components/lightstepreceiver/generated_package_test.go new file mode 100644 index 0000000..4589216 --- /dev/null +++ b/collector/components/lightstepreceiver/generated_package_test.go @@ -0,0 +1,12 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package lightstepreceiver + +import ( + "go.uber.org/goleak" + "testing" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/collector/components/lightstepreceiver/go.mod b/collector/components/lightstepreceiver/go.mod index 98b54ba..b8285b2 100644 --- a/collector/components/lightstepreceiver/go.mod +++ b/collector/components/lightstepreceiver/go.mod @@ -5,7 +5,6 @@ go 1.21.0 toolchain go1.22.2 require ( - github.com/golang/protobuf v1.5.4 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.1 go.opentelemetry.io/collector/config/confighttp v0.102.1 @@ -15,7 +14,7 @@ require ( go.opentelemetry.io/collector/pdata v1.9.0 go.opentelemetry.io/collector/receiver v0.102.1 go.opentelemetry.io/collector/semconv v0.102.1 - golang.org/x/net v0.25.0 + go.uber.org/goleak v1.3.0 google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.1 @@ -67,6 +66,7 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect diff --git a/collector/components/lightstepreceiver/go.sum b/collector/components/lightstepreceiver/go.sum index e36b38e..cbd1b15 100644 --- a/collector/components/lightstepreceiver/go.sum +++ b/collector/components/lightstepreceiver/go.sum @@ -18,8 +18,6 @@ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsM github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= diff --git a/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go index 5dd8307..a836f67 100644 --- a/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go +++ b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go @@ -1,51 +1,26 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: lightstep/collector/collector.proto - -/* -Package collectorpb is a generated protocol buffer package. - -It is generated from these files: - - lightstep/collector/collector.proto - -It has these top-level messages: - - SpanContext - KeyValue - Log - Reference - Span - Reporter - MetricsSample - InternalMetrics - Auth - ReportRequest - Command - ReportResponse -*/ -package collectorpb +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: collector.proto -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/timestamp" -import _ "google.golang.org/genproto/googleapis/api/annotations" +package collectorpb import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +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 Reference_Relationship int32 @@ -54,56 +29,117 @@ const ( Reference_FOLLOWS_FROM Reference_Relationship = 1 ) -var Reference_Relationship_name = map[int32]string{ - 0: "CHILD_OF", - 1: "FOLLOWS_FROM", -} -var Reference_Relationship_value = map[string]int32{ - "CHILD_OF": 0, - "FOLLOWS_FROM": 1, +// Enum value maps for Reference_Relationship. +var ( + Reference_Relationship_name = map[int32]string{ + 0: "CHILD_OF", + 1: "FOLLOWS_FROM", + } + Reference_Relationship_value = map[string]int32{ + "CHILD_OF": 0, + "FOLLOWS_FROM": 1, + } +) + +func (x Reference_Relationship) Enum() *Reference_Relationship { + p := new(Reference_Relationship) + *p = x + return p } func (x Reference_Relationship) String() string { - return proto.EnumName(Reference_Relationship_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Reference_Relationship) Descriptor() protoreflect.EnumDescriptor { + return file_collector_proto_enumTypes[0].Descriptor() +} + +func (Reference_Relationship) Type() protoreflect.EnumType { + return &file_collector_proto_enumTypes[0] +} + +func (x Reference_Relationship) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Reference_Relationship.Descriptor instead. +func (Reference_Relationship) EnumDescriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{3, 0} } -func (Reference_Relationship) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 0} } type SpanContext struct { - TraceId uint64 `protobuf:"varint,1,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` - SpanId uint64 `protobuf:"varint,2,opt,name=span_id,json=spanId" json:"span_id,omitempty"` - Baggage map[string]string `protobuf:"bytes,3,rep,name=baggage" json:"baggage,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TraceId uint64 `protobuf:"varint,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + SpanId uint64 `protobuf:"varint,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + Baggage map[string]string `protobuf:"bytes,3,rep,name=baggage,proto3" json:"baggage,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *SpanContext) Reset() { *m = SpanContext{} } -func (m *SpanContext) String() string { return proto.CompactTextString(m) } -func (*SpanContext) ProtoMessage() {} -func (*SpanContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (x *SpanContext) Reset() { + *x = SpanContext{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *SpanContext) GetTraceId() uint64 { - if m != nil { - return m.TraceId +func (x *SpanContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SpanContext) ProtoMessage() {} + +func (x *SpanContext) ProtoReflect() protoreflect.Message { + mi := &file_collector_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 SpanContext.ProtoReflect.Descriptor instead. +func (*SpanContext) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{0} +} + +func (x *SpanContext) GetTraceId() uint64 { + if x != nil { + return x.TraceId } return 0 } -func (m *SpanContext) GetSpanId() uint64 { - if m != nil { - return m.SpanId +func (x *SpanContext) GetSpanId() uint64 { + if x != nil { + return x.SpanId } return 0 } -func (m *SpanContext) GetBaggage() map[string]string { - if m != nil { - return m.Baggage +func (x *SpanContext) GetBaggage() map[string]string { + if x != nil { + return x.Baggage } return nil } // Represent both tags and log fields. type KeyValue struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - // Types that are valid to be assigned to Value: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Types that are assignable to Value: + // // *KeyValue_StringValue // *KeyValue_IntValue // *KeyValue_DoubleValue @@ -112,36 +148,44 @@ type KeyValue struct { Value isKeyValue_Value `protobuf_oneof:"value"` } -func (m *KeyValue) Reset() { *m = KeyValue{} } -func (m *KeyValue) String() string { return proto.CompactTextString(m) } -func (*KeyValue) ProtoMessage() {} -func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -type isKeyValue_Value interface { - isKeyValue_Value() +func (x *KeyValue) Reset() { + *x = KeyValue{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -type KeyValue_StringValue struct { - StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,oneof"` -} -type KeyValue_IntValue struct { - IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,oneof"` +func (x *KeyValue) String() string { + return protoimpl.X.MessageStringOf(x) } -type KeyValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,oneof"` -} -type KeyValue_BoolValue struct { - BoolValue bool `protobuf:"varint,5,opt,name=bool_value,json=boolValue,oneof"` + +func (*KeyValue) ProtoMessage() {} + +func (x *KeyValue) ProtoReflect() protoreflect.Message { + mi := &file_collector_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) } -type KeyValue_JsonValue struct { - JsonValue string `protobuf:"bytes,6,opt,name=json_value,json=jsonValue,oneof"` + +// Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. +func (*KeyValue) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{1} } -func (*KeyValue_StringValue) isKeyValue_Value() {} -func (*KeyValue_IntValue) isKeyValue_Value() {} -func (*KeyValue_DoubleValue) isKeyValue_Value() {} -func (*KeyValue_BoolValue) isKeyValue_Value() {} -func (*KeyValue_JsonValue) isKeyValue_Value() {} +func (x *KeyValue) GetKey() string { + if x != nil { + return x.Key + } + return "" +} func (m *KeyValue) GetValue() isKeyValue_Value { if m != nil { @@ -150,322 +194,390 @@ func (m *KeyValue) GetValue() isKeyValue_Value { return nil } -func (m *KeyValue) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KeyValue) GetStringValue() string { - if x, ok := m.GetValue().(*KeyValue_StringValue); ok { +func (x *KeyValue) GetStringValue() string { + if x, ok := x.GetValue().(*KeyValue_StringValue); ok { return x.StringValue } return "" } -func (m *KeyValue) GetIntValue() int64 { - if x, ok := m.GetValue().(*KeyValue_IntValue); ok { +func (x *KeyValue) GetIntValue() int64 { + if x, ok := x.GetValue().(*KeyValue_IntValue); ok { return x.IntValue } return 0 } -func (m *KeyValue) GetDoubleValue() float64 { - if x, ok := m.GetValue().(*KeyValue_DoubleValue); ok { +func (x *KeyValue) GetDoubleValue() float64 { + if x, ok := x.GetValue().(*KeyValue_DoubleValue); ok { return x.DoubleValue } return 0 } -func (m *KeyValue) GetBoolValue() bool { - if x, ok := m.GetValue().(*KeyValue_BoolValue); ok { +func (x *KeyValue) GetBoolValue() bool { + if x, ok := x.GetValue().(*KeyValue_BoolValue); ok { return x.BoolValue } return false } -func (m *KeyValue) GetJsonValue() string { - if x, ok := m.GetValue().(*KeyValue_JsonValue); ok { +func (x *KeyValue) GetJsonValue() string { + if x, ok := x.GetValue().(*KeyValue_JsonValue); ok { return x.JsonValue } return "" } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*KeyValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _KeyValue_OneofMarshaler, _KeyValue_OneofUnmarshaler, _KeyValue_OneofSizer, []interface{}{ - (*KeyValue_StringValue)(nil), - (*KeyValue_IntValue)(nil), - (*KeyValue_DoubleValue)(nil), - (*KeyValue_BoolValue)(nil), - (*KeyValue_JsonValue)(nil), - } +type isKeyValue_Value interface { + isKeyValue_Value() } -func _KeyValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*KeyValue) - // value - switch x := m.Value.(type) { - case *KeyValue_StringValue: - b.EncodeVarint(2<<3 | proto.WireBytes) - b.EncodeStringBytes(x.StringValue) - case *KeyValue_IntValue: - b.EncodeVarint(3<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.IntValue)) - case *KeyValue_DoubleValue: - b.EncodeVarint(4<<3 | proto.WireFixed64) - b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *KeyValue_BoolValue: - t := uint64(0) - if x.BoolValue { - t = 1 - } - b.EncodeVarint(5<<3 | proto.WireVarint) - b.EncodeVarint(t) - case *KeyValue_JsonValue: - b.EncodeVarint(6<<3 | proto.WireBytes) - b.EncodeStringBytes(x.JsonValue) - case nil: - default: - return fmt.Errorf("KeyValue.Value has unexpected type %T", x) - } - return nil +type KeyValue_StringValue struct { + // Holds arbitrary string data; well-formed JSON strings should go in + // json_value. + StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof"` } -func _KeyValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*KeyValue) - switch tag { - case 2: // value.string_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Value = &KeyValue_StringValue{x} - return true, err - case 3: // value.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Value = &KeyValue_IntValue{int64(x)} - return true, err - case 4: // value.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Value = &KeyValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 5: // value.bool_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Value = &KeyValue_BoolValue{x != 0} - return true, err - case 6: // value.json_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Value = &KeyValue_JsonValue{x} - return true, err - default: - return false, nil - } -} - -func _KeyValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*KeyValue) - // value - switch x := m.Value.(type) { - case *KeyValue_StringValue: - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(len(x.StringValue))) - n += len(x.StringValue) - case *KeyValue_IntValue: - n += proto.SizeVarint(3<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.IntValue)) - case *KeyValue_DoubleValue: - n += proto.SizeVarint(4<<3 | proto.WireFixed64) - n += 8 - case *KeyValue_BoolValue: - n += proto.SizeVarint(5<<3 | proto.WireVarint) - n += 1 - case *KeyValue_JsonValue: - n += proto.SizeVarint(6<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(len(x.JsonValue))) - n += len(x.JsonValue) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n +type KeyValue_IntValue struct { + IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` +} + +type KeyValue_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,proto3,oneof"` } +type KeyValue_BoolValue struct { + BoolValue bool `protobuf:"varint,5,opt,name=bool_value,json=boolValue,proto3,oneof"` +} + +type KeyValue_JsonValue struct { + // Must be a well-formed JSON value. Truncated JSON should go in + // string_value. Should not be used for tags. + JsonValue string `protobuf:"bytes,6,opt,name=json_value,json=jsonValue,proto3,oneof"` +} + +func (*KeyValue_StringValue) isKeyValue_Value() {} + +func (*KeyValue_IntValue) isKeyValue_Value() {} + +func (*KeyValue_DoubleValue) isKeyValue_Value() {} + +func (*KeyValue_BoolValue) isKeyValue_Value() {} + +func (*KeyValue_JsonValue) isKeyValue_Value() {} + type Log struct { - Timestamp *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp,omitempty"` - Fields []*KeyValue `protobuf:"bytes,2,rep,name=fields" json:"fields,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Fields []*KeyValue `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` } -func (m *Log) Reset() { *m = Log{} } -func (m *Log) String() string { return proto.CompactTextString(m) } -func (*Log) ProtoMessage() {} -func (*Log) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (x *Log) Reset() { + *x = Log{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *Log) GetTimestamp() *google_protobuf.Timestamp { - if m != nil { - return m.Timestamp +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +func (x *Log) ProtoReflect() protoreflect.Message { + mi := &file_collector_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 Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{2} +} + +func (x *Log) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp } return nil } -func (m *Log) GetFields() []*KeyValue { - if m != nil { - return m.Fields +func (x *Log) GetFields() []*KeyValue { + if x != nil { + return x.Fields } return nil } type Reference struct { - Relationship Reference_Relationship `protobuf:"varint,1,opt,name=relationship,enum=lightstep.collector.Reference_Relationship" json:"relationship,omitempty"` - SpanContext *SpanContext `protobuf:"bytes,2,opt,name=span_context,json=spanContext" json:"span_context,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Relationship Reference_Relationship `protobuf:"varint,1,opt,name=relationship,proto3,enum=lightstep.collector.Reference_Relationship" json:"relationship,omitempty"` + SpanContext *SpanContext `protobuf:"bytes,2,opt,name=span_context,json=spanContext,proto3" json:"span_context,omitempty"` } -func (m *Reference) Reset() { *m = Reference{} } -func (m *Reference) String() string { return proto.CompactTextString(m) } -func (*Reference) ProtoMessage() {} -func (*Reference) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (x *Reference) Reset() { + *x = Reference{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *Reference) GetRelationship() Reference_Relationship { - if m != nil { - return m.Relationship +func (x *Reference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reference) ProtoMessage() {} + +func (x *Reference) ProtoReflect() protoreflect.Message { + mi := &file_collector_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 Reference.ProtoReflect.Descriptor instead. +func (*Reference) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{3} +} + +func (x *Reference) GetRelationship() Reference_Relationship { + if x != nil { + return x.Relationship } return Reference_CHILD_OF } -func (m *Reference) GetSpanContext() *SpanContext { - if m != nil { - return m.SpanContext +func (x *Reference) GetSpanContext() *SpanContext { + if x != nil { + return x.SpanContext } return nil } type Span struct { - SpanContext *SpanContext `protobuf:"bytes,1,opt,name=span_context,json=spanContext" json:"span_context,omitempty"` - OperationName string `protobuf:"bytes,2,opt,name=operation_name,json=operationName" json:"operation_name,omitempty"` - References []*Reference `protobuf:"bytes,3,rep,name=references" json:"references,omitempty"` - StartTimestamp *google_protobuf.Timestamp `protobuf:"bytes,4,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"` - DurationMicros uint64 `protobuf:"varint,5,opt,name=duration_micros,json=durationMicros" json:"duration_micros,omitempty"` - Tags []*KeyValue `protobuf:"bytes,6,rep,name=tags" json:"tags,omitempty"` - Logs []*Log `protobuf:"bytes,7,rep,name=logs" json:"logs,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SpanContext *SpanContext `protobuf:"bytes,1,opt,name=span_context,json=spanContext,proto3" json:"span_context,omitempty"` + OperationName string `protobuf:"bytes,2,opt,name=operation_name,json=operationName,proto3" json:"operation_name,omitempty"` + References []*Reference `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty"` + StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"` + DurationMicros uint64 `protobuf:"varint,5,opt,name=duration_micros,json=durationMicros,proto3" json:"duration_micros,omitempty"` + Tags []*KeyValue `protobuf:"bytes,6,rep,name=tags,proto3" json:"tags,omitempty"` + Logs []*Log `protobuf:"bytes,7,rep,name=logs,proto3" json:"logs,omitempty"` +} + +func (x *Span) Reset() { + *x = Span{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Span) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Span) Reset() { *m = Span{} } -func (m *Span) String() string { return proto.CompactTextString(m) } -func (*Span) ProtoMessage() {} -func (*Span) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (*Span) ProtoMessage() {} -func (m *Span) GetSpanContext() *SpanContext { - if m != nil { - return m.SpanContext +func (x *Span) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[4] + 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 Span.ProtoReflect.Descriptor instead. +func (*Span) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{4} +} + +func (x *Span) GetSpanContext() *SpanContext { + if x != nil { + return x.SpanContext } return nil } -func (m *Span) GetOperationName() string { - if m != nil { - return m.OperationName +func (x *Span) GetOperationName() string { + if x != nil { + return x.OperationName } return "" } -func (m *Span) GetReferences() []*Reference { - if m != nil { - return m.References +func (x *Span) GetReferences() []*Reference { + if x != nil { + return x.References } return nil } -func (m *Span) GetStartTimestamp() *google_protobuf.Timestamp { - if m != nil { - return m.StartTimestamp +func (x *Span) GetStartTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.StartTimestamp } return nil } -func (m *Span) GetDurationMicros() uint64 { - if m != nil { - return m.DurationMicros +func (x *Span) GetDurationMicros() uint64 { + if x != nil { + return x.DurationMicros } return 0 } -func (m *Span) GetTags() []*KeyValue { - if m != nil { - return m.Tags +func (x *Span) GetTags() []*KeyValue { + if x != nil { + return x.Tags } return nil } -func (m *Span) GetLogs() []*Log { - if m != nil { - return m.Logs +func (x *Span) GetLogs() []*Log { + if x != nil { + return x.Logs } return nil } type Reporter struct { - ReporterId uint64 `protobuf:"varint,1,opt,name=reporter_id,json=reporterId" json:"reporter_id,omitempty"` - Tags []*KeyValue `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReporterId uint64 `protobuf:"varint,1,opt,name=reporter_id,json=reporterId,proto3" json:"reporter_id,omitempty"` + Tags []*KeyValue `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"` } -func (m *Reporter) Reset() { *m = Reporter{} } -func (m *Reporter) String() string { return proto.CompactTextString(m) } -func (*Reporter) ProtoMessage() {} -func (*Reporter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (x *Reporter) Reset() { + *x = Reporter{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *Reporter) GetReporterId() uint64 { - if m != nil { - return m.ReporterId +func (x *Reporter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reporter) ProtoMessage() {} + +func (x *Reporter) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[5] + 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 Reporter.ProtoReflect.Descriptor instead. +func (*Reporter) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{5} +} + +func (x *Reporter) GetReporterId() uint64 { + if x != nil { + return x.ReporterId } return 0 } -func (m *Reporter) GetTags() []*KeyValue { - if m != nil { - return m.Tags +func (x *Reporter) GetTags() []*KeyValue { + if x != nil { + return x.Tags } return nil } type MetricsSample struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Types that are valid to be assigned to Value: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Types that are assignable to Value: + // // *MetricsSample_IntValue // *MetricsSample_DoubleValue Value isMetricsSample_Value `protobuf_oneof:"value"` } -func (m *MetricsSample) Reset() { *m = MetricsSample{} } -func (m *MetricsSample) String() string { return proto.CompactTextString(m) } -func (*MetricsSample) ProtoMessage() {} -func (*MetricsSample) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (x *MetricsSample) Reset() { + *x = MetricsSample{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -type isMetricsSample_Value interface { - isMetricsSample_Value() +func (x *MetricsSample) String() string { + return protoimpl.X.MessageStringOf(x) } -type MetricsSample_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,oneof"` +func (*MetricsSample) ProtoMessage() {} + +func (x *MetricsSample) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[6] + 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) } -type MetricsSample_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"` + +// Deprecated: Use MetricsSample.ProtoReflect.Descriptor instead. +func (*MetricsSample) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{6} } -func (*MetricsSample_IntValue) isMetricsSample_Value() {} -func (*MetricsSample_DoubleValue) isMetricsSample_Value() {} +func (x *MetricsSample) GetName() string { + if x != nil { + return x.Name + } + return "" +} func (m *MetricsSample) GetValue() isMetricsSample_Value { if m != nil { @@ -474,414 +586,804 @@ func (m *MetricsSample) GetValue() isMetricsSample_Value { return nil } -func (m *MetricsSample) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MetricsSample) GetIntValue() int64 { - if x, ok := m.GetValue().(*MetricsSample_IntValue); ok { +func (x *MetricsSample) GetIntValue() int64 { + if x, ok := x.GetValue().(*MetricsSample_IntValue); ok { return x.IntValue } return 0 } -func (m *MetricsSample) GetDoubleValue() float64 { - if x, ok := m.GetValue().(*MetricsSample_DoubleValue); ok { +func (x *MetricsSample) GetDoubleValue() float64 { + if x, ok := x.GetValue().(*MetricsSample_DoubleValue); ok { return x.DoubleValue } return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*MetricsSample) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _MetricsSample_OneofMarshaler, _MetricsSample_OneofUnmarshaler, _MetricsSample_OneofSizer, []interface{}{ - (*MetricsSample_IntValue)(nil), - (*MetricsSample_DoubleValue)(nil), - } +type isMetricsSample_Value interface { + isMetricsSample_Value() } -func _MetricsSample_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*MetricsSample) - // value - switch x := m.Value.(type) { - case *MetricsSample_IntValue: - b.EncodeVarint(2<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.IntValue)) - case *MetricsSample_DoubleValue: - b.EncodeVarint(3<<3 | proto.WireFixed64) - b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case nil: - default: - return fmt.Errorf("MetricsSample.Value has unexpected type %T", x) - } - return nil +type MetricsSample_IntValue struct { + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` } -func _MetricsSample_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*MetricsSample) - switch tag { - case 2: // value.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Value = &MetricsSample_IntValue{int64(x)} - return true, err - case 3: // value.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Value = &MetricsSample_DoubleValue{math.Float64frombits(x)} - return true, err - default: - return false, nil - } +type MetricsSample_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,proto3,oneof"` } -func _MetricsSample_OneofSizer(msg proto.Message) (n int) { - m := msg.(*MetricsSample) - // value - switch x := m.Value.(type) { - case *MetricsSample_IntValue: - n += proto.SizeVarint(2<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.IntValue)) - case *MetricsSample_DoubleValue: - n += proto.SizeVarint(3<<3 | proto.WireFixed64) - n += 8 - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) +func (*MetricsSample_IntValue) isMetricsSample_Value() {} + +func (*MetricsSample_DoubleValue) isMetricsSample_Value() {} + +type InternalMetrics struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"` + DurationMicros uint64 `protobuf:"varint,2,opt,name=duration_micros,json=durationMicros,proto3" json:"duration_micros,omitempty"` + Logs []*Log `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` + Counts []*MetricsSample `protobuf:"bytes,4,rep,name=counts,proto3" json:"counts,omitempty"` + Gauges []*MetricsSample `protobuf:"bytes,5,rep,name=gauges,proto3" json:"gauges,omitempty"` +} + +func (x *InternalMetrics) Reset() { + *x = InternalMetrics{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return n } -type InternalMetrics struct { - StartTimestamp *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"` - DurationMicros uint64 `protobuf:"varint,2,opt,name=duration_micros,json=durationMicros" json:"duration_micros,omitempty"` - Logs []*Log `protobuf:"bytes,3,rep,name=logs" json:"logs,omitempty"` - Counts []*MetricsSample `protobuf:"bytes,4,rep,name=counts" json:"counts,omitempty"` - Gauges []*MetricsSample `protobuf:"bytes,5,rep,name=gauges" json:"gauges,omitempty"` +func (x *InternalMetrics) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *InternalMetrics) Reset() { *m = InternalMetrics{} } -func (m *InternalMetrics) String() string { return proto.CompactTextString(m) } -func (*InternalMetrics) ProtoMessage() {} -func (*InternalMetrics) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*InternalMetrics) ProtoMessage() {} -func (m *InternalMetrics) GetStartTimestamp() *google_protobuf.Timestamp { - if m != nil { - return m.StartTimestamp +func (x *InternalMetrics) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[7] + 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 InternalMetrics.ProtoReflect.Descriptor instead. +func (*InternalMetrics) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{7} +} + +func (x *InternalMetrics) GetStartTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.StartTimestamp } return nil } -func (m *InternalMetrics) GetDurationMicros() uint64 { - if m != nil { - return m.DurationMicros +func (x *InternalMetrics) GetDurationMicros() uint64 { + if x != nil { + return x.DurationMicros } return 0 } -func (m *InternalMetrics) GetLogs() []*Log { - if m != nil { - return m.Logs +func (x *InternalMetrics) GetLogs() []*Log { + if x != nil { + return x.Logs } return nil } -func (m *InternalMetrics) GetCounts() []*MetricsSample { - if m != nil { - return m.Counts +func (x *InternalMetrics) GetCounts() []*MetricsSample { + if x != nil { + return x.Counts } return nil } -func (m *InternalMetrics) GetGauges() []*MetricsSample { - if m != nil { - return m.Gauges +func (x *InternalMetrics) GetGauges() []*MetricsSample { + if x != nil { + return x.Gauges } return nil } type Auth struct { - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` } -func (m *Auth) Reset() { *m = Auth{} } -func (m *Auth) String() string { return proto.CompactTextString(m) } -func (*Auth) ProtoMessage() {} -func (*Auth) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (x *Auth) Reset() { + *x = Auth{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *Auth) GetAccessToken() string { - if m != nil { - return m.AccessToken +func (x *Auth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Auth) ProtoMessage() {} + +func (x *Auth) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[8] + 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 Auth.ProtoReflect.Descriptor instead. +func (*Auth) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{8} +} + +func (x *Auth) GetAccessToken() string { + if x != nil { + return x.AccessToken } return "" } type ReportRequest struct { - Reporter *Reporter `protobuf:"bytes,1,opt,name=reporter" json:"reporter,omitempty"` - Auth *Auth `protobuf:"bytes,2,opt,name=auth" json:"auth,omitempty"` - Spans []*Span `protobuf:"bytes,3,rep,name=spans" json:"spans,omitempty"` - TimestampOffsetMicros int32 `protobuf:"varint,5,opt,name=timestamp_offset_micros,json=timestampOffsetMicros" json:"timestamp_offset_micros,omitempty"` - InternalMetrics *InternalMetrics `protobuf:"bytes,6,opt,name=internal_metrics,json=internalMetrics" json:"internal_metrics,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reporter *Reporter `protobuf:"bytes,1,opt,name=reporter,proto3" json:"reporter,omitempty"` + Auth *Auth `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth,omitempty"` + Spans []*Span `protobuf:"bytes,3,rep,name=spans,proto3" json:"spans,omitempty"` + TimestampOffsetMicros int64 `protobuf:"varint,5,opt,name=timestamp_offset_micros,json=timestampOffsetMicros,proto3" json:"timestamp_offset_micros,omitempty"` + InternalMetrics *InternalMetrics `protobuf:"bytes,6,opt,name=internal_metrics,json=internalMetrics,proto3" json:"internal_metrics,omitempty"` +} + +func (x *ReportRequest) Reset() { + *x = ReportRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ReportRequest) Reset() { *m = ReportRequest{} } -func (m *ReportRequest) String() string { return proto.CompactTextString(m) } -func (*ReportRequest) ProtoMessage() {} -func (*ReportRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (x *ReportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} -func (m *ReportRequest) GetReporter() *Reporter { - if m != nil { - return m.Reporter +func (*ReportRequest) ProtoMessage() {} + +func (x *ReportRequest) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[9] + 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 ReportRequest.ProtoReflect.Descriptor instead. +func (*ReportRequest) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{9} +} + +func (x *ReportRequest) GetReporter() *Reporter { + if x != nil { + return x.Reporter } return nil } -func (m *ReportRequest) GetAuth() *Auth { - if m != nil { - return m.Auth +func (x *ReportRequest) GetAuth() *Auth { + if x != nil { + return x.Auth } return nil } -func (m *ReportRequest) GetSpans() []*Span { - if m != nil { - return m.Spans +func (x *ReportRequest) GetSpans() []*Span { + if x != nil { + return x.Spans } return nil } -func (m *ReportRequest) GetTimestampOffsetMicros() int32 { - if m != nil { - return m.TimestampOffsetMicros +func (x *ReportRequest) GetTimestampOffsetMicros() int64 { + if x != nil { + return x.TimestampOffsetMicros } return 0 } -func (m *ReportRequest) GetInternalMetrics() *InternalMetrics { - if m != nil { - return m.InternalMetrics +func (x *ReportRequest) GetInternalMetrics() *InternalMetrics { + if x != nil { + return x.InternalMetrics } return nil } type Command struct { - Disable bool `protobuf:"varint,1,opt,name=disable" json:"disable,omitempty"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Command) Reset() { *m = Command{} } -func (m *Command) String() string { return proto.CompactTextString(m) } -func (*Command) ProtoMessage() {} -func (*Command) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + Disable bool `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"` + DevMode bool `protobuf:"varint,2,opt,name=dev_mode,json=devMode,proto3" json:"dev_mode,omitempty"` +} -func (m *Command) GetDisable() bool { - if m != nil { - return m.Disable +func (x *Command) Reset() { + *x = Command{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return false } -type ReportResponse struct { - Commands []*Command `protobuf:"bytes,1,rep,name=commands" json:"commands,omitempty"` - ReceiveTimestamp *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=receive_timestamp,json=receiveTimestamp" json:"receive_timestamp,omitempty"` - TransmitTimestamp *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=transmit_timestamp,json=transmitTimestamp" json:"transmit_timestamp,omitempty"` - Errors []string `protobuf:"bytes,4,rep,name=errors" json:"errors,omitempty"` +func (x *Command) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReportResponse) Reset() { *m = ReportResponse{} } -func (m *ReportResponse) String() string { return proto.CompactTextString(m) } -func (*ReportResponse) ProtoMessage() {} -func (*ReportResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (*Command) ProtoMessage() {} -func (m *ReportResponse) GetCommands() []*Command { - if m != nil { - return m.Commands +func (x *Command) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (m *ReportResponse) GetReceiveTimestamp() *google_protobuf.Timestamp { - if m != nil { - return m.ReceiveTimestamp - } - return nil +// Deprecated: Use Command.ProtoReflect.Descriptor instead. +func (*Command) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{10} } -func (m *ReportResponse) GetTransmitTimestamp() *google_protobuf.Timestamp { - if m != nil { - return m.TransmitTimestamp +func (x *Command) GetDisable() bool { + if x != nil { + return x.Disable } - return nil + return false } -func (m *ReportResponse) GetErrors() []string { - if m != nil { - return m.Errors +func (x *Command) GetDevMode() bool { + if x != nil { + return x.DevMode } - return nil + return false } -func init() { - proto.RegisterType((*SpanContext)(nil), "lightstep.collector.SpanContext") - proto.RegisterType((*KeyValue)(nil), "lightstep.collector.KeyValue") - proto.RegisterType((*Log)(nil), "lightstep.collector.Log") - proto.RegisterType((*Reference)(nil), "lightstep.collector.Reference") - proto.RegisterType((*Span)(nil), "lightstep.collector.Span") - proto.RegisterType((*Reporter)(nil), "lightstep.collector.Reporter") - proto.RegisterType((*MetricsSample)(nil), "lightstep.collector.MetricsSample") - proto.RegisterType((*InternalMetrics)(nil), "lightstep.collector.InternalMetrics") - proto.RegisterType((*Auth)(nil), "lightstep.collector.Auth") - proto.RegisterType((*ReportRequest)(nil), "lightstep.collector.ReportRequest") - proto.RegisterType((*Command)(nil), "lightstep.collector.Command") - proto.RegisterType((*ReportResponse)(nil), "lightstep.collector.ReportResponse") - proto.RegisterEnum("lightstep.collector.Reference_Relationship", Reference_Relationship_name, Reference_Relationship_value) +type ReportResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Commands []*Command `protobuf:"bytes,1,rep,name=commands,proto3" json:"commands,omitempty"` + ReceiveTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=receive_timestamp,json=receiveTimestamp,proto3" json:"receive_timestamp,omitempty"` + TransmitTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=transmit_timestamp,json=transmitTimestamp,proto3" json:"transmit_timestamp,omitempty"` + Errors []string `protobuf:"bytes,4,rep,name=errors,proto3" json:"errors,omitempty"` + Warnings []string `protobuf:"bytes,5,rep,name=warnings,proto3" json:"warnings,omitempty"` + Infos []string `protobuf:"bytes,6,rep,name=infos,proto3" json:"infos,omitempty"` +} + +func (x *ReportResponse) Reset() { + *x = ReportResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_collector_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +func (x *ReportResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +func (*ReportResponse) ProtoMessage() {} -// Client API for CollectorService service +func (x *ReportResponse) ProtoReflect() protoreflect.Message { + mi := &file_collector_proto_msgTypes[11] + 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) +} -type CollectorServiceClient interface { - Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) +// Deprecated: Use ReportResponse.ProtoReflect.Descriptor instead. +func (*ReportResponse) Descriptor() ([]byte, []int) { + return file_collector_proto_rawDescGZIP(), []int{11} } -type collectorServiceClient struct { - cc *grpc.ClientConn +func (x *ReportResponse) GetCommands() []*Command { + if x != nil { + return x.Commands + } + return nil } -func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { - return &collectorServiceClient{cc} +func (x *ReportResponse) GetReceiveTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.ReceiveTimestamp + } + return nil } -func (c *collectorServiceClient) Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) { - out := new(ReportResponse) - err := grpc.Invoke(ctx, "/lightstep.collector.CollectorService/Report", in, out, c.cc, opts...) - if err != nil { - return nil, err +func (x *ReportResponse) GetTransmitTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.TransmitTimestamp } - return out, nil + return nil } -// Server API for CollectorService service +func (x *ReportResponse) GetErrors() []string { + if x != nil { + return x.Errors + } + return nil +} -type CollectorServiceServer interface { - Report(context.Context, *ReportRequest) (*ReportResponse, error) +func (x *ReportResponse) GetWarnings() []string { + if x != nil { + return x.Warnings + } + return nil } -func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { - s.RegisterService(&_CollectorService_serviceDesc, srv) +func (x *ReportResponse) GetInfos() []string { + if x != nil { + return x.Infos + } + return nil } -func _CollectorService_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReportRequest) - if err := dec(in); err != nil { - return nil, err +var File_collector_proto protoreflect.FileDescriptor + +var file_collector_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x13, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xce, 0x01, 0x0a, 0x0b, 0x53, 0x70, 0x61, 0x6e, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1d, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x07, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49, + 0x64, 0x12, 0x47, 0x0a, 0x07, 0x62, 0x61, 0x67, 0x67, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x2e, 0x42, 0x61, 0x67, 0x67, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x07, 0x62, 0x61, 0x67, 0x67, 0x61, 0x67, 0x65, 0x1a, 0x3a, 0x0a, 0x0c, 0x42, 0x61, + 0x67, 0x67, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd4, 0x01, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x09, 0x69, 0x6e, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, + 0x01, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, + 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x76, 0x0a, + 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x35, + 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x68, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x6c, 0x69, 0x67, 0x68, + 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x68, 0x69, 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6c, 0x69, 0x67, + 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0b, 0x73, 0x70, + 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x2e, 0x0a, 0x0c, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x48, 0x49, + 0x4c, 0x44, 0x5f, 0x4f, 0x46, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x4f, 0x4c, 0x4c, 0x4f, + 0x57, 0x53, 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x10, 0x01, 0x22, 0x85, 0x03, 0x0a, 0x04, 0x53, 0x70, + 0x61, 0x6e, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, + 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, + 0x70, 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0b, 0x73, 0x70, 0x61, 0x6e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, + 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x43, + 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x2b, 0x0a, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, + 0x52, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, + 0x12, 0x31, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x74, + 0x61, 0x67, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, + 0x73, 0x22, 0x62, 0x0a, 0x08, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, 0x23, 0x0a, + 0x0b, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x04, 0x74, 0x61, 0x67, 0x73, 0x22, 0x74, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x09, 0x69, 0x6e, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x30, + 0x01, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, + 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa9, 0x02, 0x0a, 0x0f, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, + 0x43, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2b, 0x0a, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, + 0x01, 0x52, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x63, 0x72, 0x6f, + 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, + 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x67, + 0x61, 0x75, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x69, + 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, + 0x06, 0x67, 0x61, 0x75, 0x67, 0x65, 0x73, 0x22, 0x29, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, + 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0xb7, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, + 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, + 0x2d, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x2f, + 0x0a, 0x05, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x05, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x12, + 0x3a, 0x0a, 0x17, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x5f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x02, 0x30, 0x01, 0x52, 0x15, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x12, 0x4f, 0x0a, 0x10, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, + 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x0f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x3e, 0x0a, 0x07, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x76, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xa8, 0x02, 0x0a, + 0x0e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, + 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x47, 0x0a, 0x11, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x10, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x49, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, + 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x05, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x32, 0x95, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x80, 0x01, 0x0a, + 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x22, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, + 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6c, 0x69, + 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x5a, 0x11, 0x12, 0x0f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x22, 0x0f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x42, + 0x78, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x74, 0x65, 0x70, + 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x50, 0x01, 0x5a, 0x52, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, + 0x73, 0x74, 0x65, 0x70, 0x2f, 0x73, 0x6e, 0x2d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x6c, 0x69, 0x67, 0x68, + 0x74, 0x73, 0x74, 0x65, 0x70, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x70, 0x62, 0xa2, 0x02, 0x04, 0x4c, 0x53, 0x50, 0x42, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_collector_proto_rawDescOnce sync.Once + file_collector_proto_rawDescData = file_collector_proto_rawDesc +) + +func file_collector_proto_rawDescGZIP() []byte { + file_collector_proto_rawDescOnce.Do(func() { + file_collector_proto_rawDescData = protoimpl.X.CompressGZIP(file_collector_proto_rawDescData) + }) + return file_collector_proto_rawDescData +} + +var file_collector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_collector_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_collector_proto_goTypes = []interface{}{ + (Reference_Relationship)(0), // 0: lightstep.collector.Reference.Relationship + (*SpanContext)(nil), // 1: lightstep.collector.SpanContext + (*KeyValue)(nil), // 2: lightstep.collector.KeyValue + (*Log)(nil), // 3: lightstep.collector.Log + (*Reference)(nil), // 4: lightstep.collector.Reference + (*Span)(nil), // 5: lightstep.collector.Span + (*Reporter)(nil), // 6: lightstep.collector.Reporter + (*MetricsSample)(nil), // 7: lightstep.collector.MetricsSample + (*InternalMetrics)(nil), // 8: lightstep.collector.InternalMetrics + (*Auth)(nil), // 9: lightstep.collector.Auth + (*ReportRequest)(nil), // 10: lightstep.collector.ReportRequest + (*Command)(nil), // 11: lightstep.collector.Command + (*ReportResponse)(nil), // 12: lightstep.collector.ReportResponse + nil, // 13: lightstep.collector.SpanContext.BaggageEntry + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp +} +var file_collector_proto_depIdxs = []int32{ + 13, // 0: lightstep.collector.SpanContext.baggage:type_name -> lightstep.collector.SpanContext.BaggageEntry + 14, // 1: lightstep.collector.Log.timestamp:type_name -> google.protobuf.Timestamp + 2, // 2: lightstep.collector.Log.fields:type_name -> lightstep.collector.KeyValue + 0, // 3: lightstep.collector.Reference.relationship:type_name -> lightstep.collector.Reference.Relationship + 1, // 4: lightstep.collector.Reference.span_context:type_name -> lightstep.collector.SpanContext + 1, // 5: lightstep.collector.Span.span_context:type_name -> lightstep.collector.SpanContext + 4, // 6: lightstep.collector.Span.references:type_name -> lightstep.collector.Reference + 14, // 7: lightstep.collector.Span.start_timestamp:type_name -> google.protobuf.Timestamp + 2, // 8: lightstep.collector.Span.tags:type_name -> lightstep.collector.KeyValue + 3, // 9: lightstep.collector.Span.logs:type_name -> lightstep.collector.Log + 2, // 10: lightstep.collector.Reporter.tags:type_name -> lightstep.collector.KeyValue + 14, // 11: lightstep.collector.InternalMetrics.start_timestamp:type_name -> google.protobuf.Timestamp + 3, // 12: lightstep.collector.InternalMetrics.logs:type_name -> lightstep.collector.Log + 7, // 13: lightstep.collector.InternalMetrics.counts:type_name -> lightstep.collector.MetricsSample + 7, // 14: lightstep.collector.InternalMetrics.gauges:type_name -> lightstep.collector.MetricsSample + 6, // 15: lightstep.collector.ReportRequest.reporter:type_name -> lightstep.collector.Reporter + 9, // 16: lightstep.collector.ReportRequest.auth:type_name -> lightstep.collector.Auth + 5, // 17: lightstep.collector.ReportRequest.spans:type_name -> lightstep.collector.Span + 8, // 18: lightstep.collector.ReportRequest.internal_metrics:type_name -> lightstep.collector.InternalMetrics + 11, // 19: lightstep.collector.ReportResponse.commands:type_name -> lightstep.collector.Command + 14, // 20: lightstep.collector.ReportResponse.receive_timestamp:type_name -> google.protobuf.Timestamp + 14, // 21: lightstep.collector.ReportResponse.transmit_timestamp:type_name -> google.protobuf.Timestamp + 10, // 22: lightstep.collector.CollectorService.Report:input_type -> lightstep.collector.ReportRequest + 12, // 23: lightstep.collector.CollectorService.Report:output_type -> lightstep.collector.ReportResponse + 23, // [23:24] is the sub-list for method output_type + 22, // [22:23] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name +} + +func init() { file_collector_proto_init() } +func file_collector_proto_init() { + if File_collector_proto != nil { + return } - if interceptor == nil { - return srv.(CollectorServiceServer).Report(ctx, in) + if !protoimpl.UnsafeEnabled { + file_collector_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SpanContext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Log); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Span); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reporter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricsSample); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InternalMetrics); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Auth); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_collector_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lightstep.collector.CollectorService/Report", + file_collector_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*KeyValue_StringValue)(nil), + (*KeyValue_IntValue)(nil), + (*KeyValue_DoubleValue)(nil), + (*KeyValue_BoolValue)(nil), + (*KeyValue_JsonValue)(nil), } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CollectorServiceServer).Report(ctx, req.(*ReportRequest)) + file_collector_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*MetricsSample_IntValue)(nil), + (*MetricsSample_DoubleValue)(nil), } - return interceptor(ctx, in, info, handler) -} - -var _CollectorService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lightstep.collector.CollectorService", - HandlerType: (*CollectorServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Report", - Handler: _CollectorService_Report_Handler, + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_collector_proto_rawDesc, + NumEnums: 1, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "lightstep/collector/collector.proto", -} - -func init() { proto.RegisterFile("lightstep/collector/collector.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 1039 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0xae, 0x13, 0x37, 0x3f, 0x27, 0x69, 0x9b, 0x1d, 0x7e, 0x36, 0xad, 0xb6, 0x34, 0x38, 0x20, - 0xca, 0xcf, 0x26, 0x6a, 0x10, 0xa8, 0xf4, 0x02, 0x89, 0x06, 0xba, 0x8d, 0x48, 0xc9, 0x6a, 0xba, - 0x02, 0x69, 0x2f, 0x88, 0x26, 0xce, 0xd4, 0x35, 0x6b, 0x7b, 0xcc, 0xcc, 0x24, 0xa2, 0x97, 0x70, - 0xc9, 0x2d, 0x6f, 0x80, 0xc4, 0x13, 0xf0, 0x0e, 0x5c, 0x83, 0x78, 0x05, 0x9e, 0x81, 0x6b, 0xe4, - 0x99, 0xb1, 0xe3, 0x82, 0xb7, 0xad, 0xd0, 0xde, 0x79, 0xce, 0x7c, 0xdf, 0x99, 0x33, 0xe7, 0xfb, - 0xce, 0x24, 0xd0, 0x0d, 0x7c, 0xef, 0x52, 0x0a, 0x49, 0xe3, 0xbe, 0xcb, 0x82, 0x80, 0xba, 0x92, - 0xf1, 0xd5, 0x57, 0x2f, 0xe6, 0x4c, 0x32, 0xf4, 0x52, 0x06, 0xea, 0x65, 0x5b, 0x3b, 0x7b, 0x1e, - 0x63, 0x5e, 0x40, 0xfb, 0x0a, 0x32, 0x5b, 0x5c, 0xf4, 0xa5, 0x1f, 0x52, 0x21, 0x49, 0x18, 0x6b, - 0xd6, 0xce, 0x03, 0x03, 0x20, 0xb1, 0xdf, 0x27, 0x51, 0xc4, 0x24, 0x91, 0x3e, 0x8b, 0x84, 0xde, - 0x75, 0x7e, 0xb3, 0xa0, 0x71, 0x1e, 0x93, 0x68, 0xc8, 0x22, 0x49, 0xbf, 0x93, 0x68, 0x1b, 0x6a, - 0x92, 0x13, 0x97, 0x4e, 0xfd, 0x79, 0xdb, 0xea, 0x58, 0xfb, 0x36, 0xae, 0xaa, 0xf5, 0x68, 0x8e, - 0xee, 0x43, 0x55, 0xc4, 0x24, 0x4a, 0x76, 0x4a, 0x6a, 0xa7, 0x92, 0x2c, 0x47, 0x73, 0xf4, 0x08, - 0xaa, 0x33, 0xe2, 0x79, 0xc4, 0xa3, 0xed, 0x72, 0xa7, 0xbc, 0xdf, 0x18, 0x3c, 0xec, 0x15, 0x54, - 0xda, 0xcb, 0x1d, 0xd3, 0x3b, 0xd6, 0xf8, 0xcf, 0x22, 0xc9, 0xaf, 0x70, 0xca, 0xde, 0x39, 0x82, - 0x66, 0x7e, 0x03, 0xb5, 0xa0, 0xfc, 0x8c, 0x5e, 0xa9, 0x3a, 0xea, 0x38, 0xf9, 0x44, 0x2f, 0xc3, - 0xfa, 0x92, 0x04, 0x0b, 0xaa, 0x2a, 0xa8, 0x63, 0xbd, 0x38, 0x2a, 0x1d, 0x5a, 0xce, 0xef, 0x16, - 0xd4, 0x3e, 0xa7, 0x57, 0x5f, 0x26, 0x81, 0x02, 0x62, 0x17, 0x9a, 0x42, 0x72, 0x3f, 0xf2, 0xa6, - 0x39, 0xfe, 0xe9, 0x1a, 0x6e, 0xe8, 0xa8, 0xa6, 0xed, 0x42, 0xdd, 0x8f, 0xa4, 0x41, 0x94, 0x3b, - 0xd6, 0x7e, 0xf9, 0x74, 0x0d, 0xd7, 0xfc, 0x48, 0xea, 0xed, 0x2e, 0x34, 0xe7, 0x6c, 0x31, 0x0b, - 0xa8, 0x41, 0xd8, 0x1d, 0x6b, 0xdf, 0x4a, 0x72, 0xe8, 0xa8, 0x06, 0xed, 0x01, 0xcc, 0x18, 0x0b, - 0x0c, 0x64, 0xbd, 0x63, 0xed, 0xd7, 0x4e, 0xd7, 0x70, 0x3d, 0x89, 0x65, 0x80, 0x6f, 0x04, 0x8b, - 0x0c, 0xa0, 0x62, 0xea, 0xa8, 0x27, 0x31, 0x05, 0x38, 0xae, 0x9a, 0x3b, 0x3a, 0x4b, 0x28, 0x8f, - 0x99, 0x87, 0x0e, 0xa1, 0x9e, 0x69, 0xaa, 0xae, 0xd4, 0x18, 0xec, 0xf4, 0xb4, 0xa8, 0xbd, 0x54, - 0xf5, 0xde, 0x93, 0x14, 0x81, 0x57, 0x60, 0xf4, 0x01, 0x54, 0x2e, 0x7c, 0x1a, 0xcc, 0x45, 0xbb, - 0xa4, 0x74, 0xd9, 0x2d, 0xd4, 0x25, 0xed, 0x1a, 0x36, 0x60, 0xe7, 0x0f, 0x0b, 0xea, 0x98, 0x5e, - 0x50, 0x4e, 0x23, 0x97, 0xa2, 0x09, 0x34, 0x39, 0x0d, 0xb4, 0x69, 0x2e, 0x7d, 0x5d, 0xc1, 0xe6, - 0xe0, 0xdd, 0xc2, 0x54, 0x19, 0xab, 0x87, 0x73, 0x14, 0x7c, 0x2d, 0x01, 0x1a, 0x42, 0x53, 0xf9, - 0xc8, 0xd5, 0x5e, 0x50, 0x52, 0x34, 0x06, 0x9d, 0xdb, 0x3c, 0x83, 0x1b, 0x62, 0xb5, 0x70, 0x7a, - 0xd0, 0xcc, 0x1f, 0x81, 0x9a, 0x50, 0x1b, 0x9e, 0x8e, 0xc6, 0x9f, 0x4e, 0x27, 0x27, 0xad, 0x35, - 0xd4, 0x82, 0xe6, 0xc9, 0x64, 0x3c, 0x9e, 0x7c, 0x75, 0x3e, 0x3d, 0xc1, 0x93, 0xb3, 0x96, 0xe5, - 0x7c, 0x5f, 0x06, 0x3b, 0x49, 0xf6, 0x9f, 0xd3, 0xad, 0xff, 0x71, 0x3a, 0x7a, 0x13, 0x36, 0x59, - 0x4c, 0xb9, 0x3a, 0x7e, 0x1a, 0x91, 0x30, 0xf5, 0xe3, 0x46, 0x16, 0xfd, 0x82, 0x84, 0x14, 0x7d, - 0x0c, 0xc0, 0xd3, 0x8e, 0x08, 0x33, 0x1b, 0xaf, 0xdd, 0xdc, 0x38, 0x9c, 0x63, 0xa0, 0x21, 0x6c, - 0x09, 0x49, 0xb8, 0x9c, 0xae, 0xf4, 0xb7, 0x6f, 0xd5, 0x7f, 0x53, 0x51, 0xb2, 0x35, 0x7a, 0x0b, - 0xb6, 0xe6, 0x0b, 0x53, 0x6a, 0xe8, 0xbb, 0x9c, 0x09, 0xe5, 0x4a, 0x1b, 0x6f, 0xa6, 0xe1, 0x33, - 0x15, 0x45, 0x07, 0x60, 0x4b, 0xe2, 0x89, 0x76, 0xe5, 0x2e, 0x5e, 0x51, 0x50, 0xf4, 0x1e, 0xd8, - 0x01, 0xf3, 0x44, 0xbb, 0xaa, 0x28, 0xed, 0x42, 0xca, 0x98, 0x79, 0x58, 0xa1, 0x9c, 0xaf, 0xa1, - 0x86, 0x69, 0xcc, 0xb8, 0xa4, 0x1c, 0xed, 0x41, 0x83, 0x9b, 0xef, 0xd5, 0x53, 0x03, 0x69, 0x68, - 0x34, 0xcf, 0xaa, 0xb1, 0xef, 0x5c, 0x8d, 0x13, 0xc3, 0xc6, 0x19, 0x95, 0xdc, 0x77, 0xc5, 0x39, - 0x09, 0xe3, 0x80, 0x22, 0x04, 0xb6, 0x12, 0x47, 0xbf, 0x03, 0xea, 0xfb, 0xfa, 0x8c, 0x97, 0x6e, - 0x9d, 0xf1, 0x72, 0xc1, 0x8c, 0xaf, 0x26, 0xf4, 0x97, 0x12, 0x6c, 0x8d, 0x22, 0x49, 0x79, 0x44, - 0x02, 0x73, 0x74, 0x91, 0x68, 0xd6, 0x8b, 0x10, 0xad, 0x54, 0x28, 0x5a, 0xaa, 0x40, 0xf9, 0x2e, - 0x0a, 0xa0, 0x23, 0xa8, 0xb8, 0x6c, 0x11, 0xc9, 0xb4, 0xad, 0x4e, 0x21, 0xfe, 0x5a, 0x13, 0xb1, - 0x61, 0x24, 0x5c, 0x8f, 0x2c, 0x3c, 0x9a, 0xd8, 0xe7, 0xce, 0x5c, 0xcd, 0x70, 0xde, 0x06, 0xfb, - 0x93, 0x85, 0xbc, 0x44, 0xaf, 0x43, 0x93, 0xb8, 0x2e, 0x15, 0x62, 0x2a, 0xd9, 0x33, 0x1a, 0x19, - 0x61, 0x1a, 0x3a, 0xf6, 0x24, 0x09, 0x39, 0xbf, 0x96, 0x60, 0x43, 0xbb, 0x04, 0xd3, 0x6f, 0x17, - 0x54, 0x48, 0xf4, 0x11, 0xd4, 0x52, 0x5f, 0x98, 0x4e, 0xee, 0x3e, 0x67, 0x86, 0x34, 0x08, 0x67, - 0x70, 0xf4, 0x10, 0x6c, 0xb2, 0x90, 0x97, 0xe6, 0x89, 0xd9, 0x2e, 0xa4, 0x25, 0x85, 0x61, 0x05, - 0x43, 0x7d, 0x58, 0x4f, 0xa6, 0x3c, 0xed, 0xe6, 0xf6, 0x73, 0x1f, 0x05, 0xac, 0x71, 0xe8, 0x43, - 0xb8, 0x9f, 0xa9, 0x3c, 0x65, 0x17, 0x17, 0x82, 0xca, 0xfc, 0x8c, 0xad, 0xe3, 0x57, 0xb2, 0xed, - 0x89, 0xda, 0x35, 0xaa, 0x4d, 0xa0, 0xe5, 0x1b, 0xdb, 0x4c, 0x43, 0xdd, 0x31, 0xf5, 0x4b, 0xd0, - 0x18, 0xbc, 0x51, 0x78, 0xe6, 0xbf, 0x3c, 0x86, 0xb7, 0xfc, 0xeb, 0x01, 0xa7, 0x0b, 0xd5, 0x21, - 0x0b, 0x43, 0x12, 0xcd, 0x51, 0x1b, 0xaa, 0x73, 0x5f, 0x90, 0x59, 0xa0, 0x7d, 0x5f, 0xc3, 0xe9, - 0xd2, 0xf9, 0xdb, 0x82, 0xcd, 0xb4, 0xb5, 0x22, 0x66, 0x91, 0xa0, 0xe8, 0x10, 0x6a, 0xae, 0xe6, - 0x89, 0xb6, 0xa5, 0x2e, 0xfd, 0xa0, 0xb0, 0x00, 0x93, 0x1c, 0x67, 0x68, 0xf4, 0x08, 0xee, 0x71, - 0xea, 0x52, 0x7f, 0x49, 0x73, 0x46, 0x2f, 0xdd, 0x6a, 0xf4, 0x96, 0x21, 0xad, 0xac, 0x3e, 0x02, - 0x24, 0x39, 0x89, 0x44, 0xe8, 0xe7, 0x47, 0xa6, 0x7c, 0x6b, 0xa6, 0x7b, 0x29, 0x6b, 0x95, 0xea, - 0x55, 0xa8, 0x50, 0xce, 0x19, 0xd7, 0xf6, 0xae, 0x63, 0xb3, 0x1a, 0xfc, 0x68, 0x41, 0x6b, 0x98, - 0xde, 0xe5, 0x9c, 0xf2, 0xa5, 0xef, 0x52, 0xb4, 0x84, 0x8a, 0x6e, 0x06, 0x72, 0x6e, 0xb0, 0x93, - 0x31, 0xe1, 0x4e, 0xf7, 0x46, 0x8c, 0xee, 0xa6, 0xd3, 0xfd, 0xe1, 0xcf, 0xbf, 0x7e, 0x2a, 0xed, - 0x3a, 0xd0, 0x5f, 0x1e, 0xf4, 0xb5, 0x09, 0x8f, 0xac, 0x77, 0x9e, 0x36, 0x51, 0x2e, 0x70, 0x7c, - 0x00, 0xdb, 0x2e, 0x0b, 0x73, 0xe9, 0xd4, 0xff, 0x2b, 0xde, 0xf3, 0x78, 0xec, 0x3e, 0xb6, 0x9e, - 0x36, 0xb2, 0xec, 0xf1, 0xec, 0xe7, 0x92, 0x3d, 0x3e, 0x7f, 0x7c, 0x3c, 0xab, 0xa8, 0xeb, 0xbf, - 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0x92, 0x1b, 0x06, 0x26, 0x0a, 0x00, 0x00, + GoTypes: file_collector_proto_goTypes, + DependencyIndexes: file_collector_proto_depIdxs, + EnumInfos: file_collector_proto_enumTypes, + MessageInfos: file_collector_proto_msgTypes, + }.Build() + File_collector_proto = out.File + file_collector_proto_rawDesc = nil + file_collector_proto_goTypes = nil + file_collector_proto_depIdxs = nil } diff --git a/collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go b/collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go new file mode 100644 index 0000000..a83a2d2 --- /dev/null +++ b/collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: collector.proto + +package collectorpb + +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 + +const ( + CollectorService_Report_FullMethodName = "/lightstep.collector.CollectorService/Report" +) + +// CollectorServiceClient is the client API for CollectorService 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 CollectorServiceClient interface { + Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) +} + +type collectorServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewCollectorServiceClient(cc grpc.ClientConnInterface) CollectorServiceClient { + return &collectorServiceClient{cc} +} + +func (c *collectorServiceClient) Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) { + out := new(ReportResponse) + err := c.cc.Invoke(ctx, CollectorService_Report_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CollectorServiceServer is the server API for CollectorService service. +// All implementations must embed UnimplementedCollectorServiceServer +// for forward compatibility +type CollectorServiceServer interface { + Report(context.Context, *ReportRequest) (*ReportResponse, error) + mustEmbedUnimplementedCollectorServiceServer() +} + +// UnimplementedCollectorServiceServer must be embedded to have forward compatible implementations. +type UnimplementedCollectorServiceServer struct { +} + +func (UnimplementedCollectorServiceServer) Report(context.Context, *ReportRequest) (*ReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Report not implemented") +} +func (UnimplementedCollectorServiceServer) mustEmbedUnimplementedCollectorServiceServer() {} + +// UnsafeCollectorServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CollectorServiceServer will +// result in compilation errors. +type UnsafeCollectorServiceServer interface { + mustEmbedUnimplementedCollectorServiceServer() +} + +func RegisterCollectorServiceServer(s grpc.ServiceRegistrar, srv CollectorServiceServer) { + s.RegisterService(&CollectorService_ServiceDesc, srv) +} + +func _CollectorService_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CollectorServiceServer).Report(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CollectorService_Report_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CollectorServiceServer).Report(ctx, req.(*ReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// CollectorService_ServiceDesc is the grpc.ServiceDesc for CollectorService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CollectorService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "lightstep.collector.CollectorService", + HandlerType: (*CollectorServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Report", + Handler: _CollectorService_Report_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "collector.proto", +} diff --git a/collector/components/lightstepreceiver/internal/metadata/generated_status.go b/collector/components/lightstepreceiver/internal/metadata/generated_status.go index 06ac010..ec9eb0c 100644 --- a/collector/components/lightstepreceiver/internal/metadata/generated_status.go +++ b/collector/components/lightstepreceiver/internal/metadata/generated_status.go @@ -6,7 +6,10 @@ import ( "go.opentelemetry.io/collector/component" ) +var ( + Type = component.MustNewType("lightstep") +) + const ( - Type = "lightstep" TracesStability = component.StabilityLevelBeta ) diff --git a/collector/components/lightstepreceiver/metadata.yaml b/collector/components/lightstepreceiver/metadata.yaml index 5f6d882..85d7f44 100644 --- a/collector/components/lightstepreceiver/metadata.yaml +++ b/collector/components/lightstepreceiver/metadata.yaml @@ -9,3 +9,9 @@ status: - contrib codeowners: active: [carlosalberto] + +tests: + config: + protocols: + http: + endpoint: 127.0.0.1:4318 diff --git a/collector/components/lightstepreceiver/proto/collector.proto b/collector/components/lightstepreceiver/proto/collector.proto new file mode 100644 index 0000000..c7f53fd --- /dev/null +++ b/collector/components/lightstepreceiver/proto/collector.proto @@ -0,0 +1,116 @@ +syntax = "proto3"; + +package lightstep.collector; + +option go_package = "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb"; +option objc_class_prefix = "LSPB"; +option java_multiple_files = true; +option java_package = "com.lightstep.tracer.grpc"; + +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +message SpanContext { + uint64 trace_id = 1 [jstype=JS_STRING]; + uint64 span_id = 2 [jstype=JS_STRING]; + map baggage = 3; +} + +// Represent both tags and log fields. +message KeyValue { + string key = 1; + oneof value { + // Holds arbitrary string data; well-formed JSON strings should go in + // json_value. + string string_value = 2; + int64 int_value = 3 [jstype=JS_STRING]; + double double_value = 4; + bool bool_value = 5; + // Must be a well-formed JSON value. Truncated JSON should go in + // string_value. Should not be used for tags. + string json_value = 6; + } +} + +message Log { + google.protobuf.Timestamp timestamp = 1; + repeated KeyValue fields = 2; +} + +message Reference { + enum Relationship { + CHILD_OF = 0; + FOLLOWS_FROM = 1; + } + Relationship relationship = 1; + SpanContext span_context = 2; +} + +message Span { + SpanContext span_context = 1; + string operation_name = 2; + repeated Reference references = 3; + google.protobuf.Timestamp start_timestamp = 4; + uint64 duration_micros = 5 [jstype=JS_STRING]; + repeated KeyValue tags = 6; + repeated Log logs = 7; +} + +message Reporter { + uint64 reporter_id = 1 [jstype=JS_STRING]; + repeated KeyValue tags = 4; +} + +message MetricsSample { + string name = 1; + oneof value { + int64 int_value = 2 [jstype=JS_STRING]; + double double_value = 3; + } +} + +message InternalMetrics { + google.protobuf.Timestamp start_timestamp = 1; + uint64 duration_micros = 2 [jstype=JS_STRING]; + repeated Log logs = 3; + repeated MetricsSample counts = 4; + repeated MetricsSample gauges = 5; +} + +message Auth { + string access_token = 1; +} + +message ReportRequest { + Reporter reporter = 1; + Auth auth = 2; + repeated Span spans = 3; + int64 timestamp_offset_micros = 5 [jstype=JS_STRING]; + InternalMetrics internal_metrics = 6; +} + +message Command { + bool disable = 1; + bool dev_mode = 2; +} + +message ReportResponse { + repeated Command commands = 1; + google.protobuf.Timestamp receive_timestamp = 2; + google.protobuf.Timestamp transmit_timestamp = 3; + repeated string errors = 4; + repeated string warnings = 5; + repeated string infos = 6; +} + +service CollectorService { + rpc Report(ReportRequest) returns (ReportResponse) { + option (google.api.http) = { + post: "/api/v2/reports" + body: "*" + additional_bindings { + get: "/api/v2/reports" + } + }; + } +} diff --git a/collector/components/lightstepreceiver/proto/generate.sh b/collector/components/lightstepreceiver/proto/generate.sh new file mode 100755 index 0000000..5302c0e --- /dev/null +++ b/collector/components/lightstepreceiver/proto/generate.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Run this in the ../ i.e., lightstepreceiver. +rm -rf internal +mkdir internal + +protoc -I proto --go_out=internal --go-grpc_out=internal proto/collector.proto + +mv internal/github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb internal +rm -rf internal/github.com + +mdatagen metadata.yaml diff --git a/collector/components/lightstepreceiver/proto/google/api/annotations.proto b/collector/components/lightstepreceiver/proto/google/api/annotations.proto new file mode 100644 index 0000000..85c361b --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright (c) 2015, Google Inc. +// +// 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. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/collector/components/lightstepreceiver/proto/google/api/http.proto b/collector/components/lightstepreceiver/proto/google/api/http.proto new file mode 100644 index 0000000..2bd3a19 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/api/http.proto @@ -0,0 +1,318 @@ +// Copyright 2018 Google LLC +// +// 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. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parmeters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// `HttpRule` defines the mapping of an RPC method to one or more HTTP +// REST API methods. The mapping specifies how different portions of the RPC +// request message are mapped to URL path, URL query parameters, and +// HTTP request body. The mapping is typically specified as an +// `google.api.http` annotation on the RPC method, +// see "google/api/annotations.proto" for details. +// +// The mapping consists of a field specifying the path template and +// method kind. The path template can refer to fields in the request +// message, as in the example below which describes a REST GET +// operation on a resource collection of messages: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// SubMessage sub = 2; // `sub.subfield` is url-mapped +// } +// message Message { +// string text = 1; // content of the resource +// } +// +// The same http annotation can alternatively be expressed inside the +// `GRPC API Configuration` YAML file. +// +// http: +// rules: +// - selector: .Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// This definition enables an automatic, bidrectional mapping of HTTP +// JSON to RPC. Example: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` +// +// In general, not only fields but also field paths can be referenced +// from a path pattern. Fields mapped to the path pattern cannot be +// repeated and must have a primitive (non-message) type. +// +// Any fields in the request message which are not bound by the path +// pattern automatically become (optional) HTTP query +// parameters. Assume the following definition of the request message: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// int64 revision = 2; // becomes a parameter +// SubMessage sub = 3; // `sub.subfield` becomes a parameter +// } +// +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` +// +// Note that fields which are mapped to HTTP parameters must have a +// primitive type or a repeated primitive type. Message types are not +// allowed. In the case of a repeated type, the parameter can be +// repeated in the URL, as in `...?param=A¶m=B`. +// +// For HTTP method kinds which allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice of +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// +// This enables the following two alternative HTTP JSON to RPC +// mappings: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` +// +// # Rules for HTTP mapping +// +// The rules for mapping HTTP path, query parameters, and body fields +// to the request message are as follows: +// +// 1. The `body` field specifies either `*` or a field path, or is +// omitted. If omitted, it indicates there is no HTTP request body. +// 2. Leaf fields (recursive expansion of nested messages in the +// request) can be classified into three types: +// (a) Matched in the URL template. +// (b) Covered by body (if body is `*`, everything except (a) fields; +// else everything under the body field) +// (c) All other fields. +// 3. URL query parameters found in the HTTP request are mapped to (c) fields. +// 4. Any body sent with an HTTP request can contain only (b) fields. +// +// The syntax of the path template is as follows: +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single path segment. The syntax `**` matches zero +// or more path segments, which must be the last part of the path except the +// `Verb`. The syntax `LITERAL` matches literal text in the path. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path, all characters +// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the +// Discovery Document as `{var}`. +// +// If a variable contains one or more path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path, all +// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables +// show up in the Discovery Document as `{+var}`. +// +// NOTE: While the single segment variable matches the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 +// Simple String Expansion, the multi segment variable **does not** match +// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. +// +// NOTE: the field paths in variables and in the `body` must not refer to +// repeated fields or map fields. +message HttpRule { + // Selects methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Used for listing and getting information about resources. + string get = 2; + + // Used for updating a resource. + string put = 3; + + // Used for creating a resource. + string post = 4; + + // Used for deleting a resource. + string delete = 5; + + // Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP body, or + // `*` for mapping all fields not captured by the path pattern to the HTTP + // body. NOTE: the referred field must not be a repeated field and must be + // present at the top-level of request message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // body of response. Other response fields are ignored. When + // not set, the response message will be used as HTTP body of response. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/collector/components/lightstepreceiver/proto/google/api/httpbody.proto b/collector/components/lightstepreceiver/proto/google/api/httpbody.proto new file mode 100644 index 0000000..4428515 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/api/httpbody.proto @@ -0,0 +1,78 @@ +// Copyright 2018 Google LLC. +// +// 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. +// + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) returns +// (google.protobuf.Empty); +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} \ No newline at end of file diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/any.proto b/collector/components/lightstepreceiver/proto/google/protobuf/any.proto new file mode 100644 index 0000000..eff44e5 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/any.proto @@ -0,0 +1,162 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// // or ... +// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +// foo = any.unpack(Foo.getDefaultInstance()); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/api.proto b/collector/components/lightstepreceiver/proto/google/protobuf/api.proto new file mode 100644 index 0000000..4222351 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/api.proto @@ -0,0 +1,207 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/apipb"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inherting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/compiler/plugin.proto b/collector/components/lightstepreceiver/proto/google/protobuf/compiler/plugin.proto new file mode 100644 index 0000000..829cf41 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/compiler/plugin.proto @@ -0,0 +1,168 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +// Author: kenton@google.com (Kenton Varda) +// +// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +// just a program that reads a CodeGeneratorRequest from stdin and writes a +// CodeGeneratorResponse to stdout. +// +// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +// of dealing with the raw protocol defined here. +// +// A plugin executable needs only to be placed somewhere in the path. The +// plugin should be named "protoc-gen-$NAME", and will then be used when the +// flag "--${NAME}_out" is passed to protoc. + +syntax = "proto2"; + +package google.protobuf.compiler; +option java_package = "com.google.protobuf.compiler"; +option java_outer_classname = "PluginProtos"; + +option csharp_namespace = "Google.Protobuf.Compiler"; +option go_package = "google.golang.org/protobuf/types/pluginpb"; + +import "google/protobuf/descriptor.proto"; + +// The version number of protocol compiler. +message Version { + optional int32 major = 1; + optional int32 minor = 2; + optional int32 patch = 3; + // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + // be empty for mainline stable releases. + optional string suffix = 4; +} + +// An encoded CodeGeneratorRequest is written to the plugin's stdin. +message CodeGeneratorRequest { + // The .proto files that were explicitly listed on the command-line. The + // code generator should generate code only for these files. Each file's + // descriptor will be included in proto_file, below. + repeated string file_to_generate = 1; + + // The generator parameter passed on the command-line. + optional string parameter = 2; + + // FileDescriptorProtos for all files in files_to_generate and everything + // they import. The files will appear in topological order, so each file + // appears before any file that imports it. + // + // Note: the files listed in files_to_generate will include runtime-retention + // options only, but all other files will include source-retention options. + // The source_file_descriptors field below is available in case you need + // source-retention options for files_to_generate. + // + // protoc guarantees that all proto_files will be written after + // the fields above, even though this is not technically guaranteed by the + // protobuf wire format. This theoretically could allow a plugin to stream + // in the FileDescriptorProtos and handle them one by one rather than read + // the entire set into memory at once. However, as of this writing, this + // is not similarly optimized on protoc's end -- it will store all fields in + // memory at once before sending them to the plugin. + // + // Type names of fields and extensions in the FileDescriptorProto are always + // fully qualified. + repeated FileDescriptorProto proto_file = 15; + + // File descriptors with all options, including source-retention options. + // These descriptors are only provided for the files listed in + // files_to_generate. + repeated FileDescriptorProto source_file_descriptors = 17; + + // The version number of protocol compiler. + optional Version compiler_version = 3; +} + +// The plugin writes an encoded CodeGeneratorResponse to stdout. +message CodeGeneratorResponse { + // Error message. If non-empty, code generation failed. The plugin process + // should exit with status code zero even if it reports an error in this way. + // + // This should be used to indicate errors in .proto files which prevent the + // code generator from generating correct code. Errors which indicate a + // problem in protoc itself -- such as the input CodeGeneratorRequest being + // unparseable -- should be reported by writing a message to stderr and + // exiting with a non-zero status code. + optional string error = 1; + + // A bitmask of supported features that the code generator supports. + // This is a bitwise "or" of values from the Feature enum. + optional uint64 supported_features = 2; + + // Sync with code_generator.h. + enum Feature { + FEATURE_NONE = 0; + FEATURE_PROTO3_OPTIONAL = 1; + FEATURE_SUPPORTS_EDITIONS = 2; + } + + // Represents a single generated file. + message File { + // The file name, relative to the output directory. The name must not + // contain "." or ".." components and must be relative, not be absolute (so, + // the file cannot lie outside the output directory). "/" must be used as + // the path separator, not "\". + // + // If the name is omitted, the content will be appended to the previous + // file. This allows the generator to break large files into small chunks, + // and allows the generated text to be streamed back to protoc so that large + // files need not reside completely in memory at one time. Note that as of + // this writing protoc does not optimize for this -- it will read the entire + // CodeGeneratorResponse before writing files to disk. + optional string name = 1; + + // If non-empty, indicates that the named file should already exist, and the + // content here is to be inserted into that file at a defined insertion + // point. This feature allows a code generator to extend the output + // produced by another code generator. The original generator may provide + // insertion points by placing special annotations in the file that look + // like: + // @@protoc_insertion_point(NAME) + // The annotation can have arbitrary text before and after it on the line, + // which allows it to be placed in a comment. NAME should be replaced with + // an identifier naming the point -- this is what other generators will use + // as the insertion_point. Code inserted at this point will be placed + // immediately above the line containing the insertion point (thus multiple + // insertions to the same point will come out in the order they were added). + // The double-@ is intended to make it unlikely that the generated code + // could contain things that look like insertion points by accident. + // + // For example, the C++ code generator places the following line in the + // .pb.h files that it generates: + // // @@protoc_insertion_point(namespace_scope) + // This line appears within the scope of the file's package namespace, but + // outside of any particular class. Another plugin can then specify the + // insertion_point "namespace_scope" to generate additional classes or + // other declarations that should be placed in this scope. + // + // Note that if the line containing the insertion point begins with + // whitespace, the same whitespace will be added to every line of the + // inserted text. This is useful for languages like Python, where + // indentation matters. In these languages, the insertion point comment + // should be indented the same amount as any inserted code will need to be + // in order to work correctly in that context. + // + // The code generator that generates the initial file and the one which + // inserts into it must both run as part of a single invocation of protoc. + // Code generators are executed in the order in which they appear on the + // command line. + // + // If |insertion_point| is present, |name| must also be present. + optional string insertion_point = 2; + + // The file contents. + optional string content = 15; + + // Information describing the file content being inserted. If an insertion + // point is used, this information will be appropriately offset and inserted + // into the code generation metadata for the generated files. + optional GeneratedCodeInfo generated_code_info = 16; + } + repeated File file = 15; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/descriptor.proto b/collector/components/lightstepreceiver/proto/google/protobuf/descriptor.proto new file mode 100644 index 0000000..4748643 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/descriptor.proto @@ -0,0 +1,1218 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// The full set of known editions. +enum Edition { + // A placeholder for an unknown edition value. + EDITION_UNKNOWN = 0; + + // Legacy syntax "editions". These pre-date editions, but behave much like + // distinct editions. These can't be used to specify the edition of proto + // files, but feature definitions must supply proto2/proto3 defaults for + // backwards compatibility. + EDITION_PROTO2 = 998; + EDITION_PROTO3 = 999; + + // Editions that have been released. The specific values are arbitrary and + // should not be depended on, but they will always be time-ordered for easy + // comparison. + EDITION_2023 = 1000; + + // Placeholder editions for testing feature resolution. These should not be + // used or relyed on outside of tests. + EDITION_1_TEST_ONLY = 1; + EDITION_2_TEST_ONLY = 2; + EDITION_99997_TEST_ONLY = 99997; + EDITION_99998_TEST_ONLY = 99998; + EDITION_99999_TEST_ONLY = 99999; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2", "proto3", and "editions". + // + // If `edition` is present, this value must be "editions". + optional string syntax = 12; + + // The edition of the proto file. + optional Edition edition = 14; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + message Declaration { + // The extension number declared within the extension range. + optional int32 number = 1; + + // The fully-qualified name of the extension field. There must be a leading + // dot in front of the full name. + optional string full_name = 2; + + // The fully-qualified type name of the extension field. Unlike + // Metadata.type, Declaration.type must have a leading dot for messages + // and enums. + optional string type = 3; + + // If true, indicates that the number is reserved in the extension range, + // and any extension field with the number will fail to compile. Set this + // when a declared extension field is deleted. + optional bool reserved = 5; + + // If true, indicates that the extension must be defined as repeated. + // Otherwise the extension must be defined as optional. + optional bool repeated = 6; + + reserved 4; // removed is_repeated + } + + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. + repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The verification state of the extension range. + enum VerificationState { + // All the extensions of the range must be declared. + DECLARATION = 0; + UNVERIFIED = 1; + } + + // The verification state of the range. + // TODO: flip the default to DECLARATION once all empty ranges + // are marked as UNVERIFIED. + optional VerificationState verification = 3 [default = UNVERIFIED]; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported after google.protobuf. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. In Editions, the group wire format + // can be enabled via the `message_encoding` feature. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REPEATED = 3; + // The required label is only allowed in google.protobuf. In proto3 and Editions + // it's explicitly prohibited. In Editions, the `field_presence` feature + // can be used to get this behavior. + LABEL_REQUIRED = 2; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must be belong to a oneof to + // signal to old proto3 clients that presence is tracked for this field. This + // oneof is known as a "synthetic" oneof, and this field must be its sole + // member (each proto3 optional field gets its own synthetic oneof). Synthetic + // oneofs exist in the descriptor only, and do not generate any API. Synthetic + // oneofs must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + // + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // + // This should only be used as a temporary measure against broken builds due + // to the change in behavior for JSON field name conflicts. + // + // TODO This is legacy behavior we plan to remove once downstream + // teams have had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 12; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is only implemented to support use of + // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + // type "bytes" in the open source release -- sorry, we'll try to include + // other types in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + // The option [ctype=CORD] may be applied to a non-repeated field of type + // "bytes". It indicates that in C++, the data should be stored in a Cord + // instead of a string. For very large strings, this may reduce memory + // fragmentation. It may also allow better performance when parsing from a + // Cord, or when parsing with aliasing enabled, as the parsed Cord may then + // alias the original buffer. + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. This option is prohibited in + // Editions, but the `repeated_field_encoding` feature can be used to control + // the behavior. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + // + // As of May 2022, lazy verifies the contents of the byte stream during + // parsing. An invalid byte stream will cause the overall parsing to fail. + optional bool lazy = 5 [default = false]; + + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + // Indicate that the field value should not be printed out when using debug + // formats, e.g. when the field contains sensitive credentials. + optional bool debug_redact = 16 [default = false]; + + // If set to RETENTION_SOURCE, the option will be omitted from the binary. + // Note: as of January 2023, support for this is in progress and does not yet + // have an effect (b/264593489). + enum OptionRetention { + RETENTION_UNKNOWN = 0; + RETENTION_RUNTIME = 1; + RETENTION_SOURCE = 2; + } + + optional OptionRetention retention = 17; + + // This indicates the types of entities that the field may apply to when used + // as an option. If it is unset, then the field may be freely used as an + // option on any kind of entity. Note: as of January 2023, support for this is + // in progress and does not yet have an effect (b/264593489). + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0; + TARGET_TYPE_FILE = 1; + TARGET_TYPE_EXTENSION_RANGE = 2; + TARGET_TYPE_MESSAGE = 3; + TARGET_TYPE_FIELD = 4; + TARGET_TYPE_ONEOF = 5; + TARGET_TYPE_ENUM = 6; + TARGET_TYPE_ENUM_ENTRY = 7; + TARGET_TYPE_SERVICE = 8; + TARGET_TYPE_METHOD = 9; + } + + repeated OptionTargetType targets = 19; + + message EditionDefault { + optional Edition edition = 3; + optional string value = 2; // Textproto value. + } + repeated EditionDefault edition_defaults = 20; + + // Any features defined in the specific edition. + optional FeatureSet features = 21; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype + reserved 18; // reserve target, target_obsolete_do_not_use +} + +message OneofOptions { + // Any features defined in the specific edition. + optional FeatureSet features = 1; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // TODO Remove this legacy behavior once downstream teams have + // had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 7; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // Any features defined in the specific edition. + optional FeatureSet features = 2; + + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + optional bool debug_redact = 3 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Any features defined in the specific edition. + optional FeatureSet features = 34; + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // Any features defined in the specific edition. + optional FeatureSet features = 35; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + // "foo.(bar.baz).moo". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Features + +// TODO Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +message FeatureSet { + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0; + EXPLICIT = 1; + IMPLICIT = 2; + LEGACY_REQUIRED = 3; + } + optional FieldPresence field_presence = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, + edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } + ]; + + enum EnumType { + ENUM_TYPE_UNKNOWN = 0; + OPEN = 1; + CLOSED = 2; + } + optional EnumType enum_type = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } + ]; + + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0; + PACKED = 1; + EXPANDED = 2; + } + optional RepeatedFieldEncoding repeated_field_encoding = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } + ]; + + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0; + NONE = 1; + VERIFY = 2; + } + optional Utf8Validation utf8_validation = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "NONE" }, + edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } + ]; + + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0; + LENGTH_PREFIXED = 1; + DELIMITED = 2; + } + optional MessageEncoding message_encoding = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" } + ]; + + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0; + ALLOW = 1; + LEGACY_BEST_EFFORT = 2; + } + optional JsonFormat json_format = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } + ]; + + reserved 999; + + extensions 1000; // for Protobuf C++ + extensions 1001; // for Protobuf Java + + extensions 9995 to 9999; // For internal testing +} + +// A compiled specification for the defaults of a set of features. These +// messages are generated from FeatureSet extensions and can be used to seed +// feature resolution. The resolution with this object becomes a simple search +// for the closest matching edition, followed by proto merges. +message FeatureSetDefaults { + // A map from every known edition with a unique set of defaults to its + // defaults. Not all editions may be contained here. For a given edition, + // the defaults at the closest matching edition ordered at or before it should + // be used. This field must be in strict ascending order by edition. + message FeatureSetEditionDefault { + optional Edition edition = 3; + optional FeatureSet features = 2; + } + repeated FeatureSetEditionDefault defaults = 1; + + // The minimum supported edition (inclusive) when this was constructed. + // Editions before this will not have defaults. + optional Edition minimum_edition = 4; + + // The maximum known edition (inclusive) when this was constructed. Editions + // after this will not have reliable defaults. + optional Edition maximum_edition = 5; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition occurs. + // For example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to moo. + // // + // // Another line attached to moo. + // optional double moo = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to moo or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified object. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + + // Represents the identified object's effect on the element in the original + // .proto file. + enum Semantic { + // There is no effect or the effect is indescribable. + NONE = 0; + // The element is set or otherwise mutated. + SET = 1; + // An alias to the element is returned. + ALIAS = 2; + } + optional Semantic semantic = 5; + } +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/duration.proto b/collector/components/lightstepreceiver/proto/google/protobuf/duration.proto new file mode 100644 index 0000000..41f40c2 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/duration.proto @@ -0,0 +1,115 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/empty.proto b/collector/components/lightstepreceiver/proto/google/protobuf/empty.proto new file mode 100644 index 0000000..b87c89d --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/empty.proto @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/field_mask.proto b/collector/components/lightstepreceiver/proto/google/protobuf/field_mask.proto new file mode 100644 index 0000000..b28334b --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/source_context.proto b/collector/components/lightstepreceiver/proto/google/protobuf/source_context.proto new file mode 100644 index 0000000..135f50f --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/struct.proto b/collector/components/lightstepreceiver/proto/google/protobuf/struct.proto new file mode 100644 index 0000000..1bf0c1a --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of these +// variants. Absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/timestamp.proto b/collector/components/lightstepreceiver/proto/google/protobuf/timestamp.proto new file mode 100644 index 0000000..fd0bc07 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/timestamp.proto @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() +// ) to obtain a formatter capable of generating timestamps in this format. +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/type.proto b/collector/components/lightstepreceiver/proto/google/protobuf/type.proto new file mode 100644 index 0000000..48cb11e --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/type.proto @@ -0,0 +1,193 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/typepb"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 7; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + } + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 6; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; + // Syntax `editions`. + SYNTAX_EDITIONS = 2; +} diff --git a/collector/components/lightstepreceiver/proto/google/protobuf/wrappers.proto b/collector/components/lightstepreceiver/proto/google/protobuf/wrappers.proto new file mode 100644 index 0000000..1959fa5 --- /dev/null +++ b/collector/components/lightstepreceiver/proto/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} diff --git a/collector/components/lightstepreceiver/to_traces_test.go b/collector/components/lightstepreceiver/to_traces_test.go index e30c286..b5f19b5 100644 --- a/collector/components/lightstepreceiver/to_traces_test.go +++ b/collector/components/lightstepreceiver/to_traces_test.go @@ -379,7 +379,7 @@ func TestTimestampOffset(t *testing.T) { }, }, // Important parameter. - TimestampOffsetMicros: int32(offset.Microseconds()), + TimestampOffsetMicros: offset.Microseconds(), Spans: []*collectorpb.Span{ { OperationName: "span1", diff --git a/collector/components/lightstepreceiver/trace_receiver.go b/collector/components/lightstepreceiver/trace_receiver.go index 8621204..e02b1ee 100644 --- a/collector/components/lightstepreceiver/trace_receiver.go +++ b/collector/components/lightstepreceiver/trace_receiver.go @@ -12,7 +12,6 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/ptrace" @@ -20,6 +19,7 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb" + "google.golang.org/protobuf/proto" ) const ( @@ -35,6 +35,7 @@ type lightstepReceiver struct { shutdownWG sync.WaitGroup server *http.Server + listener net.Listener config *Config settings receiver.CreateSettings @@ -64,8 +65,7 @@ func (lr *lightstepReceiver) Start(ctx context.Context, host component.Host) err return err } - var listener net.Listener - listener, err = lr.config.HTTP.ToListener(ctx) + lr.listener, err = lr.config.HTTP.ToListener(ctx) if err != nil { return err } @@ -73,7 +73,7 @@ func (lr *lightstepReceiver) Start(ctx context.Context, host component.Host) err go func() { defer lr.shutdownWG.Done() - if errHTTP := lr.server.Serve(listener); !errors.Is(errHTTP, http.ErrServerClosed) && errHTTP != nil { + if errHTTP := lr.server.Serve(lr.listener); !errors.Is(errHTTP, http.ErrServerClosed) && errHTTP != nil { lr.settings.TelemetrySettings.ReportStatus(component.NewFatalErrorEvent(errHTTP)) } }() @@ -89,6 +89,9 @@ func (lr *lightstepReceiver) Shutdown(context.Context) error { if lr.server != nil { err = lr.server.Close() } + if lr.listener != nil { + _ = lr.listener.Close() + } lr.shutdownWG.Wait() return err } diff --git a/collector/components/lightstepreceiver/trace_receiver_test.go b/collector/components/lightstepreceiver/trace_receiver_test.go index 5d3f097..8e6c915 100644 --- a/collector/components/lightstepreceiver/trace_receiver_test.go +++ b/collector/components/lightstepreceiver/trace_receiver_test.go @@ -10,7 +10,6 @@ import ( "net/http" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" @@ -19,6 +18,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/receiver/receivertest" + "google.golang.org/protobuf/proto" "github.com/lightstep/sn-collector/collector/lightstepreceiver/internal/collectorpb" ) @@ -82,6 +82,8 @@ func TestReceiverPortAlreadyInUse(t *testing.T) { require.NoError(t, err, "Failed to create receiver: %v", err) err = traceReceiver.Start(context.Background(), componenttest.NewNopHost()) require.Error(t, err) + + t.Cleanup(func() { require.NoError(t, traceReceiver.Shutdown(context.Background())) }) } func TestSimpleRequest(t *testing.T) { @@ -110,6 +112,7 @@ func TestSimpleRequest(t *testing.T) { httpResp, err := client.Do(httpReq) require.NoError(t, err) require.Equal(t, httpResp.StatusCode, 202) + httpResp.Body.Close() traces := sink.AllTraces() assert.Equal(t, len(traces), 1) @@ -132,6 +135,8 @@ func TestSimpleRequest(t *testing.T) { span1.SetName("span1") return td }()) + + client.CloseIdleConnections() } func createHttpRequest(addr string, req *collectorpb.ReportRequest) (*http.Request, error) { From e14a4a4016eeadff70047249e46149a7f4120f32 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 11:11:23 -0700 Subject: [PATCH 11/14] reflect new name --- collector/components/lightstepreceiver/DESIGN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/components/lightstepreceiver/DESIGN.md b/collector/components/lightstepreceiver/DESIGN.md index c272b26..283bf6c 100644 --- a/collector/components/lightstepreceiver/DESIGN.md +++ b/collector/components/lightstepreceiver/DESIGN.md @@ -27,7 +27,7 @@ This receiver exposes *very* basic functionality, with only http/protobuf suppor ## TODO -* Implement OBSReport. +* Use `receiverhelper` mechanism for standard component observability signals. * Legacy tracers send payloads using the `application/octet-stream` content type and using the `/api/v2/reports` path. We don't check for it but worth verifying this (at least the content-type). From b359d4761da9b1143878ec1bfb753155915157d8 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Mon, 10 Jun 2024 11:12:35 -0700 Subject: [PATCH 12/14] re-format --- .../components/lightstepreceiver/generated_package_test.go | 3 ++- .../lightstepreceiver/internal/collectorpb/collector.pb.go | 5 +++-- .../internal/collectorpb/collector_grpc.pb.go | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/collector/components/lightstepreceiver/generated_package_test.go b/collector/components/lightstepreceiver/generated_package_test.go index 4589216..d4c9fc4 100644 --- a/collector/components/lightstepreceiver/generated_package_test.go +++ b/collector/components/lightstepreceiver/generated_package_test.go @@ -3,8 +3,9 @@ package lightstepreceiver import ( - "go.uber.org/goleak" "testing" + + "go.uber.org/goleak" ) func TestMain(m *testing.M) { diff --git a/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go index a836f67..a1899d4 100644 --- a/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go +++ b/collector/components/lightstepreceiver/internal/collectorpb/collector.pb.go @@ -7,12 +7,13 @@ package collectorpb import ( + reflect "reflect" + sync "sync" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( diff --git a/collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go b/collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go index a83a2d2..2aa5e1f 100644 --- a/collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go +++ b/collector/components/lightstepreceiver/internal/collectorpb/collector_grpc.pb.go @@ -8,6 +8,7 @@ package collectorpb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" From bfb44c2af10227b905351d5b9206eefed6a5ff21 Mon Sep 17 00:00:00 2001 From: Clay Smith Date: Mon, 10 Jun 2024 12:24:04 -0700 Subject: [PATCH 13/14] Fix yamllint errors, readme updates (#20) * fix linting errors * add receiver to readme --- .github/workflows/build.yml | 2 +- collector/config-k8s/mid-statefulset.yaml | 286 +++++++++++----------- readme.md | 1 + 3 files changed, 145 insertions(+), 144 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4c5dd8..770919b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - name: Install builder working-directory: ./collector run: | - go install go.opentelemetry.io/collector/cmd/builder@v0.97.0 + go install go.opentelemetry.io/collector/cmd/builder@v0.102.1 - name: Build working-directory: ./collector run: make build-linux diff --git a/collector/config-k8s/mid-statefulset.yaml b/collector/config-k8s/mid-statefulset.yaml index 1a8c27e..cd69e13 100644 --- a/collector/config-k8s/mid-statefulset.yaml +++ b/collector/config-k8s/mid-statefulset.yaml @@ -10,8 +10,8 @@ metadata: provider: ServiceNow spec: ports: - - port: 8097 - name: web + - port: 8097 + name: web type: ClusterIP selector: app: MIDServerManagement @@ -34,22 +34,22 @@ spec: deployment: servicenow-mid-statefulset provider: ServiceNow volumeClaimTemplates: - - metadata: - name: servicenow-mid-volumeclaim - namespace: servicenow - labels: - app: MIDServerManagement - deployment: servicenow-mid-statefulset - provider: ServiceNow - spec: - # works on Google Cloud - storageClassName: standard - accessModes: - - ReadWriteOnce - resources: - requests: - # Make sure to have enough disk space for the work, logs, extlib, scripts and other folders at the volume mounts below - storage: 1Gi + - metadata: + name: servicenow-mid-volumeclaim + namespace: servicenow + labels: + app: MIDServerManagement + deployment: servicenow-mid-statefulset + provider: ServiceNow + spec: + # works on Google Cloud + storageClassName: standard + accessModes: + - ReadWriteOnce + resources: + requests: + # Make sure to have enough disk space for the work, logs, extlib, scripts and other folders at the volume mounts below + storage: 1Gi template: metadata: labels: @@ -75,132 +75,132 @@ spec: # - name: containers: - - name: servicenow-mid-statefulset-container - # Put your image URL where Kubernetes can pull the image from, i.e. midcontainerregistry.azurecr.io/mid:tokyo-07-08-2022_04-07-2023_0200 - image: ghcr.io/lightstep/sn-collector/mid-experimental:main - imagePullPolicy: Always # other options: IfNotPresent, Never - ports: - - containerPort: 8097 - name: web - env: - # Define Environment variables - # You can put mid config parameter or wrapper config parameters here - # Env variable name for MID config parameter starts with MID_CONFIG_ followed by the config parameter name where a dot is replaced by double underscores. - # Env variable name for Wrapper config parameter starts with MID_WRAPPER_ followed by the wrapper parameter name where a dot is replaced by double underscores. - - # - name: MID_CONFIG_mid__log__level - # value: debug - - # Put the mid profile id here if you are deploying MID Servers linked to a profile - # https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/product/mid-server/concept/containerized-mid-deployment.html - # - name: MID_CONFIG_mid_profile_id - # value: - - # Set MID Server name. The default value is _NAMESPACE_HOSTNAME_ which is a place holder and will be replaced by the actual k8s namespace - # and hostname when the container starts for the first time. See more details in the init script of the recipe - # Hostnames in statefulset follows the pattern -0 , -1, etc. - - name: MID_CONFIG_name - value: _NAMESPACE_HOSTNAME_ - - # Put your instance URL here - - name: MID_CONFIG_url - value: https://__INSTANCE_NAME__.service-now.com - - # For instance authentication, you can choose either (A) basic auth or (B) mutual auth (mTLS) - # If using mTLS, you don't need to provide user name and password. The sensitive data such as password - # or mutual auth private certificate should be passed by using Kubernetes secrets - # https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/mid-server/concept/containerized-mid-deployment.html - - # Option A: using basic authentication - # 1. Create a file named with the content - # mid.instance.password= - # 2. Create a secret named - # kubectl create secret generic --from-file= - # is the location where the mid secret volume is mounted to container file system - - name: MID_CONFIG_mid__instance__username - value: __USERNAME__ - - name: MID_SECRETS_FILE - value: /etc/secrets/mid.properties - - # Option B: using mutual auth (mTLS) - # 1. Make sure you have the mutual auth certificate file named which need to import to the MID Server keystore - # 2. Create a secret named - # kubectl create secret generic --from-file= - # 3. Uncomment the 2 lines below. is the location where the mid mutual auth secret volume is mounted to the container file system. - # - name: MID_MUTUAL_AUTH_PEM_FILE - # value: / - - - name: MID_CONTAINER_DEPLOYMENT_NAME - value: servicenow-mid-statefulset - - name: MID_CONTAINER_DEPLOYMENT_NAMESPACE - value: servicenow - - # wrapper config parameters - - name: MID_WRAPPER_wrapper__java__maxmemory - value: '2024' - - # https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - resources: - requests: - cpu: '1' - memory: 2Gi - limits: - cpu: '1' - memory: 4Gi - - # https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks - # config.xml and other configuration files are backed up by the preStop hook - lifecycle: - preStop: - exec: - command: - - /bin/sh - - -c - - /opt/snc_mid_server/pre_stop.sh - - volumeMounts: - - mountPath: /etc/secrets - name: servicenow-mid-statefulset-mnt-shared-secr - readOnly: true - - # - mountPath: - # name: -mnt-shared-secr - # readOnly: true - - # https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath - # Share one volume for multiple uses in a single pod. The volumeMounts.subPath property specifies a sub-path inside the referenced volume instead of its root. - # MID Server application is installed in the /opt/snc_mid_server folder. Only subfolders which is not present or empty in the image can be mounted here. - - mountPath: /opt/snc_mid_server/mid_container - name: servicenow-mid-volumeclaim - subPath: mid_container - - mountPath: /opt/snc_mid_server/agent/extlib - name: servicenow-mid-volumeclaim - subPath: agent/extlib - - mountPath: /opt/snc_mid_server/agent/logs - name: servicenow-mid-volumeclaim - subPath: agent/logs - - mountPath: /opt/snc_mid_server/agent/scripts - name: servicenow-mid-volumeclaim - subPath: agent/scripts - - mountPath: /opt/snc_mid_server/agent/security - name: servicenow-mid-volumeclaim - subPath: agent/security - - mountPath: /opt/snc_mid_server/agent/security_backup - name: servicenow-mid-volumeclaim - subPath: agent/security_backup - - mountPath: /opt/snc_mid_server/agent/work - name: servicenow-mid-volumeclaim - subPath: agent/work + - name: servicenow-mid-statefulset-container + # Put your image URL where Kubernetes can pull the image from, i.e. midcontainerregistry.azurecr.io/mid:tokyo-07-08-2022_04-07-2023_0200 + image: ghcr.io/lightstep/sn-collector/mid-experimental:main + imagePullPolicy: Always # other options: IfNotPresent, Never + ports: + - containerPort: 8097 + name: web + env: + # Define Environment variables + # You can put mid config parameter or wrapper config parameters here + # Env variable name for MID config parameter starts with MID_CONFIG_ followed by the config parameter name where a dot is replaced by double underscores. + # Env variable name for Wrapper config parameter starts with MID_WRAPPER_ followed by the wrapper parameter name where a dot is replaced by double underscores. + + # - name: MID_CONFIG_mid__log__level + # value: debug + + # Put the mid profile id here if you are deploying MID Servers linked to a profile + # https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/product/mid-server/concept/containerized-mid-deployment.html + # - name: MID_CONFIG_mid_profile_id + # value: + + # Set MID Server name. The default value is _NAMESPACE_HOSTNAME_ which is a place holder and will be replaced by the actual k8s namespace + # and hostname when the container starts for the first time. See more details in the init script of the recipe + # Hostnames in statefulset follows the pattern -0 , -1, etc. + - name: MID_CONFIG_name + value: _NAMESPACE_HOSTNAME_ + + # Put your instance URL here + - name: MID_CONFIG_url + value: https://__INSTANCE_NAME__.service-now.com + + # For instance authentication, you can choose either (A) basic auth or (B) mutual auth (mTLS) + # If using mTLS, you don't need to provide user name and password. The sensitive data such as password + # or mutual auth private certificate should be passed by using Kubernetes secrets + # https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/mid-server/concept/containerized-mid-deployment.html + + # Option A: using basic authentication + # 1. Create a file named with the content + # mid.instance.password= + # 2. Create a secret named + # kubectl create secret generic --from-file= + # is the location where the mid secret volume is mounted to container file system + - name: MID_CONFIG_mid__instance__username + value: __USERNAME__ + - name: MID_SECRETS_FILE + value: /etc/secrets/mid.properties + + # Option B: using mutual auth (mTLS) + # 1. Make sure you have the mutual auth certificate file named which need to import to the MID Server keystore + # 2. Create a secret named + # kubectl create secret generic --from-file= + # 3. Uncomment the 2 lines below. is the location where the mid mutual auth secret volume is mounted to the container file system. + # - name: MID_MUTUAL_AUTH_PEM_FILE + # value: / + + - name: MID_CONTAINER_DEPLOYMENT_NAME + value: servicenow-mid-statefulset + - name: MID_CONTAINER_DEPLOYMENT_NAMESPACE + value: servicenow + + # wrapper config parameters + - name: MID_WRAPPER_wrapper__java__maxmemory + value: '2024' + + # https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + resources: + requests: + cpu: '1' + memory: 2Gi + limits: + cpu: '1' + memory: 4Gi + + # https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks + # config.xml and other configuration files are backed up by the preStop hook + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -c + - /opt/snc_mid_server/pre_stop.sh + + volumeMounts: + - mountPath: /etc/secrets + name: servicenow-mid-statefulset-mnt-shared-secr + readOnly: true + + # - mountPath: + # name: -mnt-shared-secr + # readOnly: true + + # https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath + # Share one volume for multiple uses in a single pod. The volumeMounts.subPath property specifies a sub-path inside the referenced volume instead of its root. + # MID Server application is installed in the /opt/snc_mid_server folder. Only subfolders which is not present or empty in the image can be mounted here. + - mountPath: /opt/snc_mid_server/mid_container + name: servicenow-mid-volumeclaim + subPath: mid_container + - mountPath: /opt/snc_mid_server/agent/extlib + name: servicenow-mid-volumeclaim + subPath: agent/extlib + - mountPath: /opt/snc_mid_server/agent/logs + name: servicenow-mid-volumeclaim + subPath: agent/logs + - mountPath: /opt/snc_mid_server/agent/scripts + name: servicenow-mid-volumeclaim + subPath: agent/scripts + - mountPath: /opt/snc_mid_server/agent/security + name: servicenow-mid-volumeclaim + subPath: agent/security + - mountPath: /opt/snc_mid_server/agent/security_backup + name: servicenow-mid-volumeclaim + subPath: agent/security_backup + - mountPath: /opt/snc_mid_server/agent/work + name: servicenow-mid-volumeclaim + subPath: agent/work serviceAccountName: default # Specify volumes for basic auth secret or mutual auth secret volumes: - - name: servicenow-mid-statefulset-mnt-shared-secr - projected: - sources: - # Option A: Using basic auth - - secret: - name: servicenow-mid-secret - # Option B: Using mutual auth - # - secret: - # name: + - name: servicenow-mid-statefulset-mnt-shared-secr + projected: + sources: + # Option A: Using basic auth + - secret: + name: servicenow-mid-secret + # Option B: Using mutual auth + # - secret: + # name: diff --git a/readme.md b/readme.md index b4c87c8..f49f6d4 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,7 @@ The following tables represent the supported components of the ServiceNow Collec | k8sobjects | [contrib][1] | | k8scluster | [contrib][1] | | kubeletstats | [contrib][1] | +| `lightstepreceiver` | under development | | filelog | [contrib][1] | | httpcheck | [contrib][1] | | `azuremonitor`* | [contrib][1] | From b2a6fd737b0bd51202e013abdaac6271908afcf4 Mon Sep 17 00:00:00 2001 From: Nathan Slaughter <28688390+nslaughter@users.noreply.github.com> Date: Tue, 11 Jun 2024 13:41:24 -0500 Subject: [PATCH 14/14] azeventhubreceiver copy 2024-06-11 --- .../components/azureeventhubreceiver/Makefile | 1 + .../azureeventhubreceiver/README.md | 125 ++++++ .../azureeventprocessor.go | 190 +++++++++ .../azureresourcelogs_unmarshaler.go | 36 ++ .../azureresourcemetrics_unmarshaler.go | 160 ++++++++ .../azureeventhubreceiver/config.go | 64 ++++ .../azureeventhubreceiver/config_test.go | 73 ++++ .../components/azureeventhubreceiver/doc.go | 7 + .../azureeventhubreceiver/eventhubhandler.go | 312 +++++++++++++++ .../eventhubhandler_test.go | 134 +++++++ .../azureeventhubreceiver/factory.go | 132 +++++++ .../azureeventhubreceiver/factory_test.go | 40 ++ .../generated_component_test.go | 83 ++++ .../components/azureeventhubreceiver/go.mod | 125 ++++++ .../components/azureeventhubreceiver/go.sum | 359 ++++++++++++++++++ .../internal/metadata/generated_status.go | 26 ++ .../azureeventhubreceiver/metadata.yaml | 13 + .../azureeventhubreceiver/persister.go | 42 ++ .../azureeventhubreceiver/persister_test.go | 102 +++++ .../rawlogs_unmarshaler.go | 77 ++++ .../azureeventhubreceiver/receiver.go | 161 ++++++++ .../testdata/config.yaml | 22 ++ .../testdata/log-maximum.json | 31 ++ .../testdata/log-minimum-2.json | 16 + .../testdata/log-minimum.json | 10 + 25 files changed, 2341 insertions(+) create mode 100644 collector/components/azureeventhubreceiver/Makefile create mode 100644 collector/components/azureeventhubreceiver/README.md create mode 100644 collector/components/azureeventhubreceiver/azureeventprocessor.go create mode 100644 collector/components/azureeventhubreceiver/azureresourcelogs_unmarshaler.go create mode 100644 collector/components/azureeventhubreceiver/azureresourcemetrics_unmarshaler.go create mode 100644 collector/components/azureeventhubreceiver/config.go create mode 100644 collector/components/azureeventhubreceiver/config_test.go create mode 100644 collector/components/azureeventhubreceiver/doc.go create mode 100644 collector/components/azureeventhubreceiver/eventhubhandler.go create mode 100644 collector/components/azureeventhubreceiver/eventhubhandler_test.go create mode 100644 collector/components/azureeventhubreceiver/factory.go create mode 100644 collector/components/azureeventhubreceiver/factory_test.go create mode 100644 collector/components/azureeventhubreceiver/generated_component_test.go create mode 100644 collector/components/azureeventhubreceiver/go.mod create mode 100644 collector/components/azureeventhubreceiver/go.sum create mode 100644 collector/components/azureeventhubreceiver/internal/metadata/generated_status.go create mode 100644 collector/components/azureeventhubreceiver/metadata.yaml create mode 100644 collector/components/azureeventhubreceiver/persister.go create mode 100644 collector/components/azureeventhubreceiver/persister_test.go create mode 100644 collector/components/azureeventhubreceiver/rawlogs_unmarshaler.go create mode 100644 collector/components/azureeventhubreceiver/receiver.go create mode 100644 collector/components/azureeventhubreceiver/testdata/config.yaml create mode 100644 collector/components/azureeventhubreceiver/testdata/log-maximum.json create mode 100644 collector/components/azureeventhubreceiver/testdata/log-minimum-2.json create mode 100644 collector/components/azureeventhubreceiver/testdata/log-minimum.json diff --git a/collector/components/azureeventhubreceiver/Makefile b/collector/components/azureeventhubreceiver/Makefile new file mode 100644 index 0000000..ded7a36 --- /dev/null +++ b/collector/components/azureeventhubreceiver/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/collector/components/azureeventhubreceiver/README.md b/collector/components/azureeventhubreceiver/README.md new file mode 100644 index 0000000..a8e1bfc --- /dev/null +++ b/collector/components/azureeventhubreceiver/README.md @@ -0,0 +1,125 @@ +# Azure Event Hub Receiver + + +| Status | | +| ------------- |-----------| +| Stability | [alpha]: metrics, logs | +| Distributions | [contrib], [observiq], [splunk], [sumo] | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fazureeventhub%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fazureeventhub) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fazureeventhub%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fazureeventhub) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@atoulme](https://www.github.com/atoulme), [@djaglowski](https://www.github.com/djaglowski) | + +[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha +[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib +[observiq]: https://github.com/observIQ/observiq-otel-collector +[splunk]: https://github.com/signalfx/splunk-otel-collector +[sumo]: https://github.com/SumoLogic/sumologic-otel-collector + + +## Overview +Azure resources and services can be +[configured](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings) +to send their logs to an Azure Event Hub. The Azure Event Hub receiver pulls logs from an Azure +Event Hub, transforms them, and pushes them through the collector pipeline. + +## Configuration + +### connection (Required) +A string describing the connection to an Azure event hub. + +### group (Optional) +The Consumer Group to read from. If empty will default to the default Consumer Group $Default + +### partition (Optional) +The partition to watch. If empty, it will watch explicitly all partitions. + +Default: "" + +### offset (Optional) +The offset at which to start watching the event hub. If empty, it starts with the latest offset. + +Default: "" + +### format (Optional) +Determines how to transform the Event Hub messages into OpenTelemetry logs. See the "Format" +section below for details. + +Default: "azure" + +### Example Configuration + +```yaml +receivers: + azureeventhub: + connection: Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234=;EntityPath=hubName + partition: foo + group: bar + offset: "1234-5566" + format: "azure" +``` + +This component can persist its state using the [storage extension]. + +## Format + +### raw + +The "raw" format maps the AMQP properties and data into the +attributes and body of an OpenTelemetry LogRecord, respectively. +The body is represented as a raw byte array. + +This format is not supported for Metrics. + +### azure + +The "azure" format extracts the Azure log records from the AMQP +message data, parses them, and maps the fields to OpenTelemetry +attributes. The table below summarizes the mapping between the +[Azure common log format](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/resource-logs-schema) +and the OpenTelemetry attributes. + + +| Azure | OpenTelemetry | +|----------------------------------|----------------------------------------| +| callerIpAddress (optional) | net.sock.peer.addr (attribute) | +| correlationId (optional) | azure.correlation.id (attribute) | +| category (optional) | azure.category (attribute) | +| durationMs (optional) | azure.duration (attribute) | +| Level (optional) | severity_number, severity_text (field) | +| location (optional) | cloud.region (attribute) | +| — | cloud.provider (attribute) | +| operationName (required) | azure.operation.name (attribute) | +| operationVersion (optional) | azure.operation.version (attribute) | +| properties (optional) | azure.properties (attribute, nested) | +| resourceId (required) | azure.resource.id (resource attribute) | +| resultDescription (optional) | azure.result.description (attribute) | +| resultSignature (optional) | azure.result.signature (attribute) | +| resultType (optional) | azure.result.type (attribute) | +| tenantId (required, tenant logs) | azure.tenant.id (attribute) | +| time or timeStamp (required) | time_unix_nano (time takes precedence) | +| identity (optional) | azure.identity (attribute, nested) | + +Notes: +* JSON does not distinguish between fixed and floating point numbers. All +JSON numbers are encoded as doubles. + +For Metrics the Azure Metric Records are an array +of "records" with the following fields. + +| Azure | Open Telemetry | +|------------|---------------------------------------------| +| time | time_unix_nano (field) | +| resourceId | azure.resource.id (resource attribute) | +| metricName | | +| timeGrain | start_time_unix_nano (field) | +| total | mapped to datapoint metricName + "_TOTAL" | +| count | mapped to datapoint metricName + "_COUNT" | +| minimum | mapped to datapoint metricName + "_MINIMUM" | +| maximum | mapped to datapoint metricName + "_MAXIMUM" | +| average | mapped to datapoint metricName + "_AVERAGE" | + +From this data a Metric of type Gauge is created +with a Data Points that represents the values +for the Metric including: Total, Minimum, Maximum, +Average and Count. + +[storage extension]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/storage diff --git a/collector/components/azureeventhubreceiver/azureeventprocessor.go b/collector/components/azureeventhubreceiver/azureeventprocessor.go new file mode 100644 index 0000000..b514673 --- /dev/null +++ b/collector/components/azureeventhubreceiver/azureeventprocessor.go @@ -0,0 +1,190 @@ +package azureeventhubreceiver + +// https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/messaging/azeventhubs/processor.go +// https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/messaging/azeventhubs/processor_partition_client.go + +/* +>> https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/messaging/azeventhubs/example_consuming_with_checkpoints_test.go + - get a processor + - dispatchPartitionClients + - processor.Run + + + +>> https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/messaging/azeventhubs/example_consuming_events_test.go + - ReceiveEvents(ctx, count int, options *ReceiveEventsOptions) ([]*ReceivedEventData, error) + - call cancel() + - panic if there's an error that isn't context.DeadlineExceeded + - process events + --> put them into the entity thingy +*/ + +// import ( +// "context" +// "errors" +// "fmt" +// "time" + +// "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" +// "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/checkpoints" +// "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container" +// ) + +// // Assuming there's a struct managing the processor setup +// // type EventHubProcessor struct { +// // Processor *azeventhubs.Processor +// // } + +// // Updated initialization function using the new SDK components +// func NewEventHubProcessor(ehConn, ehName, storageConn, storageCnt string) (*EventHubProcessor, error) { +// checkpointingProcessor, err := newCheckpointingProcessor(ehConn, ehName, storageConn, storageCnt) +// if err != nil { +// return nil, fmt.Errorf("failed to create checkpointing processor: %w", err) +// } + +// // Start processing events +// return &EventHubProcessor{ +// Processor: checkpointingProcessor, +// }, nil +// } + +// // Assume there's a function to start processing events +// func (e *EventHubProcessor) StartProcessing(ctx context.Context) error { +// // Start the processor +// if err := e.Processor.Run(ctx); err != nil { +// return fmt.Errorf("error running processor: %w", err) +// } +// return nil +// } + +// // Assuming there's a struct managing the processor setup +// type EventHubProcessor struct { +// Processor *azeventhubs.Processor +// } + +// // These are config values the processor factory can use to create processors: +// // +// // (a) EventHubConnectionString +// // (b) EventHubName +// // (c) StorageConnectionString +// // (d) StorageContainerName +// // +// // You always need the EventHub variable values. +// // And you need all 4 of these to checkpoint. +// // +// // I think the config values should be managed in the factory struct. +// /* +// func (pf *processorFactory) CreateProcessor() (*azeventhubs.Processor, error) { +// // Create the consumer client +// consumerClient, err := azeventhubs.NewConsumerClientFromConnectionString(pf.EventHubConnectionString, pf.EventHubName, azeventhubs.DefaultConsumerGroup, nil) +// if err != nil { +// return nil, err +// } + +// // Create the blob container client for the checkpoint store +// blobContainerClient, err := container.NewClientFromConnectionString(pf.StorageConnectionString, pf.StorageContainerName, nil) +// if err != nil { +// return nil, err +// } + +// // Create the checkpoint store using the blob container client +// checkpointStore, err := azeventhubs.NewBlobCheckpointStore(blobContainerClient, nil) +// // checkpointStore, err := azeventhubs.NewBlobCheckpointStore(blobContainerClient, nil) +// // if err != nil { +// // return nil, err +// // } + +// // Create the processor with checkpointing +// processor, err := azeventhubs.NewProcessor(consumerClient, checkpointStore, nil) +// if err != nil { +// return nil, err +// } + +// return processor, nil +// } +// */ + +// // checkpointing processor should be auth aware + +// func newCheckpointingProcessor(eventHubConnectionString, eventHubName, storageConnectionString, storageContainerName string) (*azeventhubs.Processor, error) { +// blobContainerClient, err := container.NewClientFromConnectionString(storageConnectionString, storageContainerName, nil) +// if err != nil { +// return nil, err +// } +// checkpointStore, err := checkpoints.NewBlobStore(blobContainerClient, nil) +// if err != nil { +// return nil, err +// } + +// consumerClient, err := azeventhubs.NewConsumerClientFromConnectionString(eventHubConnectionString, eventHubName, azeventhubs.DefaultConsumerGroup, nil) +// if err != nil { +// return nil, err +// } + +// return azeventhubs.NewProcessor(consumerClient, checkpointStore, nil) +// } +/* +func dispatchPartitionClients(processor *azeventhubs.Processor) { + for { + processorPartitionClient := processor.NextPartitionClient(context.TODO()) + if processorPartitionClient == nil { + break + } + + go func() { + if err := processEventsForPartition(processorPartitionClient); err != nil { + panic(err) + } + }() + } +} + +func processEventsForPartition(partitionClient *azeventhubs.ProcessorPartitionClient) error { + defer shutdownPartitionResources(partitionClient) + if err := initializePartitionResources(partitionClient.PartitionID()); err != nil { + return err + } + + for { + receiveCtx, cancelReceive := context.WithTimeout(context.TODO(), time.Minute) + events, err := partitionClient.ReceiveEvents(receiveCtx, 100, nil) + cancelReceive() + + if err != nil && !errors.Is(err, context.DeadlineExceeded) { + return err + } + if len(events) == 0 { + continue + } + + if err := processEvents(events, partitionClient); err != nil { + return err + } + + if err := partitionClient.UpdateCheckpoint(context.TODO(), events[len(events)-1], nil); err != nil { + return err + } + } +} + +func shutdownPartitionResources(partitionClient *azeventhubs.ProcessorPartitionClient) { + if err := partitionClient.Close(context.TODO()); err != nil { + panic(err) + } +} + +func initializePartitionResources(partitionID string) error { + fmt.Printf("Initializing resources for partition %s\n", partitionID) + return nil +} + +// This is very much like the old processEvents function +func processEvents(events []*azeventhubs.ReceivedEventData, partitionClient *azeventhubs.ProcessorPartitionClient) error { + for _, event := range events { + + + // fmt.Printf("Processing event: %v\n", event.EventData()) + } + return nil +} +*/ diff --git a/collector/components/azureeventhubreceiver/azureresourcelogs_unmarshaler.go b/collector/components/azureeventhubreceiver/azureresourcelogs_unmarshaler.go new file mode 100644 index 0000000..783d672 --- /dev/null +++ b/collector/components/azureeventhubreceiver/azureresourcelogs_unmarshaler.go @@ -0,0 +1,36 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/plog" + "go.uber.org/zap" + + "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure" +) + +type AzureResourceLogsEventUnmarshaler struct { + unmarshaler *azure.ResourceLogsUnmarshaler +} + +func newAzureResourceLogsUnmarshaler(buildInfo component.BuildInfo, logger *zap.Logger) eventLogsUnmarshaler { + return AzureResourceLogsEventUnmarshaler{ + unmarshaler: &azure.ResourceLogsUnmarshaler{ + Version: buildInfo.Version, + Logger: logger, + }, + } +} + +// UnmarshalLogs takes a byte array containing a JSON-encoded +// payload with Azure log records and transforms it into +// an OpenTelemetry plog.Logs object. The data in the Azure +// log record appears as fields and attributes in the +// OpenTelemetry representation; the bodies of the +// OpenTelemetry log records are empty. +func (r AzureResourceLogsEventUnmarshaler) UnmarshalLogs(event *azeventhubs.ReceivedEventData) (plog.Logs, error) { + return r.unmarshaler.UnmarshalLogs(event.Body) +} diff --git a/collector/components/azureeventhubreceiver/azureresourcemetrics_unmarshaler.go b/collector/components/azureeventhubreceiver/azureresourcemetrics_unmarshaler.go new file mode 100644 index 0000000..2e739d1 --- /dev/null +++ b/collector/components/azureeventhubreceiver/azureresourcemetrics_unmarshaler.go @@ -0,0 +1,160 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "bytes" + "fmt" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" + jsoniter "github.com/json-iterator/go" + "github.com/relvacode/iso8601" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" + conventions "go.opentelemetry.io/collector/semconv/v1.13.0" + "go.uber.org/zap" +) + +const ( + azureResourceID = "azure.resource.id" + scopeName = "otelcol/azureresourcemetrics" +) + +type azureResourceMetricsUnmarshaler struct { + buildInfo component.BuildInfo + logger *zap.Logger +} + +// azureMetricRecords represents an array of Azure metric records +// as exported via an Azure Event Hub +type azureMetricRecords struct { + Records []azureMetricRecord `json:"records"` +} + +// azureMetricRecord represents a single Azure Metric following +// the common schema does not exist (yet): +type azureMetricRecord struct { + Time string `json:"time"` + ResourceID string `json:"resourceId"` + MetricName string `json:"metricName"` + TimeGrain string `json:"timeGrain"` + Total float64 `json:"total"` + Count float64 `json:"count"` + Minimum float64 `json:"minimum"` + Maximum float64 `json:"maximum"` + Average float64 `json:"average"` +} + +func newAzureResourceMetricsUnmarshaler(buildInfo component.BuildInfo, logger *zap.Logger) azureResourceMetricsUnmarshaler { + return azureResourceMetricsUnmarshaler{ + buildInfo: buildInfo, + logger: logger, + } +} + +// UnmarshalMetrics takes a byte array containing a JSON-encoded +// payload with Azure metric records and transforms it into +// an OpenTelemetry pmetric.Metrics object. The data in the Azure +// metric record appears as fields and attributes in the +// OpenTelemetry representation; +func (r azureResourceMetricsUnmarshaler) UnmarshalMetrics(event *azeventhubs.ReceivedEventData) (pmetric.Metrics, error) { + + md := pmetric.NewMetrics() + + var azureMetrics azureMetricRecords + decoder := jsoniter.NewDecoder(bytes.NewReader(event.EventData.Body)) + err := decoder.Decode(&azureMetrics) + if err != nil { + return md, err + } + + resourceMetrics := md.ResourceMetrics().AppendEmpty() + resource := resourceMetrics.Resource() + resource.Attributes().PutStr(conventions.AttributeTelemetrySDKName, receiverScopeName) + resource.Attributes().PutStr(conventions.AttributeTelemetrySDKLanguage, conventions.AttributeTelemetrySDKLanguageGo) + resource.Attributes().PutStr(conventions.AttributeTelemetrySDKVersion, r.buildInfo.Version) + resource.Attributes().PutStr(conventions.AttributeCloudProvider, conventions.AttributeCloudProviderAzure) + + scopeMetrics := resourceMetrics.ScopeMetrics().AppendEmpty() + + metrics := scopeMetrics.Metrics() + metrics.EnsureCapacity(len(azureMetrics.Records) * 5) + + resourceID := "" + for _, azureMetric := range azureMetrics.Records { + if resourceID == "" && azureMetric.ResourceID != "" { + resourceID = azureMetric.ResourceID + } + + nanos, err := asTimestamp(azureMetric.Time) + if err != nil { + r.logger.Warn("Invalid Timestamp", zap.String("time", azureMetric.Time)) + continue + } + + var startTimestamp pcommon.Timestamp + if azureMetric.TimeGrain == "PT1M" { + startTimestamp = pcommon.NewTimestampFromTime(nanos.AsTime().Add(-time.Minute)) + } else { + r.logger.Warn("Unhandled Time Grain", zap.String("timegrain", azureMetric.TimeGrain)) + continue + } + + metricTotal := metrics.AppendEmpty() + metricTotal.SetName(strings.ToLower(fmt.Sprintf("%s_%s", strings.ReplaceAll(azureMetric.MetricName, " ", "_"), "Total"))) + dpTotal := metricTotal.SetEmptyGauge().DataPoints().AppendEmpty() + dpTotal.SetStartTimestamp(startTimestamp) + dpTotal.SetTimestamp(nanos) + dpTotal.SetDoubleValue(azureMetric.Total) + + metricCount := metrics.AppendEmpty() + metricCount.SetName(strings.ToLower(fmt.Sprintf("%s_%s", strings.ReplaceAll(azureMetric.MetricName, " ", "_"), "Count"))) + dpCount := metricCount.SetEmptyGauge().DataPoints().AppendEmpty() + dpCount.SetStartTimestamp(startTimestamp) + dpCount.SetTimestamp(nanos) + dpCount.SetDoubleValue(azureMetric.Count) + + metricMin := metrics.AppendEmpty() + metricMin.SetName(strings.ToLower(fmt.Sprintf("%s_%s", strings.ReplaceAll(azureMetric.MetricName, " ", "_"), "Minimum"))) + dpMin := metricMin.SetEmptyGauge().DataPoints().AppendEmpty() + dpMin.SetStartTimestamp(startTimestamp) + dpMin.SetTimestamp(nanos) + dpMin.SetDoubleValue(azureMetric.Minimum) + + metricMax := metrics.AppendEmpty() + metricMax.SetName(strings.ToLower(fmt.Sprintf("%s_%s", strings.ReplaceAll(azureMetric.MetricName, " ", "_"), "Maximum"))) + dpMax := metricMax.SetEmptyGauge().DataPoints().AppendEmpty() + dpMax.SetStartTimestamp(startTimestamp) + dpMax.SetTimestamp(nanos) + dpMax.SetDoubleValue(azureMetric.Maximum) + + metricAverage := metrics.AppendEmpty() + metricAverage.SetName(strings.ToLower(fmt.Sprintf("%s_%s", strings.ReplaceAll(azureMetric.MetricName, " ", "_"), "Average"))) + dpAverage := metricAverage.SetEmptyGauge().DataPoints().AppendEmpty() + dpAverage.SetStartTimestamp(startTimestamp) + dpAverage.SetTimestamp(nanos) + dpAverage.SetDoubleValue(azureMetric.Average) + } + + if resourceID != "" { + resourceMetrics.Resource().Attributes().PutStr(azureResourceID, resourceID) + } else { + r.logger.Warn("No ResourceID Set on Metrics!") + } + + return md, nil +} + +// asTimestamp will parse an ISO8601 string into an OpenTelemetry nanosecond timestamp. +// If the string cannot be parsed, it will return zero and the error. +func asTimestamp(s string) (pcommon.Timestamp, error) { + t, err := iso8601.ParseString(s) + if err != nil { + return 0, err + } + return pcommon.Timestamp(t.UnixNano()), nil +} diff --git a/collector/components/azureeventhubreceiver/config.go b/collector/components/azureeventhubreceiver/config.go new file mode 100644 index 0000000..7133dd7 --- /dev/null +++ b/collector/components/azureeventhubreceiver/config.go @@ -0,0 +1,64 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "errors" + "fmt" + + "github.com/Azure/azure-amqp-common-go/v4/conn" + "go.opentelemetry.io/collector/component" +) + +type logFormat string + +const ( + defaultLogFormat logFormat = "" + rawLogFormat logFormat = "raw" + azureLogFormat logFormat = "azure" +) + +var ( + validFormats = []logFormat{defaultLogFormat, rawLogFormat, azureLogFormat} + errMissingConnection = errors.New("missing connection") +) + +type Config struct { + Connection string `mapstructure:"connection"` + EventHubName string `mapstructure:"eventhub"` + Partition string `mapstructure:"partition"` + Offset string `mapstructure:"offset"` + // + StorageID *component.ID `mapstructure:"storage"` + StorageConnection string `mapstructure:"storage_connection"` + StorageContainer string `mapstructure:"storage_container"` + // + Format string `mapstructure:"format"` + ConsumerGroup string `mapstructure:"group"` + BatchDelay string `mapstructure:"batch_delay"` + BatchCount int `mapstructure:"batch_count"` +} + +func isValidFormat(format string) bool { + for _, validFormat := range validFormats { + if logFormat(format) == validFormat { + return true + } + } + return false +} + +// Validate config +func (config *Config) Validate() error { + if config.Connection == "" { + return errMissingConnection + } + if _, err := conn.ParsedConnectionFromStr(config.Connection); err != nil { + return err + } + if !isValidFormat(config.Format) { + return fmt.Errorf("invalid format; must be one of %#v", validFormats) + } + return nil +} diff --git a/collector/components/azureeventhubreceiver/config_test.go b/collector/components/azureeventhubreceiver/config_test.go new file mode 100644 index 0000000..7d4dcf4 --- /dev/null +++ b/collector/components/azureeventhubreceiver/config_test.go @@ -0,0 +1,73 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/otelcol/otelcoltest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver/internal/metadata" +) + +func TestLoadConfig(t *testing.T) { + factories, err := otelcoltest.NopFactories() + assert.NoError(t, err) + + factory := NewFactory() + factories.Receivers[metadata.Type] = factory + cfg, err := otelcoltest.LoadConfigAndValidate(filepath.Join("testdata", "config.yaml"), factories) + + require.NoError(t, err) + require.NotNil(t, cfg) + + assert.Equal(t, len(cfg.Receivers), 2) + + r0 := cfg.Receivers[component.NewID(metadata.Type)] + assert.Equal(t, "Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234=;EntityPath=hubName", r0.(*Config).Connection) + assert.Equal(t, "", r0.(*Config).Offset) + assert.Equal(t, "", r0.(*Config).Partition) + assert.Equal(t, defaultLogFormat, logFormat(r0.(*Config).Format)) + + r1 := cfg.Receivers[component.NewIDWithName(metadata.Type, "all")] + assert.Equal(t, "Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234=;EntityPath=hubName", r1.(*Config).Connection) + assert.Equal(t, "1234-5566", r1.(*Config).Offset) + assert.Equal(t, "foo", r1.(*Config).Partition) + assert.Equal(t, rawLogFormat, logFormat(r1.(*Config).Format)) +} + +func TestMissingConnection(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + err := component.ValidateConfig(cfg) + assert.EqualError(t, err, "missing connection") +} + +func TestInvalidConnectionString(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*Config).Connection = "foo" + err := component.ValidateConfig(cfg) + assert.EqualError(t, err, "failed parsing connection string due to unmatched key value separated by '='") +} + +func TestIsValidFormat(t *testing.T) { + for _, format := range []logFormat{defaultLogFormat, rawLogFormat, azureLogFormat} { + assert.True(t, isValidFormat(string(format))) + } + assert.False(t, isValidFormat("invalid-format")) +} + +func TestInvalidFormat(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*Config).Connection = "Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234=;EntityPath=hubName" + cfg.(*Config).Format = "invalid" + err := component.ValidateConfig(cfg) + assert.ErrorContains(t, err, "invalid format; must be one of") +} diff --git a/collector/components/azureeventhubreceiver/doc.go b/collector/components/azureeventhubreceiver/doc.go new file mode 100644 index 0000000..c00414c --- /dev/null +++ b/collector/components/azureeventhubreceiver/doc.go @@ -0,0 +1,7 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml + +// Package azureeventhubreceiver listens to logs emitted by Azure Event hubs. +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" diff --git a/collector/components/azureeventhubreceiver/eventhubhandler.go b/collector/components/azureeventhubreceiver/eventhubhandler.go new file mode 100644 index 0000000..061cebc --- /dev/null +++ b/collector/components/azureeventhubreceiver/eventhubhandler.go @@ -0,0 +1,312 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "context" + "errors" + "strings" + "sync" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" + "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/checkpoints" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/receiver" + "go.uber.org/zap" +) + +type eventHandler interface { + run(ctx context.Context, host component.Host) error + close(ctx context.Context) error + setDataConsumer(dataConsumer dataConsumer) +} + +type consumerClientWrapper interface { + GetEventHubProperties(ctx context.Context, options *azeventhubs.GetEventHubPropertiesOptions) (azeventhubs.EventHubProperties, error) + GetPartitionProperties(ctx context.Context, partitionID string, options *azeventhubs.GetPartitionPropertiesOptions) (azeventhubs.PartitionProperties, error) + NewConsumer(ctx context.Context, options *azeventhubs.ConsumerClientOptions) (*azeventhubs.ConsumerClient, error) + NewPartitionClient(partitionID string, options *azeventhubs.PartitionClientOptions) (*azeventhubs.PartitionClient, error) + Close(ctx context.Context) error +} + +type consumerClientWrapperImpl struct { + consumerClient *azeventhubs.ConsumerClient +} + +func newConsumerClientWrapperImplementation(cfg *Config) (*consumerClientWrapperImpl, error) { + consumerClient, err := azeventhubs.NewConsumerClientFromConnectionString(cfg.Connection, cfg.EventHubName, cfg.ConsumerGroup, nil) + if err != nil { + return nil, err + } + return &consumerClientWrapperImpl{ + consumerClient: consumerClient, + }, nil +} + +func (c *consumerClientWrapperImpl) GetEventHubProperties(ctx context.Context, options *azeventhubs.GetEventHubPropertiesOptions) (azeventhubs.EventHubProperties, error) { + return c.consumerClient.GetEventHubProperties(ctx, options) +} + +func (c *consumerClientWrapperImpl) GetPartitionProperties(ctx context.Context, partitionID string, options *azeventhubs.GetPartitionPropertiesOptions) (azeventhubs.PartitionProperties, error) { + return c.consumerClient.GetPartitionProperties(ctx, partitionID, options) +} + +func (c *consumerClientWrapperImpl) NewConsumer(ctx context.Context, options *azeventhubs.ConsumerClientOptions) (*azeventhubs.ConsumerClient, error) { + return c.consumerClient, nil +} + +func (c *consumerClientWrapperImpl) NewPartitionClient(partitionID string, options *azeventhubs.PartitionClientOptions) (*azeventhubs.PartitionClient, error) { + return c.consumerClient.NewPartitionClient(partitionID, options) +} + +func (c *consumerClientWrapperImpl) Close(ctx context.Context) error { + return c.consumerClient.Close(ctx) +} + +// type processorHandler struct { +// processor *azeventhubs.Processor +// dataConsumer dataConsumer +// config *Config +// settings receiver.CreateSettings +// cancel context.CancelFunc +// } + +type eventhubHandler struct { + processor *azeventhubs.Processor + consumerClient consumerClientWrapper + dataConsumer dataConsumer + config *Config + settings receiver.CreateSettings + cancel context.CancelFunc + useProcessor bool +} + +var _ eventHandler = (*eventhubHandler)(nil) + +// newEventhubHandler creates a handler for Azure Event Hub. This version is enhanced to handle mock configurations for testing. +func newEventhubHandler(config *Config, settings receiver.CreateSettings) *eventhubHandler { + // Check if the configuration is meant for testing. This can be done by checking a specific field or a pattern in the connection string. + if strings.Contains(config.Connection, "fake.servicebus.windows.net") { + return nil + // Return a mock handler if the connection string is empty or obviously fake. + // return newMockEventhubHandler() + // return newMockEventhubHandler(config, settings) + } + + return &eventhubHandler{ + config: config, + settings: settings, + useProcessor: false, + } +} + +func (h *eventhubHandler) init(ctx context.Context) error { + _, h.cancel = context.WithCancel(ctx) + consumerClient, err := newConsumerClientWrapperImplementation(h.config) + if err != nil { + return err + } + h.consumerClient = consumerClient + return nil +} + +func (h *eventhubHandler) run(ctx context.Context, host component.Host) error { + if h.useProcessor { + return h.runWithProcessor(ctx) + } + return h.runWithConsumerClient(ctx, host) +} + +func (h *eventhubHandler) runWithProcessor(ctx context.Context) error { + checkpointStore, err := createCheckpointStore(h.config.StorageConnection, h.config.StorageContainer) + if err != nil { + return err + } + + processor, err := azeventhubs.NewProcessor(h.consumerClient.(*consumerClientWrapperImpl).consumerClient, checkpointStore, nil) + if err != nil { + return err + } + + go h.dispatchPartitionClients(processor) + processorCtx, processorCancel := context.WithCancel(ctx) + defer processorCancel() + + return processor.Run(processorCtx) +} + +func (h *eventhubHandler) dispatchPartitionClients(processor *azeventhubs.Processor) { + var wg sync.WaitGroup + for { + partitionClient := processor.NextPartitionClient(context.TODO()) + + if partitionClient == nil { + break + } + + wg.Add(1) + go func(pc *azeventhubs.ProcessorPartitionClient) { + defer wg.Done() + if err := h.processEventsForPartition(pc); err != nil { + h.settings.Logger.Error("Error processing partition", zap.Error(err)) + } + }(partitionClient) + } + wg.Wait() +} + +func (h *eventhubHandler) processEventsForPartition(partitionClient *azeventhubs.ProcessorPartitionClient) error { + defer partitionClient.Close(context.TODO()) + + for { + receiveCtx, cancelReceive := context.WithTimeout(context.TODO(), time.Minute) + events, err := partitionClient.ReceiveEvents(receiveCtx, h.config.BatchCount, nil) + cancelReceive() + + if err != nil && !errors.Is(err, context.DeadlineExceeded) { + var eventHubError *azeventhubs.Error + if errors.As(err, &eventHubError) && eventHubError.Code == azeventhubs.ErrorCodeOwnershipLost { + return nil + } + return err + } + + if len(events) == 0 { + continue + } + + for _, event := range events { + if err := h.newMessageHandler(context.TODO(), event); err != nil { + h.settings.Logger.Error("Error handling event", zap.Error(err)) + } + } + + if err := partitionClient.UpdateCheckpoint(context.TODO(), events[len(events)-1], nil); err != nil { + h.settings.Logger.Error("Error updating checkpoint", zap.Error(err)) + } + } +} + +func (h *eventhubHandler) runWithConsumerClient(ctx context.Context, host component.Host) error { + if h.consumerClient == nil { + if err := h.init(ctx); err != nil { + return err + } + } + if h.config.Partition == "" { + properties, err := h.consumerClient.GetEventHubProperties(ctx, nil) + if err != nil { + h.settings.Logger.Debug("Error getting Event Hub properties", zap.Error(err)) + return err + } + + for _, partitionID := range properties.PartitionIDs { + err = h.setupPartition(ctx, partitionID) + if err != nil { + h.settings.Logger.Debug("Error setting up partition", zap.Error(err)) + return err + } + } + } else { + err := h.setupPartition(ctx, h.config.Partition) + if err != nil { + h.settings.Logger.Debug("Error setting up partition", zap.Error(err)) + return err + } + } + return nil +} + +func (h *eventhubHandler) setupPartition(ctx context.Context, partitionID string) error { + cc, err := h.consumerClient.NewConsumer(ctx, nil) + if err != nil { + return err + } + if cc == nil { + return errors.New("failed to initialize consumer client") + } + defer func() { + if cc != nil { + cc.Close(ctx) + } + }() + + pcOpts := &azeventhubs.PartitionClientOptions{ + StartPosition: azeventhubs.StartPosition{ + Earliest: to.Ptr(true), + }, + } + + pc, err := cc.NewPartitionClient(partitionID, pcOpts) + if err != nil { + return err + } + if pc == nil { + return errors.New("failed to initialize partition client") + } + defer func() { + if pc != nil { + pc.Close(ctx) + } + }() + + go h.receivePartitionEvents(ctx, pc) + + return nil +} + +func (h *eventhubHandler) receivePartitionEvents(ctx context.Context, pc *azeventhubs.PartitionClient) { + var wait = 1 + for { + rcvCtx, _ := context.WithTimeout(context.TODO(), time.Second*10) + events, err := pc.ReceiveEvents(rcvCtx, h.config.BatchCount, nil) + if err != nil { + h.settings.Logger.Error("Error receiving event", zap.Error(err)) + time.Sleep(time.Duration(wait) * time.Second) + wait *= 2 + continue + } + + for _, event := range events { + if err := h.newMessageHandler(ctx, event); err != nil { + h.settings.Logger.Error("Error handling event", zap.Error(err)) + } + } + } +} + +func (h *eventhubHandler) newMessageHandler(ctx context.Context, event *azeventhubs.ReceivedEventData) error { + err := h.dataConsumer.consume(ctx, event) + if err != nil { + h.settings.Logger.Error("Error decoding message", zap.Error(err)) + return err + } + return nil +} + +func (h *eventhubHandler) close(ctx context.Context) error { + if h.consumerClient != nil { + err := h.consumerClient.Close(ctx) + if err != nil { + return err + } + h.consumerClient = nil + } + return nil +} + +func (h *eventhubHandler) setDataConsumer(dataConsumer dataConsumer) { + h.dataConsumer = dataConsumer +} + +func createCheckpointStore(storageConnectionString, containerName string) (azeventhubs.CheckpointStore, error) { + azBlobContainerClient, err := container.NewClientFromConnectionString(storageConnectionString, containerName, nil) + if err != nil { + return nil, err + } + return checkpoints.NewBlobStore(azBlobContainerClient, nil) +} diff --git a/collector/components/azureeventhubreceiver/eventhubhandler_test.go b/collector/components/azureeventhubreceiver/eventhubhandler_test.go new file mode 100644 index 0000000..cb1c95f --- /dev/null +++ b/collector/components/azureeventhubreceiver/eventhubhandler_test.go @@ -0,0 +1,134 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "context" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" + + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receiverhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver/internal/metadata" +) + +type mockProcessor struct{} + +func (m *mockProcessor) Run(ctx context.Context) error { + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(time.Millisecond): + return nil + } +} + +func (m *mockProcessor) NextPartitionClient(ctx context.Context) *azeventhubs.ProcessorPartitionClient { + return &azeventhubs.ProcessorPartitionClient{} +} + +type mockCheckpointStore struct{} + +func (m *mockCheckpointStore) SetCheckpoint(ctx context.Context, checkpoint azeventhubs.Checkpoint, options *azeventhubs.SetCheckpointOptions) error { + return nil +} + +func (m *mockCheckpointStore) GetCheckpoint(ctx context.Context, partitionID string) (azeventhubs.Checkpoint, error) { + return azeventhubs.Checkpoint{}, nil +} + +func (m *mockCheckpointStore) GetCheckpoints(ctx context.Context) ([]azeventhubs.Checkpoint, error) { + return []azeventhubs.Checkpoint{}, nil +} + +func newMockProcessor(*eventhubHandler) (*mockProcessor, error) { + return &mockProcessor{}, nil +} + +type mockconsumerClientWrapper struct { +} + +func (m mockconsumerClientWrapper) GetEventHubProperties(_ context.Context, _ *azeventhubs.GetEventHubPropertiesOptions) (azeventhubs.EventHubProperties, error) { + return azeventhubs.EventHubProperties{ + Name: "mynameis", + PartitionIDs: []string{"foo", "bar"}, + }, nil +} + +func (m mockconsumerClientWrapper) GetPartitionProperties(ctx context.Context, partitionID string, options *azeventhubs.GetPartitionPropertiesOptions) (azeventhubs.PartitionProperties, error) { + return azeventhubs.PartitionProperties{ + PartitionID: "abc123", + LastEnqueuedOffset: 1111, + }, nil +} + +func (m mockconsumerClientWrapper) NextConsumer(ctx context.Context, options azeventhubs.ConsumerClientOptions) (*azeventhubs.ConsumerClient, error) { + return &azeventhubs.ConsumerClient{}, nil +} + +func (m mockconsumerClientWrapper) NewConsumer(ctx context.Context, options *azeventhubs.ConsumerClientOptions) (*azeventhubs.ConsumerClient, error) { + return &azeventhubs.ConsumerClient{}, nil +} + +func (m mockconsumerClientWrapper) NewPartitionClient(partitionID string, options *azeventhubs.PartitionClientOptions) (*azeventhubs.PartitionClient, error) { + return &azeventhubs.PartitionClient{}, nil +} + +func (m mockconsumerClientWrapper) Close(_ context.Context) error { + return nil +} + +// Function to create mock implementation +func newMockConsumerClientWrapperImplementation(cfg *Config) (consumerClientWrapper, error) { + var ccw consumerClientWrapper = &mockconsumerClientWrapper{} + return ccw, nil +} + +type mockDataConsumer struct { + logsUnmarshaler eventLogsUnmarshaler + nextLogsConsumer consumer.Logs + obsrecv *receiverhelper.ObsReport +} + +func (m *mockDataConsumer) setNextLogsConsumer(nextLogsConsumer consumer.Logs) { + m.nextLogsConsumer = nextLogsConsumer +} + +func (m *mockDataConsumer) setNextMetricsConsumer(_ consumer.Metrics) {} + +func (m *mockDataConsumer) consume(ctx context.Context, event *azeventhubs.ReceivedEventData) error { + logsContext := m.obsrecv.StartLogsOp(ctx) + + logs, err := m.logsUnmarshaler.UnmarshalLogs(event) + if err != nil { + return err + } + + err = m.nextLogsConsumer.ConsumeLogs(logsContext, logs) + m.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, err) + + return err +} + +// newMockEventhubHandler creates a mock handler for Azure Event Hub for use in unit tests. +func newMockEventhubHandler(config *Config, settings receiver.CreateSettings) *eventhubHandler { + // Mock implementation: No real operations are performed. + consumerClient, err := newMockConsumerClientWrapperImplementation(config) + if err != nil { + panic(err) + } + + eh := &eventhubHandler{ + processor: &azeventhubs.Processor{}, + consumerClient: consumerClient, + dataConsumer: &mockDataConsumer{}, + config: config, + settings: settings, + useProcessor: false, + } + return eh +} diff --git a/collector/components/azureeventhubreceiver/factory.go b/collector/components/azureeventhubreceiver/factory.go new file mode 100644 index 0000000..a9d0bfe --- /dev/null +++ b/collector/components/azureeventhubreceiver/factory.go @@ -0,0 +1,132 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "context" + "errors" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver/internal/metadata" +) + +var ( + // The receiver scope name + receiverScopeName = "otelcol/" + metadata.Type.String() + "receiver" +) + +var ( + errUnexpectedConfigurationType = errors.New("failed to cast configuration to azure event hub config") +) + +type eventhubReceiverFactory struct { + receivers *sharedcomponent.SharedComponents +} + +// NewFactory creates a factory for the Azure Event Hub receiver. +func NewFactory() receiver.Factory { + f := &eventhubReceiverFactory{ + receivers: sharedcomponent.NewSharedComponents(), + } + + return receiver.NewFactory( + metadata.Type, + createDefaultConfig, + receiver.WithLogs(f.createLogsReceiver, metadata.LogsStability), + receiver.WithMetrics(f.createMetricsReceiver, metadata.MetricsStability)) +} + +func createDefaultConfig() component.Config { + return &Config{} +} + +func (f *eventhubReceiverFactory) createLogsReceiver( + _ context.Context, + settings receiver.CreateSettings, + cfg component.Config, + nextConsumer consumer.Logs, +) (receiver.Logs, error) { + + receiver, err := f.getReceiver(component.DataTypeLogs, cfg, settings) + if err != nil { + return nil, err + } + + receiver.(dataConsumer).setNextLogsConsumer(nextConsumer) + + return receiver, nil +} + +func (f *eventhubReceiverFactory) createMetricsReceiver( + _ context.Context, + settings receiver.CreateSettings, + cfg component.Config, + nextConsumer consumer.Metrics, +) (receiver.Metrics, error) { + + receiver, err := f.getReceiver(component.DataTypeMetrics, cfg, settings) + if err != nil { + return nil, err + } + + receiver.(dataConsumer).setNextMetricsConsumer(nextConsumer) + + return receiver, nil +} + +func (f *eventhubReceiverFactory) getReceiver( + receiverType component.Type, + cfg component.Config, + settings receiver.CreateSettings, +) (component.Component, error) { + + var err error + r := f.receivers.GetOrAdd(cfg, func() component.Component { + receiverConfig, ok := cfg.(*Config) + if !ok { + err = errUnexpectedConfigurationType + return nil + } + + var logsUnmarshaler eventLogsUnmarshaler + var metricsUnmarshaler eventMetricsUnmarshaler + switch receiverType { + case component.DataTypeLogs: + if logFormat(receiverConfig.Format) == rawLogFormat { + logsUnmarshaler = newRawLogsUnmarshaler(settings.Logger) + } else { + logsUnmarshaler = newAzureResourceLogsUnmarshaler(settings.BuildInfo, settings.Logger) + } + case component.DataTypeMetrics: + if logFormat(receiverConfig.Format) == rawLogFormat { + metricsUnmarshaler = nil + err = errors.New("raw format not supported for Metrics") + } else { + metricsUnmarshaler = newAzureResourceMetricsUnmarshaler(settings.BuildInfo, settings.Logger) + } + case component.DataTypeTraces: + err = errors.New("unsupported traces data") + } + + if err != nil { + return nil + } + + eventHandler := newEventhubHandler(receiverConfig, settings) + + var receiver component.Component + receiver, err = newReceiver(receiverType, logsUnmarshaler, metricsUnmarshaler, eventHandler, settings) + return receiver + }) + + if err != nil { + return nil, err + } + + return r.Unwrap(), err +} diff --git a/collector/components/azureeventhubreceiver/factory_test.go b/collector/components/azureeventhubreceiver/factory_test.go new file mode 100644 index 0000000..a809213 --- /dev/null +++ b/collector/components/azureeventhubreceiver/factory_test.go @@ -0,0 +1,40 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com.open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver/receivertest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver/internal/metadata" +) + +func Test_NewFactory(t *testing.T) { + f := NewFactory() + assert.Equal(t, metadata.Type, f.Type()) +} + +func Test_NewLogsReceiver(t *testing.T) { + f := NewFactory() + config := createDefaultConfig().(*Config) + config.Connection = "Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234;EntityPath=hubName" + + receiver, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), config, consumertest.NewNop()) + assert.NoError(t, err) + assert.NotNil(t, receiver) +} + +func Test_NewMetricsReceiver(t *testing.T) { + f := NewFactory() + config := createDefaultConfig().(*Config) + config.Connection = "Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234;EntityPath=hubName" + + receiver, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), config, consumertest.NewNop()) + assert.NoError(t, err) + assert.NotNil(t, receiver) +} diff --git a/collector/components/azureeventhubreceiver/generated_component_test.go b/collector/components/azureeventhubreceiver/generated_component_test.go new file mode 100644 index 0000000..b0f794e --- /dev/null +++ b/collector/components/azureeventhubreceiver/generated_component_test.go @@ -0,0 +1,83 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package azureeventhubreceiver + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receivertest" + + "go.opentelemetry.io/collector/confmap/confmaptest" +) + +// assertNoErrorHost implements a component.Host that asserts that there were no errors. +type assertNoErrorHost struct { + component.Host + *testing.T +} + +var _ component.Host = (*assertNoErrorHost)(nil) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + + t.Run(test.name+"-lifecycle", func(t *testing.T) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) + } +} diff --git a/collector/components/azureeventhubreceiver/go.mod b/collector/components/azureeventhubreceiver/go.mod new file mode 100644 index 0000000..67629d4 --- /dev/null +++ b/collector/components/azureeventhubreceiver/go.mod @@ -0,0 +1,125 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver + +go 1.21 + +require ( + github.com/Azure/azure-amqp-common-go/v4 v4.2.0 + github.com/Azure/azure-event-hubs-go/v3 v3.6.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 + github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.1.0 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2 + github.com/json-iterator/go v1.1.12 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.94.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.94.0 + github.com/relvacode/iso8601 v1.4.0 + github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.94.1 + go.opentelemetry.io/collector/confmap v0.94.1 + go.opentelemetry.io/collector/consumer v0.94.1 + go.opentelemetry.io/collector/extension v0.94.1 + go.opentelemetry.io/collector/otelcol v0.94.1 + go.opentelemetry.io/collector/pdata v1.1.0 + go.opentelemetry.io/collector/receiver v0.94.1 + go.opentelemetry.io/collector/semconv v0.94.1 + go.opentelemetry.io/otel/metric v1.23.1 + go.opentelemetry.io/otel/trace v1.23.1 + go.uber.org/zap v1.26.0 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect + github.com/Azure/go-amqp v1.0.5 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.0.2 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/shirou/gopsutil/v3 v3.24.1 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/collector v0.94.1 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.94.1 // indirect + go.opentelemetry.io/collector/connector v0.94.1 // indirect + go.opentelemetry.io/collector/exporter v0.94.1 // indirect + go.opentelemetry.io/collector/featuregate v1.1.0 // indirect + go.opentelemetry.io/collector/processor v0.94.1 // indirect + go.opentelemetry.io/collector/service v0.94.1 // indirect + go.opentelemetry.io/contrib/config v0.3.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.22.0 // indirect + go.opentelemetry.io/otel v1.23.1 // indirect + go.opentelemetry.io/otel/bridge/opencensus v0.45.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.45.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.45.1 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.45.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0 // indirect + go.opentelemetry.io/otel/sdk v1.23.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.23.0 // indirect + go.opentelemetry.io/proto/otlp v1.1.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + gonum.org/v1/gonum v0.14.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/grpc v1.61.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +retract ( + v0.76.2 + v0.76.1 + v0.65.0 +) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent => ../../internal/sharedcomponent + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure => ../../pkg/translator/azure + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/collector/components/azureeventhubreceiver/go.sum b/collector/components/azureeventhubreceiver/go.sum new file mode 100644 index 0000000..cf28ad5 --- /dev/null +++ b/collector/components/azureeventhubreceiver/go.sum @@ -0,0 +1,359 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Azure/azure-amqp-common-go/v4 v4.2.0 h1:q/jLx1KJ8xeI8XGfkOWMN9XrXzAfVTkyvCxPvHCjd2I= +github.com/Azure/azure-amqp-common-go/v4 v4.2.0/go.mod h1:GD3m/WPPma+621UaU6KNjKEo5Hl09z86viKwQjTpV0Q= +github.com/Azure/azure-event-hubs-go/v3 v3.6.2 h1:7rNj1/iqS/i3mUKokA2n2eMYO72TB7lO7OmpbKoakKY= +github.com/Azure/azure-event-hubs-go/v3 v3.6.2/go.mod h1:n+ocYr9j2JCLYqUqz9eI+lx/TEAtL/g6rZzyTFSuIpc= +github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= +github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.1.0 h1:vEe09cdSBy7evqoVUvuitnsjyozsSzI4TbGgwu01+TI= +github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.1.0/go.mod h1:PgOlzIlvwIagKI8N6hCsfFDpAijHCmlHqOwA5GsSh9w= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.0.0 h1:BWeAAEzkCnL0ABVJqs+4mYudNch7oFGPtTlSmIWL8ms= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.0.0/go.mod h1:Y3gnVwfaz8h6L1YHar+NfWORtBoVUSB5h4GlGkdeF7Q= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2 h1:YUUxeiOWgdAQE3pXt2H7QXzZs0q8UBjgRbl56qo8GYM= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2/go.mod h1:dmXQgZuiSubAecswZE+Sm8jkvEa7kQgTPVRvwL/nd0E= +github.com/Azure/go-amqp v1.0.5 h1:po5+ljlcNSU8xtapHTe8gIc8yHxCzC03E8afH2g1ftU= +github.com/Azure/go-amqp v1.0.5/go.mod h1:vZAogwdrkbyK3Mla8m/CxSc/aKdnTZ4IbPxl51Y5WZE= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= +github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.0.2 h1:sEZzPW2rVWSahcYILNq/syJdEyRafZIG0l9aWwL86HA= +github.com/knadh/koanf/v2 v2.0.2/go.mod h1:HN9uZ+qFAejH1e4G41gnoffIanINWQuONLXiV7kir6k= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= +github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= +github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/relvacode/iso8601 v1.4.0 h1:GsInVSEJfkYuirYFxa80nMLbH2aydgZpIf52gYZXUJs= +github.com/relvacode/iso8601 v1.4.0/go.mod h1:FlNp+jz+TXpyRqgmM7tnzHHzBnz776kmAH2h3sZCn0I= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shirou/gopsutil/v3 v3.24.1 h1:R3t6ondCEvmARp3wxODhXMTLC/klMa87h2PHUw5m7QI= +github.com/shirou/gopsutil/v3 v3.24.1/go.mod h1:UU7a2MSBQa+kW1uuDq8DeEBS8kmrnQwsv2b5O513rwU= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/collector v0.94.1 h1:bGHW5NKmh34oMflMEyNCHpes6vtiQNXpgea4GiscAOs= +go.opentelemetry.io/collector v0.94.1/go.mod h1:5ACZXRo6O23gBkRrHSxYs1sLaP4pZ8w+flZNE7pvoNg= +go.opentelemetry.io/collector/component v0.94.1 h1:j4peKsWb+QVBKPs2RJeIj5EoQW7yp2ZVGrd8Bu9HU9M= +go.opentelemetry.io/collector/component v0.94.1/go.mod h1:vg+kAH81C3YS0SPzUXkSFWLPC1WH7zx70dAtUWWIHcE= +go.opentelemetry.io/collector/config/confignet v0.94.1 h1:kaV1iwZKjv7ZJZ+PtLTQYfVNLVD3EAyxfYBNZf5GXmo= +go.opentelemetry.io/collector/config/confignet v0.94.1/go.mod h1:rraribsOoZsYZm51+3TXHavmXKJOC5a5/X20vfmNbdw= +go.opentelemetry.io/collector/config/configretry v0.94.1 h1:0rJXulYg7DouKfrfyhNgT2SyDtTx2+PSQATuHQK6kLU= +go.opentelemetry.io/collector/config/configretry v0.94.1/go.mod h1:gt1HRYyMxcMca9lbDLPbivQzsUCjVjkPAn/3S6fiD14= +go.opentelemetry.io/collector/config/configtelemetry v0.94.1 h1:ztYpBEBlvhcoxMiDKNmQ2SS+A41JZ4M19GfcxjCo8Zs= +go.opentelemetry.io/collector/config/configtelemetry v0.94.1/go.mod h1:2XLhyR/GVpWeZ2K044vCmrvH/d4Ewt0aD/y46avZyMU= +go.opentelemetry.io/collector/confmap v0.94.1 h1:O69bkeyR1YPAFz+jMd45aDZc1DtYnwb3Skgr2yALPqQ= +go.opentelemetry.io/collector/confmap v0.94.1/go.mod h1:pCT5UtcHaHVJ5BIILv1Z2VQyjZzmT9uTdBmC9+Z0AgA= +go.opentelemetry.io/collector/connector v0.94.1 h1:ZYGNubGypsxK5XN6rkCdMaS0PDnMW7yzOj4CHUNIAII= +go.opentelemetry.io/collector/connector v0.94.1/go.mod h1:iv4lgIGa15FDwz7UN/pBMtrihTJEsZUxbWfPbM7e2QM= +go.opentelemetry.io/collector/consumer v0.94.1 h1:l/9h5L71xr/d93snQ9fdxgz64C4UuB8mEDxpp456X8o= +go.opentelemetry.io/collector/consumer v0.94.1/go.mod h1:BIPWmw8wES6jlPTPC+acJxLvUzIdOm6uh/p/X85ALsY= +go.opentelemetry.io/collector/exporter v0.94.1 h1:tu9l/lZdgf0zLvWTZeRPV6wKLkQ8ymMFx7GBGjweQtw= +go.opentelemetry.io/collector/exporter v0.94.1/go.mod h1:XO3dwIIjrHTu0Z9Fs0pQASFTNZcT7uQiYd78f49gNsk= +go.opentelemetry.io/collector/extension v0.94.1 h1:f0yyW2lmLg+PI1FjNWJaGcKVQV6TRgLqqbMA/4S5dA4= +go.opentelemetry.io/collector/extension v0.94.1/go.mod h1:fxQXkLkFcea3uJ3hlImBs5kQ/pWjeDIC2OylnDYIA4g= +go.opentelemetry.io/collector/extension/zpagesextension v0.94.1 h1:s+cb8nh2vS9F2/UkWO+jhsvJE2SV5CF3BZ1KJ6q8rSk= +go.opentelemetry.io/collector/extension/zpagesextension v0.94.1/go.mod h1:NVoJq0mxe7AIw+EjDPyrwMZ21DGxoUqXZ1W5dTXrV38= +go.opentelemetry.io/collector/featuregate v1.1.0 h1:W+/FKvRxHMFC6MuTTEgrHINCf1vFBvLH7stSOEar6zU= +go.opentelemetry.io/collector/featuregate v1.1.0/go.mod h1:QQXjP4etmJQhkQ20j4P/rapWuItYxoFozg/iIwuKnYg= +go.opentelemetry.io/collector/otelcol v0.94.1 h1:iXCIjOxjAHiMtguDz8JK7lGMkvKRrretnJ+hbuimYd8= +go.opentelemetry.io/collector/otelcol v0.94.1/go.mod h1:/cYiy1apIC+04ij+miTGUjm2Qc23oq/6KUcBlCeeBEw= +go.opentelemetry.io/collector/pdata v1.1.0 h1:cE6Al1rQieUjMHro6p6cKwcu3sjHXGG59BZ3kRVUvsM= +go.opentelemetry.io/collector/pdata v1.1.0/go.mod h1:IDkDj+B4Fp4wWOclBELN97zcb98HugJ8Q2gA4ZFsN8Q= +go.opentelemetry.io/collector/processor v0.94.1 h1:cNlGox8fN85KhtUq6yuqgPM9KDCQ4O5aDQ864joc4JQ= +go.opentelemetry.io/collector/processor v0.94.1/go.mod h1:pMwIDr5UTSjBJ8ATLR8e84TWEnqO/9HTmDjj1NJ3K84= +go.opentelemetry.io/collector/receiver v0.94.1 h1:p9kIPmDeLSAlFZZuHdFELGGiP0JduFEfsT8Uz6Ut+8g= +go.opentelemetry.io/collector/receiver v0.94.1/go.mod h1:AYdIg3Bl4kwiqQy/k3tuYQnS918gb5i3HcInn6owudE= +go.opentelemetry.io/collector/semconv v0.94.1 h1:+FoBlzwFgwalgbdBhJHtHPvR7W0+aJDUAdQdsmfT/Ts= +go.opentelemetry.io/collector/semconv v0.94.1/go.mod h1:gZ0uzkXsN+J5NpiRcdp9xOhNGQDDui8Y62p15sKrlzo= +go.opentelemetry.io/collector/service v0.94.1 h1:O2n+j22ycTi5cikDehYlYKw2VslCbcwjX8Pgf5NeVoc= +go.opentelemetry.io/collector/service v0.94.1/go.mod h1:Lq55nShtnd7y2iZAXW1DIO+gmGYgSdbju+ESL+NnWZg= +go.opentelemetry.io/contrib/config v0.3.0 h1:nJxYSB7/8fckSya4EAFyFGxIytMvNlQInXSmhz/OKKg= +go.opentelemetry.io/contrib/config v0.3.0/go.mod h1:tQW0mY8be9/LGikwZNYno97PleUhF/lMal9xJ1TC2vo= +go.opentelemetry.io/contrib/propagators/b3 v1.22.0 h1:Okbgv0pWHMQq+mF7H2o1mucJ5PvxKFq2c8cyqoXfeaQ= +go.opentelemetry.io/contrib/propagators/b3 v1.22.0/go.mod h1:N3z0ycFRhsVZ+tG/uavMxHvOvFE95QM6gwW1zSqT9dQ= +go.opentelemetry.io/contrib/zpages v0.47.0 h1:ekpdNa2wqOvAfwZIGDIIV02zmR+z08aWPt21KrPJnaU= +go.opentelemetry.io/contrib/zpages v0.47.0/go.mod h1:rBeFA/UxnMjRlEGpmClIqzf1mCIKtl7ahjww3wsSdGs= +go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= +go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= +go.opentelemetry.io/otel/bridge/opencensus v0.45.0 h1:kEOlv9Exuv3J8GCf1nLMHfrTPGnZOuIkN8YlRM14TtQ= +go.opentelemetry.io/otel/bridge/opencensus v0.45.0/go.mod h1:tkVMJeFOr43+zzwbxtIWsNcCCDT7rI5/c9rhMfMIENg= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0 h1:tfil6di0PoNV7FZdsCS7A5izZoVVQ7AuXtyekbOpG/I= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0/go.mod h1:AKFZIEPOnqB00P63bTjOiah4ZTaRzl1TKwUWpZdYUHI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.45.0 h1:+RbSCde0ERway5FwKvXR3aRJIFeDu9rtwC6E7BC6uoM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.45.0/go.mod h1:zcI8u2EJxbLPyoZ3SkVAAcQPgYb1TDRzW93xLFnsggU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0 h1:D/cXD+03/UOphyyT87NX6h+DlU+BnplN6/P6KJwsgGc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0/go.mod h1:L669qRGbPBwLcftXLFnTVFO6ES/GyMAvITLdvRjEAIM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.0 h1:VZrBiTXzP3FErizsdF1JQj0qf0yA8Ktt6LAcjUhZqbc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.0/go.mod h1:xkkwo777b9MEfsyD1yUZa4g+7MCqqWAP3r2tTSZePRc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0 h1:cZXHUQvCx7YMdjGu0AlmoArUz7NZ7K6WWsT4cjSkzc0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0/go.mod h1:OHlshrAeSV9uiVQs1n+c0FVCyo8L0NrYzVf5GuLllRo= +go.opentelemetry.io/otel/exporters/prometheus v0.45.1 h1:R/bW3afad6q6VGU+MFYpnEdo0stEARMCdhWu6+JI6aI= +go.opentelemetry.io/otel/exporters/prometheus v0.45.1/go.mod h1:wnHAfKRav5Dfp4iZhyWZ7SzQfT+rDZpEpYG7To+qJ1k= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.45.0 h1:NjN6zc7Mwy9torqa3mo+pMJ3mHoPI0uzVSYcqB2t72A= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.45.0/go.mod h1:U+T5v2bk4fCC8XdSEWZja3Pm/ZhvV/zE7JwX/ELJKts= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0 h1:f4N/tfYchDXfM78Ng5KKO7OjrShVzww1g4oYxZ7tyMA= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0/go.mod h1:v1gipIZLj3qtxR1L1F7jF/WaPFA5ptuHk52+eq9SSRg= +go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= +go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= +go.opentelemetry.io/otel/sdk v1.23.0 h1:0KM9Zl2esnl+WSukEmlaAEjVY5HDZANOHferLq36BPc= +go.opentelemetry.io/otel/sdk v1.23.0/go.mod h1:wUscup7byToqyKJSilEtMf34FgdCAsFpFOjXnAwFfO0= +go.opentelemetry.io/otel/sdk/metric v1.23.0 h1:u81lMvmK6GMgN4Fty7K7S6cSKOZhMKJMK2TB+KaTs0I= +go.opentelemetry.io/otel/sdk/metric v1.23.0/go.mod h1:2LUOToN/FdX6wtfpHybOnCZjoZ6ViYajJYMiJ1LKDtQ= +go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= +go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= +go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= +go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= +gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= +nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= diff --git a/collector/components/azureeventhubreceiver/internal/metadata/generated_status.go b/collector/components/azureeventhubreceiver/internal/metadata/generated_status.go new file mode 100644 index 0000000..23cb579 --- /dev/null +++ b/collector/components/azureeventhubreceiver/internal/metadata/generated_status.go @@ -0,0 +1,26 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" +) + +var ( + Type = component.MustNewType("azureeventhub") +) + +const ( + MetricsStability = component.StabilityLevelAlpha + LogsStability = component.StabilityLevelAlpha +) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/azureeventhubreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/azureeventhubreceiver") +} diff --git a/collector/components/azureeventhubreceiver/metadata.yaml b/collector/components/azureeventhubreceiver/metadata.yaml new file mode 100644 index 0000000..b090eda --- /dev/null +++ b/collector/components/azureeventhubreceiver/metadata.yaml @@ -0,0 +1,13 @@ +type: azureeventhub + +status: + class: receiver + stability: + alpha: [metrics, logs] + distributions: [contrib, splunk, observiq, sumo] + codeowners: + active: [atoulme, djaglowski] + +tests: + config: + skip_lifecycle: true diff --git a/collector/components/azureeventhubreceiver/persister.go b/collector/components/azureeventhubreceiver/persister.go new file mode 100644 index 0000000..7d9be73 --- /dev/null +++ b/collector/components/azureeventhubreceiver/persister.go @@ -0,0 +1,42 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "context" + "fmt" + + "github.com/Azure/azure-event-hubs-go/v3/persist" + jsoniter "github.com/json-iterator/go" + "go.opentelemetry.io/collector/extension/experimental/storage" +) + +const ( + storageKeyFormat = "%s/%s/%s/%s" +) + +type storageCheckpointPersister struct { + storageClient storage.Client +} + +func (s *storageCheckpointPersister) Write(namespace, name, consumerGroup, partitionID string, checkpoint persist.Checkpoint) error { + b, err := jsoniter.Marshal(checkpoint) + if err != nil { + return err + } + return s.storageClient.Set(context.Background(), fmt.Sprintf(storageKeyFormat, namespace, name, consumerGroup, partitionID), b) +} + +func (s *storageCheckpointPersister) Read(namespace, name, consumerGroup, partitionID string) (persist.Checkpoint, error) { + var checkpoint persist.Checkpoint + bytes, err := s.storageClient.Get(context.Background(), fmt.Sprintf(storageKeyFormat, namespace, name, consumerGroup, partitionID)) + if err != nil { + return persist.NewCheckpointFromStartOfStream(), err + } + if len(bytes) == 0 { + return persist.NewCheckpointFromStartOfStream(), err + } + err = jsoniter.Unmarshal(bytes, &checkpoint) + return checkpoint, err +} diff --git a/collector/components/azureeventhubreceiver/persister_test.go b/collector/components/azureeventhubreceiver/persister_test.go new file mode 100644 index 0000000..123cae0 --- /dev/null +++ b/collector/components/azureeventhubreceiver/persister_test.go @@ -0,0 +1,102 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "context" + "errors" + "sync" + "testing" + "time" + + "github.com/Azure/azure-event-hubs-go/v3/persist" + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/extension/experimental/storage" +) + +func TestStorageOffsetPersisterUnknownCheckpoint(t *testing.T) { + client := newMockClient() + s := storageCheckpointPersister{storageClient: client} + // check we have no match + checkpoint, err := s.Read("foo", "bar", "foobar", "foobarfoo") + assert.NoError(t, err) + assert.NotNil(t, checkpoint) + assert.Equal(t, "-1", checkpoint.Offset) +} + +func TestStorageOffsetPersisterWithKnownCheckpoint(t *testing.T) { + client := newMockClient() + s := storageCheckpointPersister{storageClient: client} + checkpoint := persist.Checkpoint{ + Offset: "foo", + SequenceNumber: 2, + EnqueueTime: time.Now(), + } + err := s.Write("foo", "bar", "foobar", "foobarfoo", checkpoint) + assert.NoError(t, err) + read, err := s.Read("foo", "bar", "foobar", "foobarfoo") + assert.NoError(t, err) + assert.Equal(t, checkpoint.Offset, read.Offset) + assert.Equal(t, checkpoint.SequenceNumber, read.SequenceNumber) + assert.True(t, checkpoint.EnqueueTime.Equal(read.EnqueueTime)) +} + +// copied from pkg/stanza/adapter/mocks_test.go +type mockClient struct { + cache map[string][]byte + cacheMux sync.Mutex +} + +func newMockClient() *mockClient { + return &mockClient{ + cache: make(map[string][]byte), + } +} + +func (p *mockClient) Get(_ context.Context, key string) ([]byte, error) { + p.cacheMux.Lock() + defer p.cacheMux.Unlock() + return p.cache[key], nil +} + +func (p *mockClient) Set(_ context.Context, key string, value []byte) error { + p.cacheMux.Lock() + defer p.cacheMux.Unlock() + p.cache[key] = value + return nil +} + +func (p *mockClient) Delete(_ context.Context, key string) error { + p.cacheMux.Lock() + defer p.cacheMux.Unlock() + delete(p.cache, key) + return nil +} + +func (p *mockClient) Batch(_ context.Context, ops ...storage.Operation) error { + p.cacheMux.Lock() + defer p.cacheMux.Unlock() + + for _, op := range ops { + switch op.Type { + case storage.Get: + op.Value = p.cache[op.Key] + case storage.Set: + p.cache[op.Key] = op.Value + case storage.Delete: + delete(p.cache, op.Key) + default: + return errors.New("wrong operation type") + } + } + + return nil +} + +func (p *mockClient) Close(_ context.Context) error { + p.cacheMux.Lock() + defer p.cacheMux.Unlock() + p.cache = nil + return nil +} diff --git a/collector/components/azureeventhubreceiver/rawlogs_unmarshaler.go b/collector/components/azureeventhubreceiver/rawlogs_unmarshaler.go new file mode 100644 index 0000000..f5019df --- /dev/null +++ b/collector/components/azureeventhubreceiver/rawlogs_unmarshaler.go @@ -0,0 +1,77 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.uber.org/zap" +) + +type rawLogsUnmarshaler struct { + logger *zap.Logger +} + +func newRawLogsUnmarshaler(logger *zap.Logger) eventLogsUnmarshaler { + return rawLogsUnmarshaler{ + logger: logger, + } +} + +func (r rawLogsUnmarshaler) UnmarshalLogs(event *azeventhubs.ReceivedEventData) (plog.Logs, error) { + l := plog.NewLogs() + lr := l.ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + slice := lr.Body().SetEmptyBytes() + slice.Append(event.Body...) //event.EventData.([]byte)...) + if event.EnqueuedTime != nil { + lr.SetTimestamp(pcommon.NewTimestampFromTime(*event.EnqueuedTime)) + } + + if err := lr.Attributes().FromRaw(event.Properties); err != nil { + return l, err + } + + return l, nil +} + +// // Copyright The OpenTelemetry Authors +// // SPDX-License-Identifier: Apache-2.0 + +// package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +// import ( +// "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" +// "go.opentelemetry.io/collector/pdata/pcommon" +// "go.opentelemetry.io/collector/pdata/plog" +// "go.uber.org/zap" +// ) + +// type rawLogsUnmarshaler struct { +// logger *zap.Logger +// } + +// func newRawLogsUnmarshaler(logger *zap.Logger) eventLogsUnmarshaler { + +// return rawLogsUnmarshaler{ +// logger: logger, +// } +// } + +// func (r rawLogsUnmarshaler) UnmarshalLogs(event *[]azeventhubs.ReceivedEventData) (plog.Logs, error) { + +// l := plog.NewLogs() +// lr := l.ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() +// slice := lr.Body().SetEmptyBytes() +// slice.Append(event.EventData...) +// if event.SystemProperties.EnqueuedTime != nil { +// lr.SetTimestamp(pcommon.NewTimestampFromTime(*event.SystemProperties.EnqueuedTime)) +// } + +// if err := lr.Attributes().FromRaw(event.Properties); err != nil { +// return l, err +// } + +// return l, nil +// } diff --git a/collector/components/azureeventhubreceiver/receiver.go b/collector/components/azureeventhubreceiver/receiver.go new file mode 100644 index 0000000..1aeb9a1 --- /dev/null +++ b/collector/components/azureeventhubreceiver/receiver.go @@ -0,0 +1,161 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver" + +import ( + "context" + "errors" + "fmt" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/receiver/receiverhelper" + "go.uber.org/zap" + + "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver/internal/metadata" +) + +type dataConsumer interface { + consume(ctx context.Context, event *azeventhubs.ReceivedEventData) error + setNextLogsConsumer(nextLogsConsumer consumer.Logs) + setNextMetricsConsumer(nextLogsConsumer consumer.Metrics) +} + +type eventLogsUnmarshaler interface { + UnmarshalLogs(event *azeventhubs.ReceivedEventData) (plog.Logs, error) +} + +type eventMetricsUnmarshaler interface { + UnmarshalMetrics(event *azeventhubs.ReceivedEventData) (pmetric.Metrics, error) +} + +type eventhubReceiver struct { + eventHandler eventHandler + dataType component.Type + logger *zap.Logger + logsUnmarshaler eventLogsUnmarshaler + metricsUnmarshaler eventMetricsUnmarshaler + nextLogsConsumer consumer.Logs + nextMetricsConsumer consumer.Metrics + obsrecv *receiverhelper.ObsReport +} + +func (receiver *eventhubReceiver) Start(ctx context.Context, host component.Host) error { + + err := receiver.eventHandler.run(ctx, host) + return err +} + +func (receiver *eventhubReceiver) Shutdown(ctx context.Context) error { + + return receiver.eventHandler.close(ctx) +} + +func (receiver *eventhubReceiver) setNextLogsConsumer(nextLogsConsumer consumer.Logs) { + + receiver.nextLogsConsumer = nextLogsConsumer +} + +func (receiver *eventhubReceiver) setNextMetricsConsumer(nextMetricsConsumer consumer.Metrics) { + + receiver.nextMetricsConsumer = nextMetricsConsumer +} + +func (receiver *eventhubReceiver) consume(ctx context.Context, event *azeventhubs.ReceivedEventData) error { + + switch receiver.dataType { + case component.DataTypeLogs: + return receiver.consumeLogs(ctx, event) + case component.DataTypeMetrics: + return receiver.consumeMetrics(ctx, event) + case component.DataTypeTraces: + fallthrough + default: + return fmt.Errorf("invalid data type: %v", receiver.dataType) + } +} + +func (receiver *eventhubReceiver) consumeLogs(ctx context.Context, event *azeventhubs.ReceivedEventData) error { + + if receiver.nextLogsConsumer == nil { + return nil + } + + if receiver.logsUnmarshaler == nil { + return errors.New("unable to unmarshal logs with configured format") + } + + logsContext := receiver.obsrecv.StartLogsOp(ctx) + + logs, err := receiver.logsUnmarshaler.UnmarshalLogs(event) + if err != nil { + return fmt.Errorf("failed to unmarshal logs: %w", err) + } + + receiver.logger.Debug("Log Records", zap.Any("logs", logs)) + err = receiver.nextLogsConsumer.ConsumeLogs(logsContext, logs) + receiver.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, err) + + return err +} + +func (receiver *eventhubReceiver) consumeMetrics(ctx context.Context, event *azeventhubs.ReceivedEventData) error { + + if receiver.nextMetricsConsumer == nil { + return nil + } + + if receiver.metricsUnmarshaler == nil { + return errors.New("unable to unmarshal metrics with configured format") + } + + metricsContext := receiver.obsrecv.StartMetricsOp(ctx) + + metrics, err := receiver.metricsUnmarshaler.UnmarshalMetrics(event) + if err != nil { + return fmt.Errorf("failed to unmarshal metrics: %w", err) + } + + receiver.logger.Debug("Metric Records", zap.Any("metrics", metrics)) + err = receiver.nextMetricsConsumer.ConsumeMetrics(metricsContext, metrics) + + receiver.obsrecv.EndMetricsOp(metricsContext, metadata.Type.String(), 1, err) + + return err +} + +func newReceiver( + receiverType component.Type, + logsUnmarshaler eventLogsUnmarshaler, + metricsUnmarshaler eventMetricsUnmarshaler, + eventHandler eventHandler, + settings receiver.CreateSettings, +) (component.Component, error) { + + obsrecv, err := receiverhelper.NewObsReport(receiverhelper.ObsReportSettings{ + ReceiverID: settings.ID, + Transport: "event", + ReceiverCreateSettings: settings, + }) + if err != nil { + return nil, err + } + + eventhubReceiver := &eventhubReceiver{ + dataType: receiverType, + eventHandler: eventHandler, + logger: settings.Logger, + logsUnmarshaler: logsUnmarshaler, + metricsUnmarshaler: metricsUnmarshaler, + obsrecv: obsrecv, + } + + eventHandler.setDataConsumer(eventhubReceiver) + + return eventhubReceiver, nil +} diff --git a/collector/components/azureeventhubreceiver/testdata/config.yaml b/collector/components/azureeventhubreceiver/testdata/config.yaml new file mode 100644 index 0000000..4afddc4 --- /dev/null +++ b/collector/components/azureeventhubreceiver/testdata/config.yaml @@ -0,0 +1,22 @@ +receivers: + azureeventhub: + connection: Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234=;EntityPath=hubName + + azureeventhub/all: + connection: Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=superSecret1234=;EntityPath=hubName + partition: foo + offset: "1234-5566" + format: "raw" + +processors: + nop: + +exporters: + nop: + +service: + pipelines: + logs: + receivers: [azureeventhub, azureeventhub/all] + processors: [nop] + exporters: [nop] diff --git a/collector/components/azureeventhubreceiver/testdata/log-maximum.json b/collector/components/azureeventhubreceiver/testdata/log-maximum.json new file mode 100644 index 0000000..caef4ec --- /dev/null +++ b/collector/components/azureeventhubreceiver/testdata/log-maximum.json @@ -0,0 +1,31 @@ +{ + "records": [ + { + "time": "2022-11-11T04:48:27.6767145Z", + "resourceId": "/RESOURCE_ID", + "tenantId": "/TENANT_ID", + "operationName": "SecretGet", + "operationVersion": "7.0", + "category": "AuditEvent", + "resultType": "Success", + "resultSignature": "Signature", + "resultDescription": "Description", + "durationMs": "1234", + "callerIpAddress": "127.0.0.1", + "correlationId": "607964b6-41a5-4e24-a5db-db7aab3b9b34", + "Level": "Warning", + "location": "ukso", + "identity": { + "claim": { + "oid": "607964b6-41a5-4e24-a5db-db7aab3b9b34" + } + }, + "properties": { + "string": "string", + "int": 429, + "float": 3.14, + "bool": false + } + } + ] +} diff --git a/collector/components/azureeventhubreceiver/testdata/log-minimum-2.json b/collector/components/azureeventhubreceiver/testdata/log-minimum-2.json new file mode 100644 index 0000000..6eac63f --- /dev/null +++ b/collector/components/azureeventhubreceiver/testdata/log-minimum-2.json @@ -0,0 +1,16 @@ +{ + "records": [ + { + "time": "2022-11-11T04:48:27.6767145Z", + "resourceId": "/RESOURCE_ID", + "operationName": "SecretGet", + "category": "AuditEvent" + }, + { + "time": "2022-11-11T04:48:27.6767145Z", + "resourceId": "/RESOURCE_ID", + "operationName": "SecretGet", + "category": "AuditEvent" + } + ] +} diff --git a/collector/components/azureeventhubreceiver/testdata/log-minimum.json b/collector/components/azureeventhubreceiver/testdata/log-minimum.json new file mode 100644 index 0000000..16d4f2e --- /dev/null +++ b/collector/components/azureeventhubreceiver/testdata/log-minimum.json @@ -0,0 +1,10 @@ +{ + "records": [ + { + "time": "2022-11-11T04:48:27.6767145Z", + "resourceId": "/RESOURCE_ID", + "operationName": "SecretGet", + "category": "AuditEvent" + } + ] +}