From 4f58798457c2eeeee43541cb4dd4becadf80f148 Mon Sep 17 00:00:00 2001 From: Jerry Leung Date: Fri, 3 Nov 2023 13:08:02 -0700 Subject: [PATCH] Used component from solarwinds/opentelelmetry-collector-contrib --- .../solarwindsapmsettingsextension/Makefile | 1 - .../solarwindsapmsettingsextension/README.md | 39 ---- .../solarwindsapmsettingsextension/config.go | 39 ---- .../config_test.go | 62 ----- .../solarwindsapmsettingsextension/doc.go | 3 - .../extension.go | 218 ------------------ .../extension_test.go | 1 - .../solarwindsapmsettingsextension/factory.go | 40 ---- .../factory_test.go | 18 -- .../solarwindsapmsettingsextension/go.mod | 39 ---- .../solarwindsapmsettingsextension/go.sum | 102 -------- .../internal/metadata/generated_status.go | 12 - .../metadata.yaml | 6 - collector/go.mod | 4 +- collector/go.sum | 2 + collector/lambdacomponents/default.go | 2 +- collector/lambdacomponents/go.mod | 3 - 17 files changed, 4 insertions(+), 587 deletions(-) delete mode 100644 collector/extension/solarwindsapmsettingsextension/Makefile delete mode 100644 collector/extension/solarwindsapmsettingsextension/README.md delete mode 100644 collector/extension/solarwindsapmsettingsextension/config.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/config_test.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/doc.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/extension.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/extension_test.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/factory.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/factory_test.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/go.mod delete mode 100644 collector/extension/solarwindsapmsettingsextension/go.sum delete mode 100644 collector/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go delete mode 100644 collector/extension/solarwindsapmsettingsextension/metadata.yaml diff --git a/collector/extension/solarwindsapmsettingsextension/Makefile b/collector/extension/solarwindsapmsettingsextension/Makefile deleted file mode 100644 index ded7a36092..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefile.Common diff --git a/collector/extension/solarwindsapmsettingsextension/README.md b/collector/extension/solarwindsapmsettingsextension/README.md deleted file mode 100644 index 9ae1a661af..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Solarwinds APM Settings extension - - -| Status | | -| ------------- |-----------| -| Stability | [development] | -| Distributions | [] | -| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aextension%2Fsolarwindsapmsettings%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fsolarwindsapmsettings) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fsolarwindsapmsettings%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fsolarwindsapmsettings) | - -[development]: https://github.com/open-telemetry/opentelemetry-collector#development - - -## Overview -The Solarwinds APM Settings extension gets Solarwinds APM specific settings from Solarwinds APM collector and outputs `/tmp/solarwinds-apm-settings.json` periodically - -## Configuration - -Example: - -```yaml -extensions: - solarwindsapmsettings: - endpoint: "apm.collector.cloud.solarwinds.com:443" - key: ":" - interval: 1m -``` - -### endpoint (Optional) -The endpoint which this extension calls `getSettings`. - -Default: `apm.collector.cloud.solarwinds.com:443` - -### key (Required) -The key in format `:` for `getSettings` from Solarwinds APM collector. - -### interval (Optional) -Periodic interval to get Solarwinds APM specific settings from Solarwinds APM collector. - -Default: `1m` diff --git a/collector/extension/solarwindsapmsettingsextension/config.go b/collector/extension/solarwindsapmsettingsextension/config.go deleted file mode 100644 index b2621abd30..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/config.go +++ /dev/null @@ -1,39 +0,0 @@ -package solarwindsapmsettingsextension - -import ( - "fmt" - "strconv" - "strings" - "time" -) - -type Config struct { - Endpoint string `mapstructure:"endpoint"` - Key string `mapstructure:"key"` - Interval string `mapstructure:"interval"` -} - -func (cfg *Config) Validate() error { - if len(cfg.Endpoint) == 0 { - return fmt.Errorf("endpoint must not be empty") - } - endpointArr := strings.Split(cfg.Endpoint, ":") - if len(endpointArr) != 2 { - return fmt.Errorf("endpoint should be in \":\" format") - } - if _, err := strconv.Atoi(endpointArr[1]); err != nil { - return fmt.Errorf("the portion of endpoint has to be an integer") - } - if len(cfg.Key) == 0 { - return fmt.Errorf("key must not be empty") - } - keyArr := strings.Split(cfg.Key, ":") - if len(keyArr) != 2 { - return fmt.Errorf("key should be in \":\" format") - } - - if _, err := time.ParseDuration(cfg.Interval); err != nil { - return fmt.Errorf("interval has to be a duration string. Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\"") - } - return nil -} diff --git a/collector/extension/solarwindsapmsettingsextension/config_test.go b/collector/extension/solarwindsapmsettingsextension/config_test.go deleted file mode 100644 index 6f1f5884f4..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/config_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package solarwindsapmsettingsextension - -import ( - "fmt" - "github.com/stretchr/testify/require" - "testing" -) - -func TestValidate(t *testing.T) { - tests := []struct { - name string - cfg *Config - err error - }{ - { - name: "nothing", - cfg: &Config{}, - err: fmt.Errorf("endpoint must not be empty"), - }, - { - name: "empty key", - cfg: &Config{ - Endpoint: "host:12345", - }, - err: fmt.Errorf("key must not be empty"), - }, - { - name: "invalid endpoint", - cfg: &Config{ - Endpoint: "invalid", - Key: "token:name", - }, - err: fmt.Errorf("endpoint should be in \":\" format"), - }, - { - name: "invalid endpoint format but port is not an integer", - cfg: &Config{ - Endpoint: "host:abc", - Key: "token:name", - }, - err: fmt.Errorf("the portion of endpoint has to be an integer"), - }, - { - name: "invalid key", - cfg: &Config{ - Endpoint: "host:12345", - Key: "invalid", - }, - err: fmt.Errorf("key should be in \":\" format"), - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - err := tc.cfg.Validate() - if tc.err != nil { - require.EqualError(t, err, tc.err.Error()) - } else { - require.NoError(t, err) - } - }) - } -} diff --git a/collector/extension/solarwindsapmsettingsextension/doc.go b/collector/extension/solarwindsapmsettingsextension/doc.go deleted file mode 100644 index ac7a1a6b93..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -//go:generate mdatagen metadata.yaml - -package solarwindsapmsettingsextension diff --git a/collector/extension/solarwindsapmsettingsextension/extension.go b/collector/extension/solarwindsapmsettingsextension/extension.go deleted file mode 100644 index a22b30ec20..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/extension.go +++ /dev/null @@ -1,218 +0,0 @@ -package solarwindsapmsettingsextension - -import ( - "context" - "crypto/tls" - "encoding/binary" - "encoding/json" - "fmt" - "github.com/gogo/protobuf/proto" - "github.com/solarwindscloud/apm-proto/go/collectorpb" - "go.opentelemetry.io/collector/component" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/protobuf/encoding/protojson" - "math" - "os" - "strconv" - "time" -) - -const ( - RawOutputFile = "/tmp/solarwinds-apm-settings-raw" - JSONOutputFile = "/tmp/solarwinds-apm-settings.json" -) - -type solarwindsapmSettingsExtension struct { - logger *zap.Logger - config *Config - cancel context.CancelFunc - conn *grpc.ClientConn - client collectorpb.TraceCollectorClient -} - -func Refresh(extension *solarwindsapmSettingsExtension) { - extension.logger.Info("Time to refresh from " + extension.config.Endpoint) - if hostname, err := os.Hostname(); err != nil { - extension.logger.Fatal("Unable to call os.Hostname() " + err.Error()) - } else { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - request := &collectorpb.SettingsRequest{ - ApiKey: extension.config.Key, - Identity: &collectorpb.HostID{ - Hostname: hostname, - }, - ClientVersion: "2", - } - if response, err := extension.client.GetSettings(ctx, request); err != nil { - extension.logger.Fatal("Unable to getSettings from " + extension.config.Endpoint + " " + err.Error()) - } else { - switch result := response.GetResult(); result { - case collectorpb.ResultCode_OK: - if bytes, err := proto.Marshal(response); err != nil { - extension.logger.Error("Unable to marshal response to bytes " + err.Error()) - } else { - // Output in raw format - if err := os.WriteFile(RawOutputFile, bytes, 0644); err != nil { - extension.logger.Error("Unable to write " + RawOutputFile + " " + err.Error()) - } else { - extension.logger.Info(RawOutputFile + " is refreshed") - } - } - // Output in human-readable format - var settings []map[string]interface{} - for _, item := range response.GetSettings() { - - marshalOptions := protojson.MarshalOptions{ - UseEnumNumbers: true, - EmitUnpopulated: true, - } - if settingBytes, err := marshalOptions.Marshal(item); err != nil { - extension.logger.Warn("Error to marshal setting JSON[] byte from response.GetSettings() " + err.Error()) - } else { - setting := make(map[string]interface{}) - if err := json.Unmarshal(settingBytes, &setting); err != nil { - extension.logger.Warn("Error to unmarshal setting JSON object from setting JSON[]byte " + err.Error()) - } else { - if value, ok := setting["value"].(string); ok { - if num, e := strconv.ParseInt(value, 10, 0); e != nil { - extension.logger.Warn("Unable to parse value " + value + " as number " + e.Error()) - } else { - setting["value"] = num - } - } - if timestamp, ok := setting["timestamp"].(string); ok { - if num, e := strconv.ParseInt(timestamp, 10, 0); e != nil { - extension.logger.Warn("Unable to parse timestamp " + timestamp + " as number " + e.Error()) - } else { - setting["timestamp"] = num - } - } - if ttl, ok := setting["ttl"].(string); ok { - if num, e := strconv.ParseInt(ttl, 10, 0); e != nil { - extension.logger.Warn("Unable to parse ttl " + ttl + " as number " + e.Error()) - } else { - setting["ttl"] = num - } - } - if _, ok := setting["flags"]; ok { - setting["flags"] = string(item.Flags) - } - if arguments, ok := setting["arguments"].(map[string]interface{}); ok { - if value, ok := item.Arguments["BucketCapacity"]; ok { - arguments["BucketCapacity"] = math.Float64frombits(binary.LittleEndian.Uint64(value)) - } - if value, ok := item.Arguments["BucketRate"]; ok { - arguments["BucketRate"] = math.Float64frombits(binary.LittleEndian.Uint64(value)) - } - if value, ok := item.Arguments["TriggerRelaxedBucketCapacity"]; ok { - arguments["TriggerRelaxedBucketCapacity"] = math.Float64frombits(binary.LittleEndian.Uint64(value)) - } - if value, ok := item.Arguments["TriggerRelaxedBucketRate"]; ok { - arguments["TriggerRelaxedBucketRate"] = math.Float64frombits(binary.LittleEndian.Uint64(value)) - } - if value, ok := item.Arguments["TriggerStrictBucketCapacity"]; ok { - arguments["TriggerStrictBucketCapacity"] = math.Float64frombits(binary.LittleEndian.Uint64(value)) - } - if value, ok := item.Arguments["TriggerStrictBucketRate"]; ok { - arguments["TriggerStrictBucketRate"] = math.Float64frombits(binary.LittleEndian.Uint64(value)) - } - if value, ok := item.Arguments["MetricsFlushInterval"]; ok { - arguments["MetricsFlushInterval"] = int32(binary.LittleEndian.Uint32(value)) - } - if value, ok := item.Arguments["MaxTransactions"]; ok { - arguments["MaxTransactions"] = int32(binary.LittleEndian.Uint32(value)) - } - if value, ok := item.Arguments["MaxCustomMetrics"]; ok { - arguments["MaxCustomMetrics"] = int32(binary.LittleEndian.Uint32(value)) - } - if value, ok := item.Arguments["EventsFlushInterval"]; ok { - arguments["EventsFlushInterval"] = int32(binary.LittleEndian.Uint32(value)) - } - if value, ok := item.Arguments["ProfilingInterval"]; ok { - arguments["ProfilingInterval"] = int32(binary.LittleEndian.Uint32(value)) - } - /** - * We don't want to expose SignatureKey now - */ - //if value, ok := item.Arguments["SignatureKey"]; ok { - // arguments["SignatureKey"] = string(value) - //} - } - settings = append(settings, setting) - } - } - } - if content, err := json.Marshal(settings); err != nil { - extension.logger.Warn("Error to marshal setting JSON[] byte from settings " + err.Error()) - } else { - if err := os.WriteFile(JSONOutputFile, content, 0644); err != nil { - extension.logger.Error("Unable to write " + JSONOutputFile + " " + err.Error()) - } else { - extension.logger.Info(JSONOutputFile + " is refreshed") - extension.logger.Info(string(content)) - } - } - case collectorpb.ResultCode_TRY_LATER: - extension.logger.Warn("GetSettings returned TRY_LATER " + response.GetWarning()) - case collectorpb.ResultCode_INVALID_API_KEY: - extension.logger.Warn("GetSettings returned INVALID_API_KEY " + response.GetWarning()) - case collectorpb.ResultCode_LIMIT_EXCEEDED: - extension.logger.Warn("GetSettings returned LIMIT_EXCEEDED " + response.GetWarning()) - case collectorpb.ResultCode_REDIRECT: - extension.logger.Warn("GetSettings returned REDIRECT " + response.GetWarning()) - default: - extension.logger.Warn("Unknown ResultCode from GetSettings " + response.GetWarning()) - } - } - } -} - -func (extension *solarwindsapmSettingsExtension) Start(ctx context.Context, _ component.Host) error { - extension.logger.Debug("Starting up solarwinds apm settings extension") - ctx = context.Background() - ctx, extension.cancel = context.WithCancel(ctx) - - var err error - extension.conn, err = grpc.Dial(extension.config.Endpoint, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))) - if err != nil { - return fmt.Errorf("Failed to dial: " + err.Error()) - } else { - extension.logger.Info("Dailed to " + extension.config.Endpoint) - } - extension.client = collectorpb.NewTraceCollectorClient(extension.conn) - - // Refresh immediately - Refresh(extension) - - // setup lightweight thread to refresh - var interval time.Duration - interval, err = time.ParseDuration(extension.config.Interval) - go func() { - ticker := time.NewTicker(interval) - defer ticker.Stop() - - for { - select { - case <-ticker.C: - // Refresh at each ticker event - Refresh(extension) - case <-ctx.Done(): - extension.logger.Info("Received ctx.Done() from ticker") - return - } - } - }() - - return nil -} - -func (extension *solarwindsapmSettingsExtension) Shutdown(_ context.Context) error { - extension.logger.Debug("Shutting down solarwinds apm settings extension") - extension.conn.Close() - extension.cancel() - return nil -} diff --git a/collector/extension/solarwindsapmsettingsextension/extension_test.go b/collector/extension/solarwindsapmsettingsextension/extension_test.go deleted file mode 100644 index 0da0c7374c..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/extension_test.go +++ /dev/null @@ -1 +0,0 @@ -package solarwindsapmsettingsextension diff --git a/collector/extension/solarwindsapmsettingsextension/factory.go b/collector/extension/solarwindsapmsettingsextension/factory.go deleted file mode 100644 index 69d2f44b23..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/factory.go +++ /dev/null @@ -1,40 +0,0 @@ -package solarwindsapmsettingsextension - -import ( - "context" - "github.com/open-telemetry/opentelemetry-lambda/collector/extension/solarwindsapmsettingsextension/internal/metadata" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/extension" -) - -const ( - DefaultEndpoint = "apm.collector.cloud.solarwinds.com:443" - DefaultInterval = "1m" -) - -func createDefaultConfig() component.Config { - return &Config{ - Endpoint: DefaultEndpoint, - Interval: DefaultInterval, - } -} - -func createExtension(_ context.Context, settings extension.CreateSettings, cfg component.Config) (extension.Extension, error) { - logger := settings.Logger - extensionCfg := cfg.(*Config) - - settingsExtension := &solarwindsapmSettingsExtension{ - logger: logger, - config: extensionCfg, - } - return settingsExtension, nil -} - -func NewFactory() extension.Factory { - return extension.NewFactory( - metadata.Type, - createDefaultConfig, - createExtension, - metadata.ExtensionStability, - ) -} diff --git a/collector/extension/solarwindsapmsettingsextension/factory_test.go b/collector/extension/solarwindsapmsettingsextension/factory_test.go deleted file mode 100644 index b4824344b5..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/factory_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package solarwindsapmsettingsextension - -import ( - "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component/componenttest" - "testing" -) - -func TestCreateDefaultConfig(t *testing.T) { - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - assert.NotNil(t, cfg, "failed to create default config") - assert.NoError(t, componenttest.CheckConfigStruct(cfg)) - ocfg, ok := factory.CreateDefaultConfig().(*Config) - assert.True(t, ok) - assert.Equal(t, ocfg.Endpoint, DefaultEndpoint) - assert.Equal(t, ocfg.Interval, DefaultInterval) -} diff --git a/collector/extension/solarwindsapmsettingsextension/go.mod b/collector/extension/solarwindsapmsettingsextension/go.mod deleted file mode 100644 index bfab7b2d3c..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/go.mod +++ /dev/null @@ -1,39 +0,0 @@ -module github.com/open-telemetry/opentelemetry-lambda/collector/extension/solarwindsapmsettingsextension - -go 1.20 - -require ( - github.com/gogo/protobuf v1.3.2 - github.com/solarwindscloud/apm-proto v0.0.0-20230912021952-7c5e94624446 - github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/collector/component v0.85.0 - go.opentelemetry.io/collector/extension v0.85.0 - go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.58.1 - google.golang.org/protobuf v1.31.0 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.3 // 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.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.85.0 // indirect - go.opentelemetry.io/collector/confmap v0.85.0 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0014 // indirect - go.opentelemetry.io/collector/pdata v1.0.0-rcv0014 // indirect - go.opentelemetry.io/otel v1.18.0 // indirect - go.opentelemetry.io/otel/metric v1.18.0 // indirect - go.opentelemetry.io/otel/trace v1.18.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/collector/extension/solarwindsapmsettingsextension/go.sum b/collector/extension/solarwindsapmsettingsextension/go.sum deleted file mode 100644 index 71cb76039a..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/go.sum +++ /dev/null @@ -1,102 +0,0 @@ -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/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -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.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -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.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= -github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -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.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= -github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/solarwindscloud/apm-proto v0.0.0-20230912021952-7c5e94624446 h1:ENCOWJIayjKjr+B+sOqJjOCRBA9Oi+JMC242UaB9djY= -github.com/solarwindscloud/apm-proto v0.0.0-20230912021952-7c5e94624446/go.mod h1:PIMzXc8HpB0ryT4Oci4pUz8F0m1X7Q/hVXkQE4jGv6Y= -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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.85.0 h1:RdeUDdX3prvkf0PFFbhMjWLsYUJdxy/d0oovOuObRDs= -go.opentelemetry.io/collector/component v0.85.0/go.mod h1:C3CWpjYa+k7Vjkqes/8abJ/fkCn6FlR1sNkW4QPd+kI= -go.opentelemetry.io/collector/config/configtelemetry v0.85.0 h1:hxKBwHEK4enl4YKtdZCq2rxxIKHrccoChoZlVgG8vbI= -go.opentelemetry.io/collector/config/configtelemetry v0.85.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= -go.opentelemetry.io/collector/confmap v0.85.0 h1:xyshTMElkpCJRCbg9OyGL41f7ToCr+PRBJKuAbGR17I= -go.opentelemetry.io/collector/confmap v0.85.0/go.mod h1:/SNHqYkLagF0TjBjQyCy2Gt3ZF6hTK8VKbaan/ZHuJs= -go.opentelemetry.io/collector/extension v0.85.0 h1:izKozTZ4vOnYdMGhu0ROV69hXCptH6DI8JVkN/ZOEJQ= -go.opentelemetry.io/collector/extension v0.85.0/go.mod h1:l5zRPdhtmBjRmPeOhxJsZ/GRIimq4/HIAq/Rgf70W+o= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0014 h1:C9o0mbP0MyygqFnKueVQK/v9jef6zvuttmTGlKaqhgw= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0014/go.mod h1:0mE3mDLmUrOXVoNsuvj+7dV14h/9HFl/Fy9YTLoLObo= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0014 h1:iT5qH0NLmkGeIdDtnBogYDx7L58t6CaWGL378DEo2QY= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0014/go.mod h1:BRvDrx43kiSoUx3mr7SoA7h9B8+OY99mUK+CZSQFWW4= -go.opentelemetry.io/otel v1.18.0 h1:TgVozPGZ01nHyDZxK5WGPFB9QexeTMXEH7+tIClWfzs= -go.opentelemetry.io/otel v1.18.0/go.mod h1:9lWqYO0Db579XzVuCKFNPDl4s73Voa+zEck3wHaAYQI= -go.opentelemetry.io/otel/metric v1.18.0 h1:JwVzw94UYmbx3ej++CwLUQZxEODDj/pOuTCvzhtRrSQ= -go.opentelemetry.io/otel/metric v1.18.0/go.mod h1:nNSpsVDjWGfb7chbRLUNW+PBNdcSTHD4Uu5pfFMOI0k= -go.opentelemetry.io/otel/trace v1.18.0 h1:NY+czwbHbmndxojTEKiSMHkG2ClNH2PwmcHrdo0JY10= -go.opentelemetry.io/otel/trace v1.18.0/go.mod h1:T2+SGJGuYZY3bjj5rgh/hN7KIrlpWC5nS8Mjvzckz+0= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -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/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.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -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.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -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/googleapis/rpc v0.0.0-20230913181813-007df8e322eb h1:Isk1sSH7bovx8Rti2wZK0UZF6oraBDK74uoyLEEVFN0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= -google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -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/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/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go b/collector/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go deleted file mode 100644 index 224b62419f..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by mdatagen. DO NOT EDIT. - -package metadata - -import ( - "go.opentelemetry.io/collector/component" -) - -const ( - Type = "solarwindsapmsettings" - ExtensionStability = component.StabilityLevelDevelopment -) diff --git a/collector/extension/solarwindsapmsettingsextension/metadata.yaml b/collector/extension/solarwindsapmsettingsextension/metadata.yaml deleted file mode 100644 index 2d0532694a..0000000000 --- a/collector/extension/solarwindsapmsettingsextension/metadata.yaml +++ /dev/null @@ -1,6 +0,0 @@ -type: solarwindsapmsettings - -status: - class: extension - stability: - development: [extension] diff --git a/collector/go.mod b/collector/go.mod index 5d7c588f31..34a8c2cec3 100644 --- a/collector/go.mod +++ b/collector/go.mod @@ -8,8 +8,6 @@ replace github.com/open-telemetry/opentelemetry-lambda/collector/processor/colds replace github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapireceiver => ./receiver/telemetryapireceiver -replace github.com/open-telemetry/opentelemetry-lambda/collector/extension/solarwindsapmsettingsextension => ./extension/solarwindsapmsettingsextension - // fixes ambiguous import error: found package cloud.google.com/go/compute/metadata in multiple modules: // cloud.google.com/go // cloud.google.com/go/compute @@ -133,7 +131,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.85.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.85.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.85.0 // indirect - github.com/open-telemetry/opentelemetry-lambda/collector/extension/solarwindsapmsettingsextension v0.0.0-00010101000000-000000000000 // indirect github.com/open-telemetry/opentelemetry-lambda/collector/processor/coldstartprocessor v0.84.0 // indirect github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapireceiver v0.84.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect @@ -150,6 +147,7 @@ require ( github.com/rs/cors v1.10.0 // indirect github.com/shirou/gopsutil/v3 v3.23.8 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/solarwinds/opentelemetry-collector-contrib/extension/solarwindsapmsettingsextension v0.0.0-20231103200316-8f39128f4706 // indirect github.com/solarwindscloud/apm-proto v0.0.0-20230912021952-7c5e94624446 // indirect github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/collector/go.sum b/collector/go.sum index 4507c5c47d..0f341f3bc5 100644 --- a/collector/go.sum +++ b/collector/go.sum @@ -760,6 +760,8 @@ github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnj github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/solarwinds/opentelemetry-collector-contrib/extension/solarwindsapmsettingsextension v0.0.0-20231103200316-8f39128f4706 h1:IXA1I7FXZWBKbpzk+rNeucrcYITMfOvXm25BKxVGsoE= +github.com/solarwinds/opentelemetry-collector-contrib/extension/solarwindsapmsettingsextension v0.0.0-20231103200316-8f39128f4706/go.mod h1:x3vM4tJ9INNZ9bGayt3bIKRve9sEd/9hq1NGeo1yLv0= github.com/solarwindscloud/apm-proto v0.0.0-20230912021952-7c5e94624446 h1:ENCOWJIayjKjr+B+sOqJjOCRBA9Oi+JMC242UaB9djY= github.com/solarwindscloud/apm-proto v0.0.0-20230912021952-7c5e94624446/go.mod h1:PIMzXc8HpB0ryT4Oci4pUz8F0m1X7Q/hVXkQE4jGv6Y= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= diff --git a/collector/lambdacomponents/default.go b/collector/lambdacomponents/default.go index 07f762b27c..4bb0b6dbc0 100644 --- a/collector/lambdacomponents/default.go +++ b/collector/lambdacomponents/default.go @@ -23,7 +23,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor" - "github.com/open-telemetry/opentelemetry-lambda/collector/extension/solarwindsapmsettingsextension" + "github.com/solarwinds/opentelemetry-collector-contrib/extension/solarwindsapmsettingsextension" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/loggingexporter" "go.opentelemetry.io/collector/exporter/otlpexporter" diff --git a/collector/lambdacomponents/go.mod b/collector/lambdacomponents/go.mod index 2b564ac7a1..987651fe04 100644 --- a/collector/lambdacomponents/go.mod +++ b/collector/lambdacomponents/go.mod @@ -11,7 +11,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.85.0 - github.com/open-telemetry/opentelemetry-lambda/collector/extension/solarwindsapmsettingsextension v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-lambda/collector/processor/coldstartprocessor v0.84.0 github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapireceiver v0.84.0 go.opentelemetry.io/collector v0.85.0 @@ -225,5 +224,3 @@ replace github.com/open-telemetry/opentelemetry-lambda/collector => ../ replace github.com/open-telemetry/opentelemetry-lambda/collector/processor/coldstartprocessor => ../processor/coldstartprocessor replace github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapireceiver => ../receiver/telemetryapireceiver - -replace github.com/open-telemetry/opentelemetry-lambda/collector/extension/solarwindsapmsettingsextension => ../extension/solarwindsapmsettingsextension