From 5a8bad1bf45433becc9533921e1c01e632f095a9 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 19 Apr 2022 15:55:58 -0400 Subject: [PATCH 01/48] wip --- receiver/nsxreceiver/client.go | 50 ++ receiver/nsxreceiver/config.go | 20 + receiver/nsxreceiver/config_test.go | 1 + receiver/nsxreceiver/documentation.md | 24 + receiver/nsxreceiver/factory.go | 35 + receiver/nsxreceiver/factory_test.go | 1 + receiver/nsxreceiver/go.mod | 31 + receiver/nsxreceiver/go.sum | 715 ++++++++++++++++++ .../internal/metadata/generated_metrics_v2.go | 111 +++ receiver/nsxreceiver/metadata.yaml | 1 + 10 files changed, 989 insertions(+) create mode 100644 receiver/nsxreceiver/client.go create mode 100644 receiver/nsxreceiver/config.go create mode 100644 receiver/nsxreceiver/config_test.go create mode 100644 receiver/nsxreceiver/documentation.md create mode 100644 receiver/nsxreceiver/factory.go create mode 100644 receiver/nsxreceiver/factory_test.go create mode 100644 receiver/nsxreceiver/go.mod create mode 100644 receiver/nsxreceiver/go.sum create mode 100644 receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go create mode 100644 receiver/nsxreceiver/metadata.yaml diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go new file mode 100644 index 000000000000..b30443fa2dff --- /dev/null +++ b/receiver/nsxreceiver/client.go @@ -0,0 +1,50 @@ +package nsxreceiver + +import ( + "context" + "fmt" + + nsxt "github.com/vmware/go-vmware-nsxt" +) + +type client struct { + nsxtConf *nsxt.Configuration + driver *nsxt.APIClient +} + +const defaultMaxRetries = 3 +const defaultRetryMinDelay = 5 +const defaultRetryMaxDelay = 10 + +func newClient(c *Config) *client { + retriesConfiguration := nsxt.ClientRetriesConfiguration{ + MaxRetries: defaultMaxRetries, + RetryMinDelay: defaultRetryMinDelay, + RetryMaxDelay: defaultMaxRetries, + } + return &client{ + nsxtConf: &nsxt.Configuration{ + BasePath: "/api/v1", + Host: c.Host, + UserName: c.Username, + Password: c.Password, + Insecure: c.Insecure, + CAFile: c.CAFile, + RetriesConfiguration: retriesConfiguration, + }, + } +} + +func (c *client) Connect(ctx context.Context) error { + driver, err := nsxt.NewAPIClient(c.nsxtConf) + if err != nil { + return fmt.Errorf("unable to connect to NSXT API: %w", err) + } + c.driver = driver + return nil +} + +func (c *client) Disconnect(ctx context.Context) error { + if c.driver != nil { + } +} diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go new file mode 100644 index 000000000000..de6eb59cf7dc --- /dev/null +++ b/receiver/nsxreceiver/config.go @@ -0,0 +1,20 @@ +package nsxreceiver + +import ( + "go.opentelemetry.io/collector/config/configtls" + "go.opentelemetry.io/collector/receiver/scraperhelper" +) + +// Config is the configuraiton for the NSX receiver +type Config struct { + scraperhelper.ScraperControllerSettings `mapstructure:",squash"` + configtls.TLSClientSetting `mapstructure:",squash"` + Host string `mapstructure:"host"` + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` +} + +// Validate returns if the NSX configuration is valid +func (c *Config) Validate() error { + return nil +} diff --git a/receiver/nsxreceiver/config_test.go b/receiver/nsxreceiver/config_test.go new file mode 100644 index 000000000000..83ee8b5dc7c1 --- /dev/null +++ b/receiver/nsxreceiver/config_test.go @@ -0,0 +1 @@ +package nsxreceiver diff --git a/receiver/nsxreceiver/documentation.md b/receiver/nsxreceiver/documentation.md new file mode 100644 index 000000000000..76a1002c443c --- /dev/null +++ b/receiver/nsxreceiver/documentation.md @@ -0,0 +1,24 @@ +[comment]: <> (Code generated by mdatagen. DO NOT EDIT.) + +# nsxreceiver + +## Metrics + +These are the metrics available for this scraper. + +| Name | Description | Unit | Type | Attributes | +| ---- | ----------- | ---- | ---- | ---------- | + +**Highlighted metrics** are emitted by default. Other metrics are optional and not emitted by default. +Any metric can be enabled or disabled with the following scraper configuration: + +```yaml +metrics: + : + enabled: +``` + +## Metric attributes + +| Name | Description | Values | +| ---- | ----------- | ------ | diff --git a/receiver/nsxreceiver/factory.go b/receiver/nsxreceiver/factory.go new file mode 100644 index 000000000000..3d615bcbdd00 --- /dev/null +++ b/receiver/nsxreceiver/factory.go @@ -0,0 +1,35 @@ +package nsxreceiver + +import ( + "context" + "errors" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver/scraperhelper" +) + +const typeStr = "nsx" + +var errConfigNotNSX = errors.New("config was not a NSX receiver config") + +// NewFactory creates a new receiver factory +func NewFactory() component.ReceiverFactory { + return component.NewReceiverFactory( + typeStr, + createDefaultConfig, + component.WithMetricsReceiver(createMetricsReceiver)) +} + +func createDefaultConfig() config.Receiver { + return &Config{} +} + +func createMetricsReceiver(ctx context.Context, params component.ReceiverCreateSettings, rConf config.Receiver, consumer consumer.Metrics) (component.MetricsReceiver, error) { + cfg, ok := rConf.(*Config) + if !ok { + return nil, errConfigNotNSX + } + return scraperhelper.NewScraperControllerReceiver(&cfg.ScraperControllerSettings, params, consumer) +} diff --git a/receiver/nsxreceiver/factory_test.go b/receiver/nsxreceiver/factory_test.go new file mode 100644 index 000000000000..83ee8b5dc7c1 --- /dev/null +++ b/receiver/nsxreceiver/factory_test.go @@ -0,0 +1 @@ +package nsxreceiver diff --git a/receiver/nsxreceiver/go.mod b/receiver/nsxreceiver/go.mod new file mode 100644 index 000000000000..7a155a64d4e1 --- /dev/null +++ b/receiver/nsxreceiver/go.mod @@ -0,0 +1,31 @@ +module github.com/observiq/opentelemetry-collector-contrib/receiver/nsxreceiver + +go 1.17 + +require ( + go.opentelemetry.io/collector v0.49.0 + go.opentelemetry.io/collector/pdata v0.49.0 +) + +require ( + github.com/antihax/optional v1.0.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/knadh/koanf v1.4.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f // indirect + go.opencensus.io v0.23.0 // indirect + go.opentelemetry.io/otel v1.6.3 // indirect + go.opentelemetry.io/otel/metric v0.29.0 // indirect + go.opentelemetry.io/otel/trace v1.6.3 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect + google.golang.org/appengine v1.4.0 // indirect + google.golang.org/protobuf v1.28.0 // indirect +) diff --git a/receiver/nsxreceiver/go.sum b/receiver/nsxreceiver/go.sum new file mode 100644 index 000000000000..92d36704bb7a --- /dev/null +++ b/receiver/nsxreceiver/go.sum @@ -0,0 +1,715 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= +contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= +github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= +github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= +github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= +github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +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/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +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/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/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +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/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +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.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +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.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +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.4.1/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.1/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.4/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.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +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.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= +github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +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/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +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/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mostynb/go-grpc-compression v1.1.16/go.mod h1:xxa6UoYynYS2h+5HB/Hglu81iYAp87ARaNmhhwi0s1s= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pierrec/cmdflag v0.0.2/go.mod h1:a3zKGZ3cdQUfxjd0RGMLZr8xI3nvpJOB+m6o/1X5BmU= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v3 v3.3.4/go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= +github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/schollz/progressbar/v2 v2.13.2/go.mod h1:6YZjqdthH6SCZKv2rqGryrxPtfmRB/DWZxSMfCXPyD8= +github.com/shirou/gopsutil/v3 v3.22.3/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= +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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= +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.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f h1:NbC9yOr5At92seXK+kOr2TzU3mIWzcJOVzZasGSuwoU= +github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f/go.mod h1:VEqcmf4Sp7gPB7z05QGyKVmn6xWppr7Nz8cVNvyC80o= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/collector v0.49.0 h1:brKMIUwlL1bt0Faxqqxvj7549KWm9FEN77Z4i4RAlDE= +go.opentelemetry.io/collector v0.49.0/go.mod h1:ErYGC1VzzrpK/uM134DJIbARX3jl9vtTqgIXsiWxjGE= +go.opentelemetry.io/collector/model v0.49.0/go.mod h1:nOYQv9KoFPs6ihJwOi24qB209EOhS9HkwhGj54YiEAw= +go.opentelemetry.io/collector/pdata v0.49.0 h1:aYj5rOlRC0x7lGXbc185LMsMMoY/pjOTXr5s1O2SzXs= +go.opentelemetry.io/collector/pdata v0.49.0/go.mod h1:YwmKuiFhNgtmhRdpi8Q8FAWPa0AwJTCSlssSsAtuRcY= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.31.0/go.mod h1:SY9qHHUES6W3oZnO1H2W8NvsSovIoXRg/A1AH9px8+I= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0/go.mod h1:PFmBsWbldL1kiWZk9+0LBZz2brhByaGsvp6pRICMlPE= +go.opentelemetry.io/contrib/zpages v0.31.0/go.mod h1:CAB55C1K7YhinQfNNIdNLgJJ+dVRlb6zQpbGQjeIDf8= +go.opentelemetry.io/otel v1.6.0/go.mod h1:bfJD2DZVw0LBxghOTlgnlI0CV3hLDu9XF/QKOUXMTQQ= +go.opentelemetry.io/otel v1.6.1/go.mod h1:blzUabWHkX6LJewxvadmzafgh/wnvBSDBdOuwkAtrWQ= +go.opentelemetry.io/otel v1.6.3 h1:FLOfo8f9JzFVFVyU+MSRJc2HdEAXQgm7pIv2uFKRSZE= +go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= +go.opentelemetry.io/otel/exporters/prometheus v0.29.0/go.mod h1:Er2VVJQZbHysogooLNchdZ3MLYoI7+d15mHmrRlRJCU= +go.opentelemetry.io/otel/metric v0.28.0/go.mod h1:TrzsfQAmQaB1PDcdhBauLMk7nyyg9hm+GoQq/ekE9Iw= +go.opentelemetry.io/otel/metric v0.29.0 h1:7unM/I13Dbc1VHw8lTPQ7zfNIgkhcb8BZhujXOS4jKc= +go.opentelemetry.io/otel/metric v0.29.0/go.mod h1:HahKFp1OC1RNTsuO/HNMBHHJR+dmHZ7wLARRgGDwjLQ= +go.opentelemetry.io/otel/sdk v1.6.1/go.mod h1:IVYrddmFZ+eJqu2k38qD3WezFR2pymCzm8tdxyh3R4E= +go.opentelemetry.io/otel/sdk v1.6.3 h1:prSHYdwCQOX5DrsEzxowH3nLhoAzEBdZhvrR79scfLs= +go.opentelemetry.io/otel/sdk v1.6.3/go.mod h1:A4iWF7HTXa+GWL/AaqESz28VuSBIcZ+0CV+IzJ5NMiQ= +go.opentelemetry.io/otel/sdk/metric v0.29.0/go.mod h1:IFkFNKI8Gq8zBdqOKdODCL9+LInBZLXaGpqSIKphNuU= +go.opentelemetry.io/otel/trace v1.6.0/go.mod h1:qs7BrU5cZ8dXQHBGxHMOxwME/27YH2qEp4/+tZLLwJE= +go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7TXluRBtE+5j0= +go.opentelemetry.io/otel/trace v1.6.3 h1:IqN4L+5b0mPNjdXIiZ90Ni4Bl5BRkDQywePLWemd9bc= +go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +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/mod v0.4.2/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +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.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +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.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go new file mode 100644 index 000000000000..00905c16f3ec --- /dev/null +++ b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go @@ -0,0 +1,111 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +// MetricSettings provides common settings for a particular metric. +type MetricSettings struct { + Enabled bool `mapstructure:"enabled"` +} + +// MetricsSettings provides settings for nsxreceiver metrics. +type MetricsSettings struct { +} + +func DefaultMetricsSettings() MetricsSettings { + return MetricsSettings{} +} + +// MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations +// required to produce metric representation defined in metadata and user settings. +type MetricsBuilder struct { + startTime pcommon.Timestamp // start time that will be applied to all recorded data points. + metricsCapacity int // maximum observed number of metrics per resource. + resourceCapacity int // maximum observed number of resource attributes. + metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. +} + +// metricBuilderOption applies changes to default metrics builder. +type metricBuilderOption func(*MetricsBuilder) + +// WithStartTime sets startTime on the metrics builder. +func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { + return func(mb *MetricsBuilder) { + mb.startTime = startTime + } +} + +func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder { + mb := &MetricsBuilder{ + startTime: pcommon.NewTimestampFromTime(time.Now()), + metricsBuffer: pmetric.NewMetrics(), + } + for _, op := range options { + op(mb) + } + return mb +} + +// updateCapacity updates max length of metrics and resource attributes that will be used for the slice capacity. +func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { + if mb.metricsCapacity < rm.ScopeMetrics().At(0).Metrics().Len() { + mb.metricsCapacity = rm.ScopeMetrics().At(0).Metrics().Len() + } + if mb.resourceCapacity < rm.Resource().Attributes().Len() { + mb.resourceCapacity = rm.Resource().Attributes().Len() + } +} + +// ResourceOption applies changes to provided resource. +type ResourceOption func(pcommon.Resource) + +// EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for +// recording another set of data points as part of another resource. This function can be helpful when one scraper +// needs to emit metrics from several resources. Otherwise calling this function is not required, +// just `Emit` function can be called instead. Resource attributes should be provided as ResourceOption arguments. +func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption) { + rm := pmetric.NewResourceMetrics() + rm.Resource().Attributes().EnsureCapacity(mb.resourceCapacity) + for _, op := range ro { + op(rm.Resource()) + } + ils := rm.ScopeMetrics().AppendEmpty() + ils.Scope().SetName("otelcol/nsxreceiver") + ils.Metrics().EnsureCapacity(mb.metricsCapacity) + if ils.Metrics().Len() > 0 { + mb.updateCapacity(rm) + rm.MoveTo(mb.metricsBuffer.ResourceMetrics().AppendEmpty()) + } +} + +// Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for +// recording another set of metrics. This function will be responsible for applying all the transformations required to +// produce metric representation defined in metadata and user settings, e.g. delta or cumulative. +func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics { + mb.EmitForResource(ro...) + metrics := pmetric.NewMetrics() + mb.metricsBuffer.MoveTo(metrics) + return metrics +} + +// Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, +// and metrics builder should update its startTime and reset it's internal state accordingly. +func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { + mb.startTime = pcommon.NewTimestampFromTime(time.Now()) + for _, op := range options { + op(mb) + } +} + +// Attributes contains the possible metric attributes that can be used. +var Attributes = struct { +}{} + +// A is an alias for Attributes. +var A = Attributes diff --git a/receiver/nsxreceiver/metadata.yaml b/receiver/nsxreceiver/metadata.yaml new file mode 100644 index 000000000000..4d8659d5348c --- /dev/null +++ b/receiver/nsxreceiver/metadata.yaml @@ -0,0 +1 @@ +name: nsxreceiver From 0f06ef7671d6e8d31460c0d5e0cd206a4038a0be Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 27 Apr 2022 14:28:00 -0400 Subject: [PATCH 02/48] mostly working independent client --- cmd/configschema/go.mod | 2 + go.mod | 5 + go.sum | 3 + internal/components/components.go | 2 + receiver/nsxreceiver/client.go | 150 +++++-- receiver/nsxreceiver/config.go | 24 +- receiver/nsxreceiver/factory.go | 26 +- receiver/nsxreceiver/go.mod | 23 +- receiver/nsxreceiver/go.sum | 407 +----------------- .../nsxreceiver/internal/model/interface.go | 13 + receiver/nsxreceiver/internal/model/node.go | 60 +++ receiver/nsxreceiver/internal/model/router.go | 5 + receiver/nsxreceiver/metadata.yaml | 32 ++ receiver/nsxreceiver/scraper.go | 114 +++++ 14 files changed, 433 insertions(+), 433 deletions(-) create mode 100644 receiver/nsxreceiver/internal/model/interface.go create mode 100644 receiver/nsxreceiver/internal/model/node.go create mode 100644 receiver/nsxreceiver/internal/model/router.go create mode 100644 receiver/nsxreceiver/scraper.go diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index 7c9fc1b93250..7714d6e04a35 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -754,6 +754,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongo replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver => ../../receiver/mysqlreceiver +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver => ../../receiver/nsxreceiver + replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver => ../../receiver/opencensusreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver => ../../receiver/podmanreceiver diff --git a/go.mod b/go.mod index 381cb37dafcc..ce8726cfd102 100644 --- a/go.mod +++ b/go.mod @@ -104,6 +104,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver v0.49.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver v0.49.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver v0.49.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.49.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver v0.49.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver v0.49.0 @@ -171,6 +172,7 @@ require ( github.com/StackExchange/wmi v1.2.1 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/aliyun/aliyun-log-go-sdk v0.1.29 // indirect + github.com/antihax/optional v1.0.0 // indirect github.com/antonmedv/expr v1.9.0 // indirect github.com/apache/thrift v0.16.0 // indirect github.com/armon/go-metrics v0.3.10 // indirect @@ -431,6 +433,7 @@ require ( github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f // indirect github.com/wavefronthq/wavefront-sdk-go v0.9.11 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.1 // indirect @@ -758,6 +761,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongo replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver => ./receiver/mysqlreceiver +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver => ./receiver/nsxreceiver + replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver => ./receiver/opencensusreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver => ./receiver/podmanreceiver diff --git a/go.sum b/go.sum index f9602b4a6293..b91ba3c3e1d9 100644 --- a/go.sum +++ b/go.sum @@ -240,6 +240,7 @@ github.com/aliyun/aliyun-log-go-sdk v0.1.29/go.mod h1:aBG0R+MWRTgvlIODQkz+a3/RM9 github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antonmedv/expr v1.9.0 h1:j4HI3NHEdgDnN9p6oI6Ndr0G5QryMY0FNxT4ONrFDGU= github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= @@ -2115,6 +2116,8 @@ github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vb github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f h1:NbC9yOr5At92seXK+kOr2TzU3mIWzcJOVzZasGSuwoU= +github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f/go.mod h1:VEqcmf4Sp7gPB7z05QGyKVmn6xWppr7Nz8cVNvyC80o= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= github.com/wavefronthq/wavefront-sdk-go v0.9.11 h1:3qv/yyNNyLKPQftQWFrfHGUv50e/gMxKlUQnILlvHKw= github.com/wavefronthq/wavefront-sdk-go v0.9.11/go.mod h1:AcW8zJJcYodB7B9KYzoxVH6K0fmYd6MgpmXE1LMo+OU= diff --git a/internal/components/components.go b/internal/components/components.go index 64e73eb20ba3..7185c00ca03c 100644 --- a/internal/components/components.go +++ b/internal/components/components.go @@ -124,6 +124,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver" @@ -204,6 +205,7 @@ func Components() (component.Factories, error) { memcachedreceiver.NewFactory(), mongodbatlasreceiver.NewFactory(), mysqlreceiver.NewFactory(), + nsxreceiver.NewFactory(), opencensusreceiver.NewFactory(), otlpreceiver.NewFactory(), podmanreceiver.NewFactory(), diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go index b30443fa2dff..ca84ad69a350 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxreceiver/client.go @@ -2,49 +2,149 @@ package nsxreceiver import ( "context" + "encoding/json" + "errors" "fmt" + "io" + "net/http" + "net/url" + "strings" nsxt "github.com/vmware/go-vmware-nsxt" + "github.com/vmware/go-vmware-nsxt/manager" + "go.opentelemetry.io/collector/component" + + dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" ) -type client struct { - nsxtConf *nsxt.Configuration +type nsxClient struct { + config *Config driver *nsxt.APIClient + client *http.Client + endpoint *url.URL } +var ( + errUnauthenticated = errors.New("STATUS 401, unauthenticated") + errUnauthorized = errors.New("STATUS 403, unauthorized") +) + const defaultMaxRetries = 3 const defaultRetryMinDelay = 5 const defaultRetryMaxDelay = 10 -func newClient(c *Config) *client { - retriesConfiguration := nsxt.ClientRetriesConfiguration{ - MaxRetries: defaultMaxRetries, - RetryMinDelay: defaultRetryMinDelay, - RetryMaxDelay: defaultMaxRetries, - } - return &client{ - nsxtConf: &nsxt.Configuration{ - BasePath: "/api/v1", - Host: c.Host, - UserName: c.Username, - Password: c.Password, - Insecure: c.Insecure, - CAFile: c.CAFile, - RetriesConfiguration: retriesConfiguration, - }, +func newClient(c *Config, settings component.TelemetrySettings, host component.Host) (*nsxClient, error) { + client, err := c.MetricsConfig.HTTPClientSettings.ToClient(host.GetExtensions(), settings) + if err != nil { + return nil, err + } + + endpoint, err := url.Parse(c.MetricsConfig.Endpoint) + if err != nil { + return nil, err + } + + return &nsxClient{ + config: c, + client: client, + endpoint: endpoint, + }, nil +} + +func (c *nsxClient) LogicalSwitches(ctx context.Context) (*manager.SwitchingProfilesListResult, error) { + body, err := c.doRequest(ctx, "/fabric/logical-switches", nil) + if err != nil { + return nil, err } + var switches manager.SwitchingProfilesListResult + err = json.Unmarshal(body, &switches) + return &switches, err } -func (c *client) Connect(ctx context.Context) error { - driver, err := nsxt.NewAPIClient(c.nsxtConf) +func (c *nsxClient) Nodes(ctx context.Context) ([]dm.NodeStat, error) { + body, err := c.doRequest(ctx, "/api/v1/transport-nodes", nil) + if err != nil { + return nil, err + } + var nodes manager.NodeListResult + err = json.Unmarshal(body, &nodes) + + nodeIDs := []string{} + for _, n := range nodes.Results { + nodeIDs = append(nodeIDs, n.Id) + } + + nodeStatsBody, err := c.doRequest(ctx, "/api/v1/fabric/nodes/status", withQuery("node_ids", strings.Join(nodeIDs, ","))) if err != nil { - return fmt.Errorf("unable to connect to NSXT API: %w", err) + return nil, err } - c.driver = driver - return nil + + var nodeStats dm.NodeStatListResult + err = json.Unmarshal(nodeStatsBody, &nodeStats) + if err != nil { + return nil, err + } + + return nodeStats.Results, err } -func (c *client) Disconnect(ctx context.Context) error { - if c.driver != nil { +func (c *nsxClient) Interfaces(ctx context.Context, nodeID string) ([]dm.NetworkInterface, error) { + body, err := c.doRequest( + ctx, + fmt.Sprintf("/api/v1/fabric/nodes/%s/network/interfaces", nodeID), + nil, + ) + if err != nil { + return nil, err + } + var interfaces dm.NodeNetworkInterfacePropertiesListResult + err = json.Unmarshal(body, &interfaces) + + return interfaces.Results, err +} + +type requestOption func(req *http.Request) + +func withQuery(key string, value string) requestOption { + return func(req *http.Request) { + q := req.URL.Query() + q.Add(key, value) + } +} + +func (c *nsxClient) doRequest(ctx context.Context, path string, options ...requestOption) ([]byte, error) { + endpoint, err := c.endpoint.Parse(path) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint.String(), nil) + if err != nil { + return nil, err + } + req.SetBasicAuth(c.config.MetricsConfig.Username, c.config.MetricsConfig.Password) + + for _, op := range options { + op(req) + } + + resp, err := c.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode == http.StatusOK { + return io.ReadAll(resp.Body) + } + + _, err = io.ReadAll(resp.Body) + switch resp.StatusCode { + case 401: + return nil, errUnauthenticated + case 403: + return nil, errUnauthorized + default: + return nil, fmt.Errorf("got non 200 status code %d", resp.StatusCode) } } diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index de6eb59cf7dc..f8f6caaf6583 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -1,20 +1,34 @@ package nsxreceiver import ( - "go.opentelemetry.io/collector/config/configtls" + "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/receiver/scraperhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" ) // Config is the configuraiton for the NSX receiver type Config struct { + config.ReceiverSettings `mapstructure:",squash"` + MetricsConfig MetricsConfig `mapstructure:"metrics"` +} + +// MetricsConfig is the metrics configuration portion of the nsxreceiver +type MetricsConfig struct { scraperhelper.ScraperControllerSettings `mapstructure:",squash"` - configtls.TLSClientSetting `mapstructure:",squash"` - Host string `mapstructure:"host"` - Username string `mapstructure:"username"` - Password string `mapstructure:"password"` + confighttp.HTTPClientSettings `mapstructure:",squash"` + Settings metadata.MetricsSettings `mapstructure:"settings"` + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` } // Validate returns if the NSX configuration is valid func (c *Config) Validate() error { return nil } + +// ID returns the underlying MetricsConfig's ID +func (c *Config) ID() config.ComponentID { + return c.MetricsConfig.ID() +} diff --git a/receiver/nsxreceiver/factory.go b/receiver/nsxreceiver/factory.go index 3d615bcbdd00..f143af43f02b 100644 --- a/receiver/nsxreceiver/factory.go +++ b/receiver/nsxreceiver/factory.go @@ -4,6 +4,7 @@ import ( "context" "errors" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" @@ -23,7 +24,12 @@ func NewFactory() component.ReceiverFactory { } func createDefaultConfig() config.Receiver { - return &Config{} + return &Config{ + MetricsConfig: MetricsConfig{ + ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(typeStr), + Settings: metadata.DefaultMetricsSettings(), + }, + } } func createMetricsReceiver(ctx context.Context, params component.ReceiverCreateSettings, rConf config.Receiver, consumer consumer.Metrics) (component.MetricsReceiver, error) { @@ -31,5 +37,21 @@ func createMetricsReceiver(ctx context.Context, params component.ReceiverCreateS if !ok { return nil, errConfigNotNSX } - return scraperhelper.NewScraperControllerReceiver(&cfg.ScraperControllerSettings, params, consumer) + s := newScraper(cfg, params.TelemetrySettings) + + scraper, err := scraperhelper.NewScraper( + typeStr, + s.scrape, + scraperhelper.WithStart(s.start), + ) + if err != nil { + return nil, err + } + + return scraperhelper.NewScraperControllerReceiver( + &cfg.MetricsConfig.ScraperControllerSettings, + params, + consumer, + scraperhelper.AddScraper(scraper), + ) } diff --git a/receiver/nsxreceiver/go.mod b/receiver/nsxreceiver/go.mod index 7a155a64d4e1..2198464e57ad 100644 --- a/receiver/nsxreceiver/go.mod +++ b/receiver/nsxreceiver/go.mod @@ -1,4 +1,4 @@ -module github.com/observiq/opentelemetry-collector-contrib/receiver/nsxreceiver +module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver go 1.17 @@ -16,8 +16,9 @@ require ( github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f // indirect + github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f go.opencensus.io v0.23.0 // indirect + go.opentelemetry.io/collector/model v0.49.0 go.opentelemetry.io/otel v1.6.3 // indirect go.opentelemetry.io/otel/metric v0.29.0 // indirect go.opentelemetry.io/otel/trace v1.6.3 // indirect @@ -25,7 +26,23 @@ require ( go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect google.golang.org/appengine v1.4.0 // indirect google.golang.org/protobuf v1.28.0 // indirect ) + +require ( + github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/klauspost/compress v1.15.1 // indirect + github.com/rs/cors v1.8.2 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/grpc v1.45.0 // indirect +) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest => ../../internal/scrapertest + +replace go.opentelemetry.io/collector/semconv => go.opentelemetry.io/collector/semconv v0.0.0-20220422001137-87ab5de64ce4 diff --git a/receiver/nsxreceiver/go.sum b/receiver/nsxreceiver/go.sum index 92d36704bb7a..b7ca16b9bdb4 100644 --- a/receiver/nsxreceiver/go.sum +++ b/receiver/nsxreceiver/go.sum @@ -1,46 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= -contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -57,29 +17,16 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21 github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -87,60 +34,32 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= -github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 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/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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= @@ -153,37 +72,20 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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.4.1/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.1/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.4/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.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -207,43 +109,22 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 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.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= 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= @@ -258,120 +139,58 @@ github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= 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/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mostynb/go-grpc-compression v1.1.16/go.mod h1:xxa6UoYynYS2h+5HB/Hglu81iYAp87ARaNmhhwi0s1s= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pierrec/cmdflag v0.0.2/go.mod h1:a3zKGZ3cdQUfxjd0RGMLZr8xI3nvpJOB+m6o/1X5BmU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v3 v3.3.4/go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/schollz/progressbar/v2 v2.13.2/go.mod h1:6YZjqdthH6SCZKv2rqGryrxPtfmRB/DWZxSMfCXPyD8= -github.com/shirou/gopsutil/v3 v3.22.3/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= -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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= 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.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f h1:NbC9yOr5At92seXK+kOr2TzU3mIWzcJOVzZasGSuwoU= github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f/go.mod h1:VEqcmf4Sp7gPB7z05QGyKVmn6xWppr7Nz8cVNvyC80o= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.49.0 h1:brKMIUwlL1bt0Faxqqxvj7549KWm9FEN77Z4i4RAlDE= go.opentelemetry.io/collector v0.49.0/go.mod h1:ErYGC1VzzrpK/uM134DJIbARX3jl9vtTqgIXsiWxjGE= +go.opentelemetry.io/collector/model v0.49.0 h1:mbUSNgpaBE3GWmzGsRb5t0xILpXIVYv7scPTTfoMt6c= go.opentelemetry.io/collector/model v0.49.0/go.mod h1:nOYQv9KoFPs6ihJwOi24qB209EOhS9HkwhGj54YiEAw= go.opentelemetry.io/collector/pdata v0.49.0 h1:aYj5rOlRC0x7lGXbc185LMsMMoY/pjOTXr5s1O2SzXs= go.opentelemetry.io/collector/pdata v0.49.0/go.mod h1:YwmKuiFhNgtmhRdpi8Q8FAWPa0AwJTCSlssSsAtuRcY= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.31.0/go.mod h1:SY9qHHUES6W3oZnO1H2W8NvsSovIoXRg/A1AH9px8+I= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 h1:woM+Mb4d0A+Dxa3rYPenSN5ZeS9qHUvE8rlObiLRXTY= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0/go.mod h1:PFmBsWbldL1kiWZk9+0LBZz2brhByaGsvp6pRICMlPE= -go.opentelemetry.io/contrib/zpages v0.31.0/go.mod h1:CAB55C1K7YhinQfNNIdNLgJJ+dVRlb6zQpbGQjeIDf8= go.opentelemetry.io/otel v1.6.0/go.mod h1:bfJD2DZVw0LBxghOTlgnlI0CV3hLDu9XF/QKOUXMTQQ= go.opentelemetry.io/otel v1.6.1/go.mod h1:blzUabWHkX6LJewxvadmzafgh/wnvBSDBdOuwkAtrWQ= go.opentelemetry.io/otel v1.6.3 h1:FLOfo8f9JzFVFVyU+MSRJc2HdEAXQgm7pIv2uFKRSZE= go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= -go.opentelemetry.io/otel/exporters/prometheus v0.29.0/go.mod h1:Er2VVJQZbHysogooLNchdZ3MLYoI7+d15mHmrRlRJCU= go.opentelemetry.io/otel/metric v0.28.0/go.mod h1:TrzsfQAmQaB1PDcdhBauLMk7nyyg9hm+GoQq/ekE9Iw= go.opentelemetry.io/otel/metric v0.29.0 h1:7unM/I13Dbc1VHw8lTPQ7zfNIgkhcb8BZhujXOS4jKc= go.opentelemetry.io/otel/metric v0.29.0/go.mod h1:HahKFp1OC1RNTsuO/HNMBHHJR+dmHZ7wLARRgGDwjLQ= -go.opentelemetry.io/otel/sdk v1.6.1/go.mod h1:IVYrddmFZ+eJqu2k38qD3WezFR2pymCzm8tdxyh3R4E= go.opentelemetry.io/otel/sdk v1.6.3 h1:prSHYdwCQOX5DrsEzxowH3nLhoAzEBdZhvrR79scfLs= -go.opentelemetry.io/otel/sdk v1.6.3/go.mod h1:A4iWF7HTXa+GWL/AaqESz28VuSBIcZ+0CV+IzJ5NMiQ= -go.opentelemetry.io/otel/sdk/metric v0.29.0/go.mod h1:IFkFNKI8Gq8zBdqOKdODCL9+LInBZLXaGpqSIKphNuU= go.opentelemetry.io/otel/trace v1.6.0/go.mod h1:qs7BrU5cZ8dXQHBGxHMOxwME/27YH2qEp4/+tZLLwJE= go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7TXluRBtE+5j0= go.opentelemetry.io/otel/trace v1.6.3 h1:IqN4L+5b0mPNjdXIiZ90Ni4Bl5BRkDQywePLWemd9bc= @@ -387,204 +206,72 @@ go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/mod v0.4.2/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -592,80 +279,24 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= 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= @@ -675,41 +306,21 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/receiver/nsxreceiver/internal/model/interface.go b/receiver/nsxreceiver/internal/model/interface.go new file mode 100644 index 000000000000..621eebb3a913 --- /dev/null +++ b/receiver/nsxreceiver/internal/model/interface.go @@ -0,0 +1,13 @@ +package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" + +import "github.com/vmware/go-vmware-nsxt/manager" // NodeNetworkInterfacePropertiesListResult wraps the results of a node's network interface +type NodeNetworkInterfacePropertiesListResult struct { + // Node network interface property results + Results []NetworkInterface `json:"results"` +} + +// NetworkInterface is one of a node's nics +type NetworkInterface struct { + *manager.NodeNetworkInterfaceProperties `mapstructure:",squash"` + ID string `json:"id"` +} diff --git a/receiver/nsxreceiver/internal/model/node.go b/receiver/nsxreceiver/internal/model/node.go new file mode 100644 index 000000000000..5af2453b3891 --- /dev/null +++ b/receiver/nsxreceiver/internal/model/node.go @@ -0,0 +1,60 @@ +package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" + +// NodeStatListResult Runtime status information of fabric nodes +type NodeStatListResult struct { + Results []NodeStat `json:"results"` +} + +// NodeStat is a status for a node +type NodeStat struct { + ID string `json:"node_id"` + HostNodeDeploymentStatus string `json:"host_node_deployment_status"` + SoftwareVersion string `json:"software_version"` + SystemStatus SystemStatus `json:"system_status"` + ExternalID string `json:"external_id"` + Interfaces []NetworkInterface `json:"interfaces,omitempty"` +} + +// SystemStatus is the system status portion of a node's status response +type SystemStatus struct { + CPUCores int `json:"cpu_cores"` + DpdkCPUCores int `json:"dpdk_cpu_cores"` + NonDpdkCPUCores int `json:"non_dpdk_cpu_cores"` + DiskSpaceTotal int `json:"disk_space_total"` + DiskSpaceUsed int `json:"disk_space_used"` + FileSystems []FileSystemsUsage `json:"file_systems"` + LoadAverage []float64 `json:"load_average"` + CPUUsage NodeSystemCPUUsage `json:"cpu_usage"` + EdgeMemUsage MemSystemUsage `json:"edge_mem_usage"` + MemCache int `json:"mem_cache"` + MemTotal int `json:"mem_total"` + MemUsed int `json:"mem_used"` + Source string `json:"source"` + SwapTotal int `json:"swap_total"` + SwapUsed int `json:"swap_used"` + SystemTime int64 `json:"system_time"` + Uptime int64 `json:"uptime"` +} + +type NodeSystemCPUUsage struct { + HighestCPUCoreUsageDpdk float64 `json:"highest_cpu_core_usage_dpdk"` + AvgCPUCoreUsageDpdk float64 `json:"avg_cpu_core_usage_dpdk"` + HighestCPUCoreUsageNonDpdk float64 `json:"highest_cpu_core_usage_non_dpdk"` + AvgCPUCoreUsageNonDpdk float64 `json:"avg_cpu_core_usage_non_dpdk"` +} + +type FileSystemsUsage struct { + // Name of the filesystem + FileSystem string `json:"file_system"` + Mount string `json:"mount"` + Total int `json:"total"` + Type string `json:"type"` + Used int `json:"used"` +} + +type MemSystemUsage struct { + SystemMemUsage float64 `json:"system_mem_usage"` + SwapUsage float64 `json:"swap_usage"` + CacheUsage float64 `json:"cache_usage"` + DatapathTotalUsage float64 `json:"datapath_total_usage"` +} diff --git a/receiver/nsxreceiver/internal/model/router.go b/receiver/nsxreceiver/internal/model/router.go new file mode 100644 index 000000000000..23f648de898b --- /dev/null +++ b/receiver/nsxreceiver/internal/model/router.go @@ -0,0 +1,5 @@ +package model + +// Router is a logical router's API information +type Router struct { +} diff --git a/receiver/nsxreceiver/metadata.yaml b/receiver/nsxreceiver/metadata.yaml index 4d8659d5348c..a93bf50a769e 100644 --- a/receiver/nsxreceiver/metadata.yaml +++ b/receiver/nsxreceiver/metadata.yaml @@ -1 +1,33 @@ name: nsxreceiver + +resource_attributes: + nsx.node.name: + description: The name of the NSX Node. + type: string + nsx.node.type: + description: The type of NSX Node. + type: string + enum: + - manager + - transport + nsx.interface.id: + description: The name of the NiC. + type: string + nsx.load_balancer.type: + description: The load balancer layer assignment + type: string + enum: + - L4 + - L7 + + +attributes: {} +metrics: + nsx.interface.throughput: + description: The number of messages published to a queue. + unit: "{messages}" + sum: + monotonic: true + aggregation: cumulative + value_type: int + enabled: true diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go new file mode 100644 index 000000000000..a92e08193715 --- /dev/null +++ b/receiver/nsxreceiver/scraper.go @@ -0,0 +1,114 @@ +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" + +import ( + "context" + "sync" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/model/pdata" + "go.opentelemetry.io/collector/receiver/scrapererror" + "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" + dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" +) + +type scraper struct { + config *Config + settings component.TelemetrySettings + client *nsxClient + mb *metadata.MetricsBuilder + logger *zap.Logger +} + +func newScraper(cfg *Config, settings component.TelemetrySettings) *scraper { + return &scraper{ + config: cfg, + settings: settings, + mb: metadata.NewMetricsBuilder(cfg.MetricsConfig.Settings), + logger: settings.Logger, + } +} + +func (s *scraper) start(ctx context.Context, host component.Host) error { + client, err := newClient(s.config, s.settings, host) + if err != nil { + return err + } + s.client = client + return nil +} + +func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { + + errs := &scrapererror.ScrapeErrors{} + r := s.retrieve(ctx, errs) + s.process(r) + return pdata.NewMetrics(), nil +} + +type retrieval struct { + nodes []dm.NodeStat + routers []dm.NetworkInterface + sync.RWMutex +} + +func (s *scraper) retrieve(ctx context.Context, errs *scrapererror.ScrapeErrors) *retrieval { + r := &retrieval{} + + wg := &sync.WaitGroup{} + + wg.Add(2) + go s.retrieveNodes(ctx, r, wg, errs) + go s.retrieveRouters(ctx, r, wg, errs) + wg.Wait() + + return r +} + +func (s *scraper) retrieveNodes( + ctx context.Context, + r *retrieval, + wg *sync.WaitGroup, + errs *scrapererror.ScrapeErrors, +) { + defer wg.Done() + + nodes, err := s.client.Nodes(ctx) + if err != nil { + s.logger.Error("unable to retrieve nodes", zap.Field{Key: "error", String: err.Error()}) + } + r.Lock() + r.nodes = nodes + r.Unlock() + + for _, n := range nodes { + interfaces, err := s.client.Interfaces(ctx, n.ID) + if err != nil { + errs.AddPartial(1, err) + continue + } + n.Interfaces = interfaces + } +} + +func (s *scraper) retrieveRouters( + ctx context.Context, + r *retrieval, + wg *sync.WaitGroup, + errs *scrapererror.ScrapeErrors, +) { + defer wg.Done() +} + +func (s *scraper) process(retrieval *retrieval) { + for _, n := range retrieval.nodes { + for _, i := range n.Interfaces { + s.recordNodeInterface(n, i) + } + } +} + +func (s *scraper) recordNodeInterface(node dm.NodeStat, i dm.NetworkInterface) { + +} From 86259a01e0965eed6bd0da26677050e57e149fb2 Mon Sep 17 00:00:00 2001 From: schmikei Date: Fri, 29 Apr 2022 11:01:39 -0400 Subject: [PATCH 03/48] wip --- receiver/nsxreceiver/client.go | 77 ++- receiver/nsxreceiver/config.go | 19 + receiver/nsxreceiver/documentation.md | 21 + receiver/nsxreceiver/go.mod | 36 +- receiver/nsxreceiver/go.sum | 342 +++++++++- .../internal/metadata/generated_metrics_v2.go | 642 +++++++++++++++++- receiver/nsxreceiver/internal/model/node.go | 69 +- receiver/nsxreceiver/metadata.yaml | 85 ++- receiver/nsxreceiver/scraper.go | 103 ++- 9 files changed, 1265 insertions(+), 129 deletions(-) diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go index ca84ad69a350..63dcdf585a5b 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxreceiver/client.go @@ -8,11 +8,10 @@ import ( "io" "net/http" "net/url" - "strings" nsxt "github.com/vmware/go-vmware-nsxt" - "github.com/vmware/go-vmware-nsxt/manager" "go.opentelemetry.io/collector/component" + "go.uber.org/zap" dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" ) @@ -22,6 +21,7 @@ type nsxClient struct { driver *nsxt.APIClient client *http.Client endpoint *url.URL + logger *zap.Logger } var ( @@ -33,7 +33,7 @@ const defaultMaxRetries = 3 const defaultRetryMinDelay = 5 const defaultRetryMaxDelay = 10 -func newClient(c *Config, settings component.TelemetrySettings, host component.Host) (*nsxClient, error) { +func newClient(c *Config, settings component.TelemetrySettings, host component.Host, logger *zap.Logger) (*nsxClient, error) { client, err := c.MetricsConfig.HTTPClientSettings.ToClient(host.GetExtensions(), settings) if err != nil { return nil, err @@ -48,51 +48,51 @@ func newClient(c *Config, settings component.TelemetrySettings, host component.H config: c, client: client, endpoint: endpoint, + logger: logger, }, nil } -func (c *nsxClient) LogicalSwitches(ctx context.Context) (*manager.SwitchingProfilesListResult, error) { - body, err := c.doRequest(ctx, "/fabric/logical-switches", nil) +func (c *nsxClient) TransportNodes(ctx context.Context) ([]dm.TransportNode, error) { + body, err := c.doRequest( + ctx, + "/api/v1/transport-nodes", + withDefaultHeaders(), + ) if err != nil { return nil, err } - var switches manager.SwitchingProfilesListResult - err = json.Unmarshal(body, &switches) - return &switches, err + var nodes dm.TransportNodeList + err = json.Unmarshal(body, &nodes) + return nodes.Results, err } -func (c *nsxClient) Nodes(ctx context.Context) ([]dm.NodeStat, error) { - body, err := c.doRequest(ctx, "/api/v1/transport-nodes", nil) +func (c *nsxClient) NodeStatus(ctx context.Context, nodeID string) (*dm.NodeStatus, error) { + body, err := c.doRequest( + ctx, + fmt.Sprintf("/api/v1/transport-nodes/%s/status", nodeID), + withDefaultHeaders(), + ) if err != nil { - return nil, err + return nil, fmt.Errorf("unable to get a node's status from the REST API") } - var nodes manager.NodeListResult - err = json.Unmarshal(body, &nodes) - nodeIDs := []string{} - for _, n := range nodes.Results { - nodeIDs = append(nodeIDs, n.Id) - } - - nodeStatsBody, err := c.doRequest(ctx, "/api/v1/fabric/nodes/status", withQuery("node_ids", strings.Join(nodeIDs, ","))) + var nodestatus dm.TransportNodeStatus + err = json.Unmarshal(body, &nodestatus) if err != nil { - return nil, err + return nil, fmt.Errorf("unable to unmarshal result of the node status request: %w", err) } - var nodeStats dm.NodeStatListResult - err = json.Unmarshal(nodeStatsBody, &nodeStats) - if err != nil { - return nil, err - } + c.logger.Info(fmt.Sprintf("here is the node status: %v", nodestatus.NodeStatus.SystemStatus)) + + return &nodestatus.NodeStatus, nil - return nodeStats.Results, err } func (c *nsxClient) Interfaces(ctx context.Context, nodeID string) ([]dm.NetworkInterface, error) { body, err := c.doRequest( ctx, fmt.Sprintf("/api/v1/fabric/nodes/%s/network/interfaces", nodeID), - nil, + withDefaultHeaders(), ) if err != nil { return nil, err @@ -103,12 +103,24 @@ func (c *nsxClient) Interfaces(ctx context.Context, nodeID string) ([]dm.Network return interfaces.Results, err } -type requestOption func(req *http.Request) +type requestOption func(req *http.Request) *http.Request func withQuery(key string, value string) requestOption { - return func(req *http.Request) { + return func(req *http.Request) *http.Request { q := req.URL.Query() q.Add(key, value) + req.URL.RawQuery = q.Encode() + return req + } +} + +func withDefaultHeaders() requestOption { + return func(req *http.Request) *http.Request { + h := req.Header + h.Add("User-Agent", "opentelemetry-collector") + h.Add("Accept", "application/json") + h.Add("Connection", "keep-alive") + return req } } @@ -125,7 +137,7 @@ func (c *nsxClient) doRequest(ctx context.Context, path string, options ...reque req.SetBasicAuth(c.config.MetricsConfig.Username, c.config.MetricsConfig.Password) for _, op := range options { - op(req) + req = op(req) } resp, err := c.client.Do(req) @@ -138,13 +150,14 @@ func (c *nsxClient) doRequest(ctx context.Context, path string, options ...reque return io.ReadAll(resp.Body) } - _, err = io.ReadAll(resp.Body) + body, _ := io.ReadAll(resp.Body) switch resp.StatusCode { case 401: return nil, errUnauthenticated case 403: return nil, errUnauthorized default: - return nil, fmt.Errorf("got non 200 status code %d", resp.StatusCode) + c.logger.Info(fmt.Sprintf("%v", req)) + return nil, fmt.Errorf("got non 200 status code %d: %w, %s", resp.StatusCode, err, string(body)) } } diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index f8f6caaf6583..4e4b077070c5 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -4,14 +4,17 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/receiver/scraperhelper" + "go.uber.org/multierr" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver" ) // Config is the configuraiton for the NSX receiver type Config struct { config.ReceiverSettings `mapstructure:",squash"` MetricsConfig MetricsConfig `mapstructure:"metrics"` + LoggingConfig MetricsConfig `mapstructure:"logs"` } // MetricsConfig is the metrics configuration portion of the nsxreceiver @@ -23,8 +26,24 @@ type MetricsConfig struct { Password string `mapstructure:"password"` } +// LoggingConfig is the configuration of a syslog receiver +type LoggingConfig struct { + *syslogreceiver.SysLogConfig `mapstructure:",squash"` +} + // Validate returns if the NSX configuration is valid func (c *Config) Validate() error { + return multierr.Combine( + c.validateMetrics(), + c.validateLogs(), + ) +} + +func (c *Config) validateMetrics() error { + return nil +} + +func (c *Config) validateLogs() error { return nil } diff --git a/receiver/nsxreceiver/documentation.md b/receiver/nsxreceiver/documentation.md index 76a1002c443c..4ea7e1f2c120 100644 --- a/receiver/nsxreceiver/documentation.md +++ b/receiver/nsxreceiver/documentation.md @@ -8,6 +8,15 @@ These are the metrics available for this scraper. | Name | Description | Unit | Type | Attributes | | ---- | ----------- | ---- | ---- | ---------- | +| **node.cache.memory.usage** | The memory usage of the node’s cache | By | Sum(Int) |
| +| **node.cache.network.throughput** | The memory usage of the node’s cache | By | Sum(Int) |
| +| **node.load_balancer.utilization** | The utilization of load balancers by the node | % | Gauge(Double) |
  • load_balancer
| +| **node.memory.usage** | The memory usage of the node | By | Sum(Int) |
| +| **nsx.interface.packet.count** | The number of packets flowing through the network interface. | {messages} | Sum(Int) |
  • direction
| +| **nsx.interface.throughput** | The number of messages published to a queue. | {messages} | Sum(Int) |
  • direction
| +| **nsx.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • cpu.process.class
| +| **nsx.node.disk.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk
| +| **nsx.node.disk.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
  • disk
| **Highlighted metrics** are emitted by default. Other metrics are optional and not emitted by default. Any metric can be enabled or disabled with the following scraper configuration: @@ -18,7 +27,19 @@ metrics: enabled: ``` +## Resource attributes + +| Name | Description | Type | +| ---- | ----------- | ---- | +| nsx.interface.id | The name of the network interface. | String | +| nsx.node.name | The name of the NSX Node. | String | +| nsx.node.type | The type of NSX Node. | String | + ## Metric attributes | Name | Description | Values | | ---- | ----------- | ------ | +| cpu.process.class | The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes | datapath, services | +| direction (direction) | The direction of network flow | received, transmitted | +| disk (disk) | The name of the mounted storage | | +| load_balancer | The name of the load balancer being utilized | | diff --git a/receiver/nsxreceiver/go.mod b/receiver/nsxreceiver/go.mod index 2198464e57ad..5ebce46b1b52 100644 --- a/receiver/nsxreceiver/go.mod +++ b/receiver/nsxreceiver/go.mod @@ -3,8 +3,8 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxrec go 1.17 require ( - go.opentelemetry.io/collector v0.49.0 - go.opentelemetry.io/collector/pdata v0.49.0 + go.opentelemetry.io/collector v0.49.1-0.20220425174313-0674425b8ef2 + go.opentelemetry.io/collector/pdata v0.49.1-0.20220425174313-0674425b8ef2 ) require ( @@ -13,9 +13,8 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/knadh/koanf v1.4.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f go.opencensus.io v0.23.0 // indirect go.opentelemetry.io/collector/model v0.49.0 @@ -23,11 +22,9 @@ require ( go.opentelemetry.io/otel/metric v0.29.0 // indirect go.opentelemetry.io/otel/trace v1.6.3 // indirect go.uber.org/atomic v1.9.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.21.0 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect - google.golang.org/appengine v1.4.0 // indirect + golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect + google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect ) @@ -37,12 +34,33 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/klauspost/compress v1.15.1 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.0.0-00010101000000-000000000000 github.com/rs/cors v1.8.2 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect + go.uber.org/multierr v1.8.0 + go.uber.org/zap v1.21.0 golang.org/x/text v0.3.7 // indirect - google.golang.org/grpc v1.45.0 // indirect + google.golang.org/grpc v1.46.0 // indirect +) + +require ( + github.com/antonmedv/expr v1.9.0 // indirect + github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 // indirect + github.com/jpillora/backoff v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/observiq/ctimefmt v1.0.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/stanza v0.49.0 // indirect + github.com/open-telemetry/opentelemetry-log-collection v0.29.1 // indirect + golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7 // indirect + gonum.org/v1/gonum v0.11.0 // indirect + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest => ../../internal/scrapertest +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver => ../syslogreceiver + replace go.opentelemetry.io/collector/semconv => go.opentelemetry.io/collector/semconv v0.0.0-20220422001137-87ab5de64ce4 diff --git a/receiver/nsxreceiver/go.sum b/receiver/nsxreceiver/go.sum index b7ca16b9bdb4..f728db1cc657 100644 --- a/receiver/nsxreceiver/go.sum +++ b/receiver/nsxreceiver/go.sum @@ -1,8 +1,45 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antonmedv/expr v1.9.0 h1:j4HI3NHEdgDnN9p6oI6Ndr0G5QryMY0FNxT4ONrFDGU= +github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= @@ -19,14 +56,20 @@ github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -34,15 +77,21 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= +github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= @@ -53,13 +102,23 @@ github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr6 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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= @@ -74,18 +133,35 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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.4.1/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.1/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.4/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.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -109,10 +185,19 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 h1:s9ZL6ZhFF8y6ebnm1FLvobkzoIu5xwDQUcRPk/IEhpM= +github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6/go.mod h1:aXdIdfn2OcGnMhOTojXmwZqXKgC3MU5riiNvzwwG9OY= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +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/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 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.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= @@ -120,10 +205,17 @@ github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= +github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= +github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -134,35 +226,56 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= 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/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= +github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvilk= +github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.49.0 h1:kGztmX5pz3cCszk6QGmurZqz1aIzuxyaZmSyLRAZql4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/stanza v0.49.0 h1:82Dg0jLVp2icEZb2aODRcaj8dTA4e/RH1yPNssHBTKY= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/stanza v0.49.0/go.mod h1:1pgHOB6sAHQNclxa1s+lWOsuAUd6XJUguEgONNRUVnc= +github.com/open-telemetry/opentelemetry-log-collection v0.29.1 h1:/Norji0OWQelS2sruZwjckJiKWrP9LO0LZd23KhWXfQ= +github.com/open-telemetry/opentelemetry-log-collection v0.29.1/go.mod h1:jc765D8x90g+kMfDSSb0MxoEURxoCxz1fV0dutvzlrc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 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.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= +github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -170,17 +283,25 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f h1:NbC9yOr5At92seXK+kOr2TzU3mIWzcJOVzZasGSuwoU= github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f/go.mod h1:VEqcmf4Sp7gPB7z05QGyKVmn6xWppr7Nz8cVNvyC80o= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/collector v0.49.0 h1:brKMIUwlL1bt0Faxqqxvj7549KWm9FEN77Z4i4RAlDE= -go.opentelemetry.io/collector v0.49.0/go.mod h1:ErYGC1VzzrpK/uM134DJIbARX3jl9vtTqgIXsiWxjGE= +go.opentelemetry.io/collector v0.49.1-0.20220425174313-0674425b8ef2 h1:Ss1+RRJedpuBQ71wrqBxUUv/qiNlOWN1omK0xR0BpKc= +go.opentelemetry.io/collector v0.49.1-0.20220425174313-0674425b8ef2/go.mod h1:0nkkn+A4B7S+U4ioI8C2CD0dIOoQeXOMz6qbpGiJC3E= go.opentelemetry.io/collector/model v0.49.0 h1:mbUSNgpaBE3GWmzGsRb5t0xILpXIVYv7scPTTfoMt6c= go.opentelemetry.io/collector/model v0.49.0/go.mod h1:nOYQv9KoFPs6ihJwOi24qB209EOhS9HkwhGj54YiEAw= -go.opentelemetry.io/collector/pdata v0.49.0 h1:aYj5rOlRC0x7lGXbc185LMsMMoY/pjOTXr5s1O2SzXs= -go.opentelemetry.io/collector/pdata v0.49.0/go.mod h1:YwmKuiFhNgtmhRdpi8Q8FAWPa0AwJTCSlssSsAtuRcY= +go.opentelemetry.io/collector/pdata v0.49.1-0.20220425174313-0674425b8ef2 h1:fEn+fjtF7bbi+lynqvVK0pDsBW6U3kyfXdqN0hFWBfk= +go.opentelemetry.io/collector/pdata v0.49.1-0.20220425174313-0674425b8ef2/go.mod h1:jrnUDnlHCTSKf9H7LYTmldQUmNQmPvilNNG/cKlv8Lc= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 h1:woM+Mb4d0A+Dxa3rYPenSN5ZeS9qHUvE8rlObiLRXTY= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0/go.mod h1:PFmBsWbldL1kiWZk9+0LBZz2brhByaGsvp6pRICMlPE= go.opentelemetry.io/otel v1.6.0/go.mod h1:bfJD2DZVw0LBxghOTlgnlI0CV3hLDu9XF/QKOUXMTQQ= @@ -207,13 +328,39 @@ go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 h1:FR+oGxGfbQu1d+jglI3rCkjAjUnhRSZcUxr+DqlDLNo= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -223,55 +370,143 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r 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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a h1:qfl7ob3DIEs3Ml9oLuPwY2N04gymzAW04WsUQHIClgM= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7 h1:8IVLkfbr2cLhv0a/vKq4UFUcJym8RmDoDboxCFWEjYE= +golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -279,25 +514,85 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= 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= @@ -306,21 +601,34 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go index 00905c16f3ec..0636764e32f9 100644 --- a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go @@ -16,19 +16,530 @@ type MetricSettings struct { // MetricsSettings provides settings for nsxreceiver metrics. type MetricsSettings struct { + NodeCacheMemoryUsage MetricSettings `mapstructure:"node.cache.memory.usage"` + NodeCacheNetworkThroughput MetricSettings `mapstructure:"node.cache.network.throughput"` + NodeLoadBalancerUtilization MetricSettings `mapstructure:"node.load_balancer.utilization"` + NodeMemoryUsage MetricSettings `mapstructure:"node.memory.usage"` + NsxInterfacePacketCount MetricSettings `mapstructure:"nsx.interface.packet.count"` + NsxInterfaceThroughput MetricSettings `mapstructure:"nsx.interface.throughput"` + NsxNodeCPUUtilization MetricSettings `mapstructure:"nsx.node.cpu.utilization"` + NsxNodeDiskUsage MetricSettings `mapstructure:"nsx.node.disk.usage"` + NsxNodeDiskUtilization MetricSettings `mapstructure:"nsx.node.disk.utilization"` } func DefaultMetricsSettings() MetricsSettings { - return MetricsSettings{} + return MetricsSettings{ + NodeCacheMemoryUsage: MetricSettings{ + Enabled: true, + }, + NodeCacheNetworkThroughput: MetricSettings{ + Enabled: true, + }, + NodeLoadBalancerUtilization: MetricSettings{ + Enabled: true, + }, + NodeMemoryUsage: MetricSettings{ + Enabled: true, + }, + NsxInterfacePacketCount: MetricSettings{ + Enabled: true, + }, + NsxInterfaceThroughput: MetricSettings{ + Enabled: true, + }, + NsxNodeCPUUtilization: MetricSettings{ + Enabled: true, + }, + NsxNodeDiskUsage: MetricSettings{ + Enabled: true, + }, + NsxNodeDiskUtilization: MetricSettings{ + Enabled: true, + }, + } +} + +type metricNodeCacheMemoryUsage struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills node.cache.memory.usage metric with initial data. +func (m *metricNodeCacheMemoryUsage) init() { + m.data.SetName("node.cache.memory.usage") + m.data.SetDescription("The memory usage of the node’s cache") + m.data.SetUnit("By") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) +} + +func (m *metricNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { + if !m.settings.Enabled { + return + } + dp := m.data.Sum().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetIntVal(val) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNodeCacheMemoryUsage) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNodeCacheMemoryUsage(settings MetricSettings) metricNodeCacheMemoryUsage { + m := metricNodeCacheMemoryUsage{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNodeCacheNetworkThroughput struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills node.cache.network.throughput metric with initial data. +func (m *metricNodeCacheNetworkThroughput) init() { + m.data.SetName("node.cache.network.throughput") + m.data.SetDescription("The memory usage of the node’s cache") + m.data.SetUnit("By") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) +} + +func (m *metricNodeCacheNetworkThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { + if !m.settings.Enabled { + return + } + dp := m.data.Sum().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetIntVal(val) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNodeCacheNetworkThroughput) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNodeCacheNetworkThroughput) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNodeCacheNetworkThroughput(settings MetricSettings) metricNodeCacheNetworkThroughput { + m := metricNodeCacheNetworkThroughput{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNodeLoadBalancerUtilization struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills node.load_balancer.utilization metric with initial data. +func (m *metricNodeLoadBalancerUtilization) init() { + m.data.SetName("node.load_balancer.utilization") + m.data.SetDescription("The utilization of load balancers by the node") + m.data.SetUnit("%") + m.data.SetDataType(pmetric.MetricDataTypeGauge) + m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) +} + +func (m *metricNodeLoadBalancerUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { + if !m.settings.Enabled { + return + } + dp := m.data.Gauge().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetDoubleVal(val) + dp.Attributes().Insert(A.LoadBalancer, pcommon.NewValueString(loadBalancerAttributeValue)) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNodeLoadBalancerUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNodeLoadBalancerUtilization) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNodeLoadBalancerUtilization(settings MetricSettings) metricNodeLoadBalancerUtilization { + m := metricNodeLoadBalancerUtilization{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNodeMemoryUsage struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills node.memory.usage metric with initial data. +func (m *metricNodeMemoryUsage) init() { + m.data.SetName("node.memory.usage") + m.data.SetDescription("The memory usage of the node") + m.data.SetUnit("By") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) +} + +func (m *metricNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { + if !m.settings.Enabled { + return + } + dp := m.data.Sum().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetIntVal(val) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNodeMemoryUsage) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNodeMemoryUsage(settings MetricSettings) metricNodeMemoryUsage { + m := metricNodeMemoryUsage{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNsxInterfacePacketCount struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills nsx.interface.packet.count metric with initial data. +func (m *metricNsxInterfacePacketCount) init() { + m.data.SetName("nsx.interface.packet.count") + m.data.SetDescription("The number of packets flowing through the network interface.") + m.data.SetUnit("{messages}") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(true) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + m.data.Sum().DataPoints().EnsureCapacity(m.capacity) +} + +func (m *metricNsxInterfacePacketCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { + if !m.settings.Enabled { + return + } + dp := m.data.Sum().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetIntVal(val) + dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNsxInterfacePacketCount) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNsxInterfacePacketCount) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNsxInterfacePacketCount(settings MetricSettings) metricNsxInterfacePacketCount { + m := metricNsxInterfacePacketCount{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNsxInterfaceThroughput struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills nsx.interface.throughput metric with initial data. +func (m *metricNsxInterfaceThroughput) init() { + m.data.SetName("nsx.interface.throughput") + m.data.SetDescription("The number of messages published to a queue.") + m.data.SetUnit("{messages}") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(true) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + m.data.Sum().DataPoints().EnsureCapacity(m.capacity) +} + +func (m *metricNsxInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { + if !m.settings.Enabled { + return + } + dp := m.data.Sum().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetIntVal(val) + dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNsxInterfaceThroughput) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNsxInterfaceThroughput) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNsxInterfaceThroughput(settings MetricSettings) metricNsxInterfaceThroughput { + m := metricNsxInterfaceThroughput{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNsxNodeCPUUtilization struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills nsx.node.cpu.utilization metric with initial data. +func (m *metricNsxNodeCPUUtilization) init() { + m.data.SetName("nsx.node.cpu.utilization") + m.data.SetDescription("The average amount of CPU being used by the node.") + m.data.SetUnit("%") + m.data.SetDataType(pmetric.MetricDataTypeGauge) + m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) +} + +func (m *metricNsxNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { + if !m.settings.Enabled { + return + } + dp := m.data.Gauge().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetDoubleVal(val) + dp.Attributes().Insert(A.CPUProcessClass, pcommon.NewValueString(cpuProcessClassAttributeValue)) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNsxNodeCPUUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNsxNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNsxNodeCPUUtilization(settings MetricSettings) metricNsxNodeCPUUtilization { + m := metricNsxNodeCPUUtilization{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNsxNodeDiskUsage struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills nsx.node.disk.usage metric with initial data. +func (m *metricNsxNodeDiskUsage) init() { + m.data.SetName("nsx.node.disk.usage") + m.data.SetDescription("The amount of storage space used by the node.") + m.data.SetUnit("By") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + m.data.Sum().DataPoints().EnsureCapacity(m.capacity) +} + +func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskAttributeValue string) { + if !m.settings.Enabled { + return + } + dp := m.data.Sum().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetIntVal(val) + dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNsxNodeDiskUsage) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNsxNodeDiskUsage) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNsxNodeDiskUsage(settings MetricSettings) metricNsxNodeDiskUsage { + m := metricNsxNodeDiskUsage{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + +type metricNsxNodeDiskUtilization struct { + data pmetric.Metric // data buffer for generated metric. + settings MetricSettings // metric settings provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills nsx.node.disk.utilization metric with initial data. +func (m *metricNsxNodeDiskUtilization) init() { + m.data.SetName("nsx.node.disk.utilization") + m.data.SetDescription("The percentage of storage space utilized.") + m.data.SetUnit("%") + m.data.SetDataType(pmetric.MetricDataTypeGauge) + m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) +} + +func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, diskAttributeValue string) { + if !m.settings.Enabled { + return + } + dp := m.data.Gauge().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetDoubleVal(val) + dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricNsxNodeDiskUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricNsxNodeDiskUtilization) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricNsxNodeDiskUtilization(settings MetricSettings) metricNsxNodeDiskUtilization { + m := metricNsxNodeDiskUtilization{settings: settings} + if settings.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m } // MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations // required to produce metric representation defined in metadata and user settings. type MetricsBuilder struct { - startTime pcommon.Timestamp // start time that will be applied to all recorded data points. - metricsCapacity int // maximum observed number of metrics per resource. - resourceCapacity int // maximum observed number of resource attributes. - metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. + startTime pcommon.Timestamp // start time that will be applied to all recorded data points. + metricsCapacity int // maximum observed number of metrics per resource. + resourceCapacity int // maximum observed number of resource attributes. + metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. + metricNodeCacheMemoryUsage metricNodeCacheMemoryUsage + metricNodeCacheNetworkThroughput metricNodeCacheNetworkThroughput + metricNodeLoadBalancerUtilization metricNodeLoadBalancerUtilization + metricNodeMemoryUsage metricNodeMemoryUsage + metricNsxInterfacePacketCount metricNsxInterfacePacketCount + metricNsxInterfaceThroughput metricNsxInterfaceThroughput + metricNsxNodeCPUUtilization metricNsxNodeCPUUtilization + metricNsxNodeDiskUsage metricNsxNodeDiskUsage + metricNsxNodeDiskUtilization metricNsxNodeDiskUtilization } // metricBuilderOption applies changes to default metrics builder. @@ -43,8 +554,17 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ - startTime: pcommon.NewTimestampFromTime(time.Now()), - metricsBuffer: pmetric.NewMetrics(), + startTime: pcommon.NewTimestampFromTime(time.Now()), + metricsBuffer: pmetric.NewMetrics(), + metricNodeCacheMemoryUsage: newMetricNodeCacheMemoryUsage(settings.NodeCacheMemoryUsage), + metricNodeCacheNetworkThroughput: newMetricNodeCacheNetworkThroughput(settings.NodeCacheNetworkThroughput), + metricNodeLoadBalancerUtilization: newMetricNodeLoadBalancerUtilization(settings.NodeLoadBalancerUtilization), + metricNodeMemoryUsage: newMetricNodeMemoryUsage(settings.NodeMemoryUsage), + metricNsxInterfacePacketCount: newMetricNsxInterfacePacketCount(settings.NsxInterfacePacketCount), + metricNsxInterfaceThroughput: newMetricNsxInterfaceThroughput(settings.NsxInterfaceThroughput), + metricNsxNodeCPUUtilization: newMetricNsxNodeCPUUtilization(settings.NsxNodeCPUUtilization), + metricNsxNodeDiskUsage: newMetricNsxNodeDiskUsage(settings.NsxNodeDiskUsage), + metricNsxNodeDiskUtilization: newMetricNsxNodeDiskUtilization(settings.NsxNodeDiskUtilization), } for _, op := range options { op(mb) @@ -65,6 +585,27 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { // ResourceOption applies changes to provided resource. type ResourceOption func(pcommon.Resource) +// WithNsxInterfaceID sets provided value as "nsx.interface.id" attribute for current resource. +func WithNsxInterfaceID(val string) ResourceOption { + return func(r pcommon.Resource) { + r.Attributes().UpsertString("nsx.interface.id", val) + } +} + +// WithNsxNodeName sets provided value as "nsx.node.name" attribute for current resource. +func WithNsxNodeName(val string) ResourceOption { + return func(r pcommon.Resource) { + r.Attributes().UpsertString("nsx.node.name", val) + } +} + +// WithNsxNodeType sets provided value as "nsx.node.type" attribute for current resource. +func WithNsxNodeType(val string) ResourceOption { + return func(r pcommon.Resource) { + r.Attributes().UpsertString("nsx.node.type", val) + } +} + // EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for // recording another set of data points as part of another resource. This function can be helpful when one scraper // needs to emit metrics from several resources. Otherwise calling this function is not required, @@ -78,6 +619,15 @@ func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption) { ils := rm.ScopeMetrics().AppendEmpty() ils.Scope().SetName("otelcol/nsxreceiver") ils.Metrics().EnsureCapacity(mb.metricsCapacity) + mb.metricNodeCacheMemoryUsage.emit(ils.Metrics()) + mb.metricNodeCacheNetworkThroughput.emit(ils.Metrics()) + mb.metricNodeLoadBalancerUtilization.emit(ils.Metrics()) + mb.metricNodeMemoryUsage.emit(ils.Metrics()) + mb.metricNsxInterfacePacketCount.emit(ils.Metrics()) + mb.metricNsxInterfaceThroughput.emit(ils.Metrics()) + mb.metricNsxNodeCPUUtilization.emit(ils.Metrics()) + mb.metricNsxNodeDiskUsage.emit(ils.Metrics()) + mb.metricNsxNodeDiskUtilization.emit(ils.Metrics()) if ils.Metrics().Len() > 0 { mb.updateCapacity(rm) rm.MoveTo(mb.metricsBuffer.ResourceMetrics().AppendEmpty()) @@ -94,6 +644,51 @@ func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics { return metrics } +// RecordNodeCacheMemoryUsageDataPoint adds a data point to node.cache.memory.usage metric. +func (mb *MetricsBuilder) RecordNodeCacheMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNodeCacheMemoryUsage.recordDataPoint(mb.startTime, ts, val) +} + +// RecordNodeCacheNetworkThroughputDataPoint adds a data point to node.cache.network.throughput metric. +func (mb *MetricsBuilder) RecordNodeCacheNetworkThroughputDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNodeCacheNetworkThroughput.recordDataPoint(mb.startTime, ts, val) +} + +// RecordNodeLoadBalancerUtilizationDataPoint adds a data point to node.load_balancer.utilization metric. +func (mb *MetricsBuilder) RecordNodeLoadBalancerUtilizationDataPoint(ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { + mb.metricNodeLoadBalancerUtilization.recordDataPoint(mb.startTime, ts, val, loadBalancerAttributeValue) +} + +// RecordNodeMemoryUsageDataPoint adds a data point to node.memory.usage metric. +func (mb *MetricsBuilder) RecordNodeMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNodeMemoryUsage.recordDataPoint(mb.startTime, ts, val) +} + +// RecordNsxInterfacePacketCountDataPoint adds a data point to nsx.interface.packet.count metric. +func (mb *MetricsBuilder) RecordNsxInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue string) { + mb.metricNsxInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue) +} + +// RecordNsxInterfaceThroughputDataPoint adds a data point to nsx.interface.throughput metric. +func (mb *MetricsBuilder) RecordNsxInterfaceThroughputDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue string) { + mb.metricNsxInterfaceThroughput.recordDataPoint(mb.startTime, ts, val, directionAttributeValue) +} + +// RecordNsxNodeCPUUtilizationDataPoint adds a data point to nsx.node.cpu.utilization metric. +func (mb *MetricsBuilder) RecordNsxNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { + mb.metricNsxNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue) +} + +// RecordNsxNodeDiskUsageDataPoint adds a data point to nsx.node.disk.usage metric. +func (mb *MetricsBuilder) RecordNsxNodeDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskAttributeValue string) { + mb.metricNsxNodeDiskUsage.recordDataPoint(mb.startTime, ts, val, diskAttributeValue) +} + +// RecordNsxNodeDiskUtilizationDataPoint adds a data point to nsx.node.disk.utilization metric. +func (mb *MetricsBuilder) RecordNsxNodeDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64, diskAttributeValue string) { + mb.metricNsxNodeDiskUtilization.recordDataPoint(mb.startTime, ts, val, diskAttributeValue) +} + // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { @@ -105,7 +700,38 @@ func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { // Attributes contains the possible metric attributes that can be used. var Attributes = struct { -}{} + // CPUProcessClass (The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes) + CPUProcessClass string + // Direction (The direction of network flow) + Direction string + // Disk (The name of the mounted storage) + Disk string + // LoadBalancer (The name of the load balancer being utilized) + LoadBalancer string +}{ + "cpu.process.class", + "direction", + "disk", + "load_balancer", +} // A is an alias for Attributes. var A = Attributes + +// AttributeCPUProcessClass are the possible values that the attribute "cpu.process.class" can have. +var AttributeCPUProcessClass = struct { + Datapath string + Services string +}{ + "datapath", + "services", +} + +// AttributeDirection are the possible values that the attribute "direction" can have. +var AttributeDirection = struct { + Received string + Transmitted string +}{ + "received", + "transmitted", +} diff --git a/receiver/nsxreceiver/internal/model/node.go b/receiver/nsxreceiver/internal/model/node.go index 5af2453b3891..481450f3a8f9 100644 --- a/receiver/nsxreceiver/internal/model/node.go +++ b/receiver/nsxreceiver/internal/model/node.go @@ -1,39 +1,56 @@ package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" +type TransportNodeList struct { + Results []TransportNode `json:"results"` +} + +type TransportNode struct { + ID string `json:"id"` + Name string `json:"display_name"` + Description string `json:"description"` + ResourceType string `json:"resource_type"` + + ManagerRole *struct{} `json:"manager_role,omitempty"` + ControllerRole *struct{} `json:"controller_role,omitempty"` +} + +type TransportZoneEndpoint struct { + ZoneID string `json:"transport_zone_id"` +} + // NodeStatListResult Runtime status information of fabric nodes type NodeStatListResult struct { - Results []NodeStat `json:"results"` + Results []NodeStatus `json:"results"` +} + +type TransportNodeStatus struct { + NodeStatus NodeStatus `json:"node_status"` } -// NodeStat is a status for a node -type NodeStat struct { - ID string `json:"node_id"` - HostNodeDeploymentStatus string `json:"host_node_deployment_status"` - SoftwareVersion string `json:"software_version"` - SystemStatus SystemStatus `json:"system_status"` - ExternalID string `json:"external_id"` - Interfaces []NetworkInterface `json:"interfaces,omitempty"` +// NodeStatus is a status for a node +type NodeStatus struct { + SystemStatus *SystemStatus `json:"system_status"` } // SystemStatus is the system status portion of a node's status response type SystemStatus struct { - CPUCores int `json:"cpu_cores"` - DpdkCPUCores int `json:"dpdk_cpu_cores"` - NonDpdkCPUCores int `json:"non_dpdk_cpu_cores"` - DiskSpaceTotal int `json:"disk_space_total"` - DiskSpaceUsed int `json:"disk_space_used"` - FileSystems []FileSystemsUsage `json:"file_systems"` - LoadAverage []float64 `json:"load_average"` - CPUUsage NodeSystemCPUUsage `json:"cpu_usage"` - EdgeMemUsage MemSystemUsage `json:"edge_mem_usage"` - MemCache int `json:"mem_cache"` - MemTotal int `json:"mem_total"` - MemUsed int `json:"mem_used"` - Source string `json:"source"` - SwapTotal int `json:"swap_total"` - SwapUsed int `json:"swap_used"` - SystemTime int64 `json:"system_time"` - Uptime int64 `json:"uptime"` + CPUCores int `json:"cpu_cores"` + DpdkCPUCores int `json:"dpdk_cpu_cores"` + NonDpdkCPUCores int `json:"non_dpdk_cpu_cores"` + DiskSpaceTotal int `json:"disk_space_total"` + DiskSpaceUsed int `json:"disk_space_used"` + FileSystems []FileSystemsUsage `json:"file_systems"` + LoadAverage []float64 `json:"load_average"` + CPUUsage *NodeSystemCPUUsage `json:"cpu_usage"` + EdgeMemUsage *MemSystemUsage `json:"edge_mem_usage"` + MemCache int `json:"mem_cache"` + MemTotal int `json:"mem_total"` + MemUsed int `json:"mem_used"` + Source string `json:"source"` + SwapTotal int `json:"swap_total"` + SwapUsed int `json:"swap_used"` + SystemTime int64 `json:"system_time"` + Uptime int64 `json:"uptime"` } type NodeSystemCPUUsage struct { diff --git a/receiver/nsxreceiver/metadata.yaml b/receiver/nsxreceiver/metadata.yaml index a93bf50a769e..46f290d1c414 100644 --- a/receiver/nsxreceiver/metadata.yaml +++ b/receiver/nsxreceiver/metadata.yaml @@ -9,19 +9,30 @@ resource_attributes: type: string enum: - manager - - transport + - host + - edge nsx.interface.id: - description: The name of the NiC. - type: string - nsx.load_balancer.type: - description: The load balancer layer assignment + description: The name of the network interface. type: string + +attributes: + direction: + value: direction + description: The direction of network flow + enum: + - received + - transmitted + disk: + value: disk + description: The name of the mounted storage + cpu.process.class: + description: The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes enum: - - L4 - - L7 - + - datapath + - services + load_balancer: + description: The name of the load balancer being utilized -attributes: {} metrics: nsx.interface.throughput: description: The number of messages published to a queue. @@ -31,3 +42,59 @@ metrics: aggregation: cumulative value_type: int enabled: true + attributes: [direction] + nsx.interface.packet.count: + description: The number of packets flowing through the network interface. + unit: "{messages}" + sum: + monotonic: true + aggregation: cumulative + value_type: int + enabled: true + attributes: [direction] + nsx.node.cpu.utilization: + description: The average amount of CPU being used by the node. + unit: "%" + gauge: + value_type: double + enabled: true + attributes: [cpu.process.class] + nsx.node.disk.utilization: + description: The percentage of storage space utilized. + unit: "%" + gauge: + value_type: double + enabled: true + attributes: [disk] + nsx.node.disk.usage: + description: The amount of storage space used by the node. + unit: By + sum: + monotonic: false + value_type: int + aggregation: cumulative + enabled: true + attributes: [disk] + node.load_balancer.utilization: + description: The utilization of load balancers by the node + unit: "%" + gauge: + value_type: double + enabled: true + attributes: [load_balancer] + node.memory.usage: + description: The memory usage of the node + unit: By + sum: + monotonic: false + value_type: int + aggregation: cumulative + enabled: true + node.cache.memory.usage: + description: The memory usage of the node’s cache + unit: By + sum: + monotonic: false + value_type: int + aggregation: cumulative + enabled: true diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index a92e08193715..c50b30786983 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -2,7 +2,9 @@ package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector import ( "context" + "fmt" "sync" + "time" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/model/pdata" @@ -31,7 +33,7 @@ func newScraper(cfg *Config, settings component.TelemetrySettings) *scraper { } func (s *scraper) start(ctx context.Context, host component.Host) error { - client, err := newClient(s.config, s.settings, host) + client, err := newClient(s.config, s.settings, host, s.logger.Named("client")) if err != nil { return err } @@ -41,26 +43,34 @@ func (s *scraper) start(ctx context.Context, host component.Host) error { func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { + colTime := pdata.NewTimestampFromTime(time.Now()) errs := &scrapererror.ScrapeErrors{} r := s.retrieve(ctx, errs) - s.process(r) - return pdata.NewMetrics(), nil + + s.process(r, colTime, errs) + return s.mb.Emit(), errs.Combine() } type retrieval struct { - nodes []dm.NodeStat - routers []dm.NetworkInterface - sync.RWMutex + nodes []nodeInfo +} + +type nodeInfo struct { + node dm.TransportNode + interfaces []dm.NetworkInterface + stats dm.NodeStatus } func (s *scraper) retrieve(ctx context.Context, errs *scrapererror.ScrapeErrors) *retrieval { r := &retrieval{} - wg := &sync.WaitGroup{} + nodes, err := s.retrieveNodes(ctx, r, errs) - wg.Add(2) - go s.retrieveNodes(ctx, r, wg, errs) - go s.retrieveRouters(ctx, r, wg, errs) + wg := &sync.WaitGroup{} + for _, n := range r.nodes { + go s.retrieveInterfaces(ctx, n, wg, errs) + go s.retrieveNodeStats(ctx, n, wg, errs) + } wg.Wait() return r @@ -69,46 +79,83 @@ func (s *scraper) retrieve(ctx context.Context, errs *scrapererror.ScrapeErrors) func (s *scraper) retrieveNodes( ctx context.Context, r *retrieval, + errs *scrapererror.ScrapeErrors, +) ([]dm.TransportNode, error) { + nodes, err := s.client.TransportNodes(ctx) + if err != nil { + errs.AddPartial(1, err) + return + } + r.nodes = nodes +} + +func (s *scraper) retrieveInterfaces( + ctx context.Context, + node dm.TransportNode, wg *sync.WaitGroup, errs *scrapererror.ScrapeErrors, ) { defer wg.Done() - - nodes, err := s.client.Nodes(ctx) + interfaces, err := s.client.Interfaces(ctx, node.ID) if err != nil { - s.logger.Error("unable to retrieve nodes", zap.Field{Key: "error", String: err.Error()}) + errs.AddPartial(1, err) + return } - r.Lock() - r.nodes = nodes - r.Unlock() - for _, n := range nodes { - interfaces, err := s.client.Interfaces(ctx, n.ID) - if err != nil { - errs.AddPartial(1, err) - continue - } - n.Interfaces = interfaces - } + interfaces } -func (s *scraper) retrieveRouters( +func (s *scraper) retrieveNodeStats( ctx context.Context, - r *retrieval, + node dm.TransportNode, wg *sync.WaitGroup, errs *scrapererror.ScrapeErrors, ) { defer wg.Done() + ns, err := s.client.NodeStatus(ctx, node.ID) + if err != nil { + errs.AddPartial(1, err) + return + } + node.Stats = ns } -func (s *scraper) process(retrieval *retrieval) { +func (s *scraper) process(retrieval *retrieval, colTime pdata.Timestamp, errs *scrapererror.ScrapeErrors) { for _, n := range retrieval.nodes { for _, i := range n.Interfaces { s.recordNodeInterface(n, i) } + s.recordNode(colTime, n) } } -func (s *scraper) recordNodeInterface(node dm.NodeStat, i dm.NetworkInterface) { +func (s *scraper) recordNodeInterface(node dm.TransportNode, i dm.NetworkInterface) { + +} + +func (s *scraper) recordNode(colTime pdata.Timestamp, node dm.TransportNode) { + s.logger.Info(fmt.Sprintf("Node ID: %s", node.ID)) + ss := node.Stats.SystemStatus + s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClass.Datapath) + s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClass.Services) + s.mb.RecordNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) + s.mb.RecordNodeCacheMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) + + s.mb.EmitForResource( + metadata.WithNsxNodeName(node.Name), + metadata.WithNsxNodeType(nodeType(node)), + ) +} +func nodeType(node dm.TransportNode) string { + switch { + case node.ResourceType == "TransportNode": + return "transport" + case node.ManagerRole != nil: + return "manager" + case node.ControllerRole != nil: + return "controller" + default: + return "" + } } From b7a1039eada8fa8d74ece947a58b4e239e044414 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 11:51:42 -0400 Subject: [PATCH 04/48] add logs and unit testing --- receiver/nsxreceiver/Makefile | 1 + receiver/nsxreceiver/client.go | 122 +- receiver/nsxreceiver/config.go | 23 +- receiver/nsxreceiver/config_test.go | 25 + receiver/nsxreceiver/documentation.md | 13 +- receiver/nsxreceiver/factory.go | 73 +- receiver/nsxreceiver/factory_test.go | 54 + receiver/nsxreceiver/go.mod | 6 + receiver/nsxreceiver/go.sum | 1 + .../internal/metadata/generated_metrics_v2.go | 439 ++-- .../nsxreceiver/internal/model/interface.go | 20 +- receiver/nsxreceiver/internal/model/node.go | 147 +- receiver/nsxreceiver/internal/model/router.go | 14 + receiver/nsxreceiver/logs.go | 61 + receiver/nsxreceiver/metadata.yaml | 32 +- receiver/nsxreceiver/mock_client_test.go | 165 ++ receiver/nsxreceiver/receiver.go | 68 + receiver/nsxreceiver/scraper.go | 205 +- receiver/nsxreceiver/scraper_test.go | 140 ++ .../testdata/metrics/cluster_nodes.json | 57 + .../testdata/metrics/expected_metrics.json | 1796 +++++++++++++++++ .../status.json | 9 + .../interfaces/eth0/stats.json | 15 + .../interfaces/index.json | 37 + .../interfaces/lo/stats.json | 15 + .../status.json | 131 ++ .../interfaces/index.json | 30 + .../interfaces/vmk10/stats.json | 13 + .../interfaces/vmnic0/stats.json | 13 + .../status.json | 137 ++ .../interfaces/index.json | 30 + .../interfaces/vmk10/stats.json | 13 + .../interfaces/vmnic0/stats.json | 13 + .../status.json | 137 ++ .../testdata/metrics/transport_nodes.json | 71 + 35 files changed, 3747 insertions(+), 379 deletions(-) create mode 100644 receiver/nsxreceiver/Makefile create mode 100644 receiver/nsxreceiver/logs.go create mode 100644 receiver/nsxreceiver/mock_client_test.go create mode 100644 receiver/nsxreceiver/receiver.go create mode 100644 receiver/nsxreceiver/scraper_test.go create mode 100644 receiver/nsxreceiver/testdata/metrics/cluster_nodes.json create mode 100644 receiver/nsxreceiver/testdata/metrics/expected_metrics.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json create mode 100644 receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json create mode 100644 receiver/nsxreceiver/testdata/metrics/transport_nodes.json diff --git a/receiver/nsxreceiver/Makefile b/receiver/nsxreceiver/Makefile new file mode 100644 index 000000000000..ded7a36092dc --- /dev/null +++ b/receiver/nsxreceiver/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go index 63dcdf585a5b..d6711e32335b 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxreceiver/client.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver import ( @@ -16,6 +30,17 @@ import ( dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" ) +var _ (Client) = &nsxClient{} + +// Client is a way of interacting with the NSX REST API +type Client interface { + TransportNodes(ctx context.Context) ([]dm.TransportNode, error) + ClusterNodes(ctx context.Context) ([]dm.ClusterNode, error) + NodeStatus(ctx context.Context, nodeID string, class nodeClass) (*dm.NodeStatus, error) + Interfaces(ctx context.Context, nodeID string, class nodeClass) ([]dm.NetworkInterface, error) + InterfaceStatus(ctx context.Context, nodeID, interfaceID string, class nodeClass) (*dm.NetworkInterfaceStats, error) +} + type nsxClient struct { config *Config driver *nsxt.APIClient @@ -29,10 +54,6 @@ var ( errUnauthorized = errors.New("STATUS 403, unauthorized") ) -const defaultMaxRetries = 3 -const defaultRetryMinDelay = 5 -const defaultRetryMaxDelay = 10 - func newClient(c *Config, settings component.TelemetrySettings, host component.Host, logger *zap.Logger) (*nsxClient, error) { client, err := c.MetricsConfig.HTTPClientSettings.ToClient(host.GetExtensions(), settings) if err != nil { @@ -66,32 +87,52 @@ func (c *nsxClient) TransportNodes(ctx context.Context) ([]dm.TransportNode, err return nodes.Results, err } -func (c *nsxClient) NodeStatus(ctx context.Context, nodeID string) (*dm.NodeStatus, error) { +func (c *nsxClient) ClusterNodes(ctx context.Context) ([]dm.ClusterNode, error) { body, err := c.doRequest( ctx, - fmt.Sprintf("/api/v1/transport-nodes/%s/status", nodeID), + "/api/v1/cluster/nodes", withDefaultHeaders(), ) if err != nil { - return nil, fmt.Errorf("unable to get a node's status from the REST API") + return nil, fmt.Errorf("unable to get cluster nodes: %w", err) } + var nodes dm.ClusterNodeList + err = json.Unmarshal(body, &nodes) - var nodestatus dm.TransportNodeStatus - err = json.Unmarshal(body, &nodestatus) + return nodes.Results, err +} + +func (c *nsxClient) NodeStatus(ctx context.Context, nodeID string, class nodeClass) (*dm.NodeStatus, error) { + body, err := c.doRequest( + ctx, + c.nodeStatusEndpoint(class, nodeID), + withDefaultHeaders(), + ) if err != nil { - return nil, fmt.Errorf("unable to unmarshal result of the node status request: %w", err) + return nil, fmt.Errorf("unable to get a node's status from the REST API: %w", err) } - c.logger.Info(fmt.Sprintf("here is the node status: %v", nodestatus.NodeStatus.SystemStatus)) - - return &nodestatus.NodeStatus, nil + switch class { + case transportClass: + var nodeStatus dm.TransportNodeStatus + err = json.Unmarshal(body, &nodeStatus) + return &nodeStatus.NodeStatus, err + default: + var nodeStatus dm.NodeStatus + err = json.Unmarshal(body, &nodeStatus) + return &nodeStatus, err + } } -func (c *nsxClient) Interfaces(ctx context.Context, nodeID string) ([]dm.NetworkInterface, error) { +func (c *nsxClient) Interfaces( + ctx context.Context, + nodeID string, + class nodeClass, +) ([]dm.NetworkInterface, error) { body, err := c.doRequest( ctx, - fmt.Sprintf("/api/v1/fabric/nodes/%s/network/interfaces", nodeID), + c.interfacesEndpoint(class, nodeID), withDefaultHeaders(), ) if err != nil { @@ -103,17 +144,27 @@ func (c *nsxClient) Interfaces(ctx context.Context, nodeID string) ([]dm.Network return interfaces.Results, err } -type requestOption func(req *http.Request) *http.Request +func (c *nsxClient) InterfaceStatus( + ctx context.Context, + nodeID, interfaceID string, + class nodeClass, +) (*dm.NetworkInterfaceStats, error) { + body, err := c.doRequest( + ctx, + c.interfaceStatusEndpoint(class, nodeID, interfaceID), + withDefaultHeaders(), + ) -func withQuery(key string, value string) requestOption { - return func(req *http.Request) *http.Request { - q := req.URL.Query() - q.Add(key, value) - req.URL.RawQuery = q.Encode() - return req + if err != nil { + return nil, fmt.Errorf("unable to get interface stats ") } + var interfaceStats dm.NetworkInterfaceStats + err = json.Unmarshal(body, &interfaceStats) + return &interfaceStats, nil } +type requestOption func(req *http.Request) *http.Request + func withDefaultHeaders() requestOption { return func(req *http.Request) *http.Request { h := req.Header @@ -161,3 +212,30 @@ func (c *nsxClient) doRequest(ctx context.Context, path string, options ...reque return nil, fmt.Errorf("got non 200 status code %d: %w, %s", resp.StatusCode, err, string(body)) } } + +func (c *nsxClient) nodeStatusEndpoint(class nodeClass, nodeID string) string { + switch class { + case transportClass: + return fmt.Sprintf("/api/v1/transport-nodes/%s/status", nodeID) + default: + return fmt.Sprintf("/api/v1/cluster/nodes/%s/status", nodeID) + } +} + +func (c *nsxClient) interfacesEndpoint(class nodeClass, nodeID string) string { + switch class { + case transportClass: + return fmt.Sprintf("/api/v1/transport-nodes/%s/status", nodeID) + default: + return fmt.Sprintf("/api/v1/cluster/nodes/%s/status", nodeID) + } +} + +func (c *nsxClient) interfaceStatusEndpoint(class nodeClass, nodeID, interfaceID string) string { + switch class { + case transportClass: + return fmt.Sprintf("/api/v1/fabric/nodes/%s/network/interfaces/%s/stats", nodeID, interfaceID) + default: + return fmt.Sprintf("/api/v1/cluster/nodes/%s/network/interfaces/%s/stats", nodeID, interfaceID) + } +} diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index 4e4b077070c5..e2653da7f948 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver import ( @@ -10,11 +24,11 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver" ) -// Config is the configuraiton for the NSX receiver +// Config is the configuration for the NSX receiver type Config struct { config.ReceiverSettings `mapstructure:",squash"` - MetricsConfig MetricsConfig `mapstructure:"metrics"` - LoggingConfig MetricsConfig `mapstructure:"logs"` + MetricsConfig *MetricsConfig `mapstructure:"metrics"` + LoggingConfig *LoggingConfig `mapstructure:"logs"` } // MetricsConfig is the metrics configuration portion of the nsxreceiver @@ -44,6 +58,9 @@ func (c *Config) validateMetrics() error { } func (c *Config) validateLogs() error { + if c.LoggingConfig != nil { + return c.LoggingConfig.Validate() + } return nil } diff --git a/receiver/nsxreceiver/config_test.go b/receiver/nsxreceiver/config_test.go index 83ee8b5dc7c1..c3342ec4cf2d 100644 --- a/receiver/nsxreceiver/config_test.go +++ b/receiver/nsxreceiver/config_test.go @@ -1 +1,26 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestID(t *testing.T) { + config := createDefaultConfig() + require.NotEmpty(t, config.ID()) +} diff --git a/receiver/nsxreceiver/documentation.md b/receiver/nsxreceiver/documentation.md index 4ea7e1f2c120..72e548f57282 100644 --- a/receiver/nsxreceiver/documentation.md +++ b/receiver/nsxreceiver/documentation.md @@ -8,15 +8,14 @@ These are the metrics available for this scraper. | Name | Description | Unit | Type | Attributes | | ---- | ----------- | ---- | ---- | ---------- | -| **node.cache.memory.usage** | The memory usage of the node’s cache | By | Sum(Int) |
| -| **node.cache.network.throughput** | The memory usage of the node’s cache | By | Sum(Int) |
| -| **node.load_balancer.utilization** | The utilization of load balancers by the node | % | Gauge(Double) |
  • load_balancer
| -| **node.memory.usage** | The memory usage of the node | By | Sum(Int) |
| -| **nsx.interface.packet.count** | The number of packets flowing through the network interface. | {messages} | Sum(Int) |
  • direction
| -| **nsx.interface.throughput** | The number of messages published to a queue. | {messages} | Sum(Int) |
  • direction
| +| **nsx.interface.packet.count** | The number of packets flowing through the network interface on the node. | {packets} | Sum(Int) |
  • direction
  • packet.type
| +| **nsx.interface.throughput** | The number of Bytes flowing through the network interface. | By | Sum(Int) |
  • direction
| +| **nsx.node.cache.memory.usage** | The memory usage of the node's cache | KBy | Sum(Int) |
| | **nsx.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • cpu.process.class
| | **nsx.node.disk.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk
| | **nsx.node.disk.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
  • disk
| +| **nsx.node.load_balancer.utilization** | The utilization of load balancers by the node | % | Gauge(Double) |
  • load_balancer
| +| **nsx.node.memory.usage** | The memory usage of the node | KBy | Sum(Int) |
| **Highlighted metrics** are emitted by default. Other metrics are optional and not emitted by default. Any metric can be enabled or disabled with the following scraper configuration: @@ -32,6 +31,7 @@ metrics: | Name | Description | Type | | ---- | ----------- | ---- | | nsx.interface.id | The name of the network interface. | String | +| nsx.node.id | The ID of the NSX Node. | String | | nsx.node.name | The name of the NSX Node. | String | | nsx.node.type | The type of NSX Node. | String | @@ -43,3 +43,4 @@ metrics: | direction (direction) | The direction of network flow | received, transmitted | | disk (disk) | The name of the mounted storage | | | load_balancer | The name of the load balancer being utilized | | +| packet.type (type) | The type of packet counter | dropped, errored, success | diff --git a/receiver/nsxreceiver/factory.go b/receiver/nsxreceiver/factory.go index f143af43f02b..b8126e548ba9 100644 --- a/receiver/nsxreceiver/factory.go +++ b/receiver/nsxreceiver/factory.go @@ -1,42 +1,87 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver import ( "context" "errors" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver/scraperhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver" ) const typeStr = "nsx" var errConfigNotNSX = errors.New("config was not a NSX receiver config") +type nsxReceiverFactory struct { + receivers map[*Config]*nsxReceiver +} + // NewFactory creates a new receiver factory func NewFactory() component.ReceiverFactory { + f := &nsxReceiverFactory{ + receivers: make(map[*Config]*nsxReceiver, 1), + } return component.NewReceiverFactory( typeStr, createDefaultConfig, - component.WithMetricsReceiver(createMetricsReceiver)) + component.WithMetricsReceiver(f.createMetricsReceiver), + component.WithLogsReceiver(f.createLogsReceiver), + ) } func createDefaultConfig() config.Receiver { + syslogConfig := syslogreceiver.NewFactory().CreateDefaultConfig() + sConf := syslogConfig.(*syslogreceiver.SysLogConfig) return &Config{ - MetricsConfig: MetricsConfig{ + MetricsConfig: &MetricsConfig{ ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(typeStr), Settings: metadata.DefaultMetricsSettings(), }, + LoggingConfig: &LoggingConfig{ + SysLogConfig: sConf, + }, + } +} + +func (f *nsxReceiverFactory) ensureReceiver(params component.ReceiverCreateSettings, config config.Receiver) *nsxReceiver { + receiver := f.receivers[config.(*Config)] + if receiver != nil { + return receiver + } + rconfig := config.(*Config) + receiver = &nsxReceiver{ + logger: params.Logger, + config: rconfig, } + f.receivers[config.(*Config)] = receiver + return receiver } -func createMetricsReceiver(ctx context.Context, params component.ReceiverCreateSettings, rConf config.Receiver, consumer consumer.Metrics) (component.MetricsReceiver, error) { +func (f *nsxReceiverFactory) createMetricsReceiver(ctx context.Context, params component.ReceiverCreateSettings, rConf config.Receiver, consumer consumer.Metrics) (component.MetricsReceiver, error) { cfg, ok := rConf.(*Config) if !ok { return nil, errConfigNotNSX } + r := f.ensureReceiver(params, cfg) s := newScraper(cfg, params.TelemetrySettings) scraper, err := scraperhelper.NewScraper( @@ -48,10 +93,28 @@ func createMetricsReceiver(ctx context.Context, params component.ReceiverCreateS return nil, err } - return scraperhelper.NewScraperControllerReceiver( + scraperController, err := scraperhelper.NewScraperControllerReceiver( &cfg.MetricsConfig.ScraperControllerSettings, params, consumer, scraperhelper.AddScraper(scraper), ) + + r.scraper = scraperController + return r, err +} + +func (f *nsxReceiverFactory) createLogsReceiver( + c context.Context, + params component.ReceiverCreateSettings, + rConf config.Receiver, + consumer consumer.Logs, +) (component.LogsReceiver, error) { + cfg, ok := rConf.(*Config) + if !ok { + return nil, errConfigNotNSX + } + rcvr := f.ensureReceiver(params, cfg) + rcvr.logsReceiver = newLogsReceiver(cfg, params, consumer) + return rcvr, nil } diff --git a/receiver/nsxreceiver/factory_test.go b/receiver/nsxreceiver/factory_test.go index 83ee8b5dc7c1..95e837bb36a7 100644 --- a/receiver/nsxreceiver/factory_test.go +++ b/receiver/nsxreceiver/factory_test.go @@ -1 +1,55 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver/scraperhelper" +) + +func TestType(t *testing.T) { + factory := NewFactory() + ft := factory.Type() + require.EqualValues(t, "nsx", ft) +} + +func TestValidConfig(t *testing.T) { + factory := NewFactory() + err := factory.CreateDefaultConfig().Validate() + require.NoError(t, err) +} + +func TestCreateMetricsReceiver(t *testing.T) { + factory := NewFactory() + _, err := factory.CreateMetricsReceiver( + context.Background(), + componenttest.NewNopReceiverCreateSettings(), + &Config{ + MetricsConfig: &MetricsConfig{ + ScraperControllerSettings: scraperhelper.ScraperControllerSettings{ + CollectionInterval: 10 * time.Second, + }, + }, + }, + consumertest.NewNop(), + ) + require.NoError(t, err) +} diff --git a/receiver/nsxreceiver/go.mod b/receiver/nsxreceiver/go.mod index 5ebce46b1b52..df58365b0262 100644 --- a/receiver/nsxreceiver/go.mod +++ b/receiver/nsxreceiver/go.mod @@ -36,6 +36,7 @@ require ( github.com/klauspost/compress v1.15.1 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.0.0-00010101000000-000000000000 github.com/rs/cors v1.8.2 // indirect + github.com/stretchr/testify v1.7.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect go.uber.org/multierr v1.8.0 go.uber.org/zap v1.21.0 @@ -45,18 +46,23 @@ require ( require ( github.com/antonmedv/expr v1.9.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/observiq/ctimefmt v1.0.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-collector-contrib/internal/stanza v0.49.0 // indirect github.com/open-telemetry/opentelemetry-log-collection v0.29.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/objx v0.3.0 // indirect golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7 // indirect gonum.org/v1/gonum v0.11.0 // indirect google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest => ../../internal/scrapertest diff --git a/receiver/nsxreceiver/go.sum b/receiver/nsxreceiver/go.sum index f728db1cc657..c77b4fdd88cb 100644 --- a/receiver/nsxreceiver/go.sum +++ b/receiver/nsxreceiver/go.sum @@ -272,6 +272,7 @@ 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.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= +github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go index 0636764e32f9..9f9eac3dbcc3 100644 --- a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go @@ -16,66 +16,63 @@ type MetricSettings struct { // MetricsSettings provides settings for nsxreceiver metrics. type MetricsSettings struct { - NodeCacheMemoryUsage MetricSettings `mapstructure:"node.cache.memory.usage"` - NodeCacheNetworkThroughput MetricSettings `mapstructure:"node.cache.network.throughput"` - NodeLoadBalancerUtilization MetricSettings `mapstructure:"node.load_balancer.utilization"` - NodeMemoryUsage MetricSettings `mapstructure:"node.memory.usage"` - NsxInterfacePacketCount MetricSettings `mapstructure:"nsx.interface.packet.count"` - NsxInterfaceThroughput MetricSettings `mapstructure:"nsx.interface.throughput"` - NsxNodeCPUUtilization MetricSettings `mapstructure:"nsx.node.cpu.utilization"` - NsxNodeDiskUsage MetricSettings `mapstructure:"nsx.node.disk.usage"` - NsxNodeDiskUtilization MetricSettings `mapstructure:"nsx.node.disk.utilization"` + NsxInterfacePacketCount MetricSettings `mapstructure:"nsx.interface.packet.count"` + NsxInterfaceThroughput MetricSettings `mapstructure:"nsx.interface.throughput"` + NsxNodeCacheMemoryUsage MetricSettings `mapstructure:"nsx.node.cache.memory.usage"` + NsxNodeCPUUtilization MetricSettings `mapstructure:"nsx.node.cpu.utilization"` + NsxNodeDiskUsage MetricSettings `mapstructure:"nsx.node.disk.usage"` + NsxNodeDiskUtilization MetricSettings `mapstructure:"nsx.node.disk.utilization"` + NsxNodeLoadBalancerUtilization MetricSettings `mapstructure:"nsx.node.load_balancer.utilization"` + NsxNodeMemoryUsage MetricSettings `mapstructure:"nsx.node.memory.usage"` } func DefaultMetricsSettings() MetricsSettings { return MetricsSettings{ - NodeCacheMemoryUsage: MetricSettings{ - Enabled: true, - }, - NodeCacheNetworkThroughput: MetricSettings{ + NsxInterfacePacketCount: MetricSettings{ Enabled: true, }, - NodeLoadBalancerUtilization: MetricSettings{ + NsxInterfaceThroughput: MetricSettings{ Enabled: true, }, - NodeMemoryUsage: MetricSettings{ + NsxNodeCacheMemoryUsage: MetricSettings{ Enabled: true, }, - NsxInterfacePacketCount: MetricSettings{ + NsxNodeCPUUtilization: MetricSettings{ Enabled: true, }, - NsxInterfaceThroughput: MetricSettings{ + NsxNodeDiskUsage: MetricSettings{ Enabled: true, }, - NsxNodeCPUUtilization: MetricSettings{ + NsxNodeDiskUtilization: MetricSettings{ Enabled: true, }, - NsxNodeDiskUsage: MetricSettings{ + NsxNodeLoadBalancerUtilization: MetricSettings{ Enabled: true, }, - NsxNodeDiskUtilization: MetricSettings{ + NsxNodeMemoryUsage: MetricSettings{ Enabled: true, }, } } -type metricNodeCacheMemoryUsage struct { +type metricNsxInterfacePacketCount struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills node.cache.memory.usage metric with initial data. -func (m *metricNodeCacheMemoryUsage) init() { - m.data.SetName("node.cache.memory.usage") - m.data.SetDescription("The memory usage of the node’s cache") - m.data.SetUnit("By") +// init fills nsx.interface.packet.count metric with initial data. +func (m *metricNsxInterfacePacketCount) init() { + m.data.SetName("nsx.interface.packet.count") + m.data.SetDescription("The number of packets flowing through the network interface on the node.") + m.data.SetUnit("{packets}") m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetIsMonotonic(true) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { +func (m *metricNsxInterfacePacketCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string, packetTypeAttributeValue string) { if !m.settings.Enabled { return } @@ -83,17 +80,19 @@ func (m *metricNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) + dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) + dp.Attributes().Insert(A.PacketType, pcommon.NewValueString(packetTypeAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNodeCacheMemoryUsage) updateCapacity() { +func (m *metricNsxInterfacePacketCount) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxInterfacePacketCount) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -101,8 +100,8 @@ func (m *metricNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { } } -func newMetricNodeCacheMemoryUsage(settings MetricSettings) metricNodeCacheMemoryUsage { - m := metricNodeCacheMemoryUsage{settings: settings} +func newMetricNsxInterfacePacketCount(settings MetricSettings) metricNsxInterfacePacketCount { + m := metricNsxInterfacePacketCount{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -110,23 +109,24 @@ func newMetricNodeCacheMemoryUsage(settings MetricSettings) metricNodeCacheMemor return m } -type metricNodeCacheNetworkThroughput struct { +type metricNsxInterfaceThroughput struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills node.cache.network.throughput metric with initial data. -func (m *metricNodeCacheNetworkThroughput) init() { - m.data.SetName("node.cache.network.throughput") - m.data.SetDescription("The memory usage of the node’s cache") +// init fills nsx.interface.throughput metric with initial data. +func (m *metricNsxInterfaceThroughput) init() { + m.data.SetName("nsx.interface.throughput") + m.data.SetDescription("The number of Bytes flowing through the network interface.") m.data.SetUnit("By") m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetIsMonotonic(true) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNodeCacheNetworkThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { +func (m *metricNsxInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { if !m.settings.Enabled { return } @@ -134,17 +134,18 @@ func (m *metricNodeCacheNetworkThroughput) recordDataPoint(start pcommon.Timesta dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) + dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNodeCacheNetworkThroughput) updateCapacity() { +func (m *metricNsxInterfaceThroughput) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNodeCacheNetworkThroughput) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxInterfaceThroughput) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -152,59 +153,8 @@ func (m *metricNodeCacheNetworkThroughput) emit(metrics pmetric.MetricSlice) { } } -func newMetricNodeCacheNetworkThroughput(settings MetricSettings) metricNodeCacheNetworkThroughput { - m := metricNodeCacheNetworkThroughput{settings: settings} - if settings.Enabled { - m.data = pmetric.NewMetric() - m.init() - } - return m -} - -type metricNodeLoadBalancerUtilization struct { - data pmetric.Metric // data buffer for generated metric. - settings MetricSettings // metric settings provided by user. - capacity int // max observed number of data points added to the metric. -} - -// init fills node.load_balancer.utilization metric with initial data. -func (m *metricNodeLoadBalancerUtilization) init() { - m.data.SetName("node.load_balancer.utilization") - m.data.SetDescription("The utilization of load balancers by the node") - m.data.SetUnit("%") - m.data.SetDataType(pmetric.MetricDataTypeGauge) - m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) -} - -func (m *metricNodeLoadBalancerUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { - if !m.settings.Enabled { - return - } - dp := m.data.Gauge().DataPoints().AppendEmpty() - dp.SetStartTimestamp(start) - dp.SetTimestamp(ts) - dp.SetDoubleVal(val) - dp.Attributes().Insert(A.LoadBalancer, pcommon.NewValueString(loadBalancerAttributeValue)) -} - -// updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNodeLoadBalancerUtilization) updateCapacity() { - if m.data.Gauge().DataPoints().Len() > m.capacity { - m.capacity = m.data.Gauge().DataPoints().Len() - } -} - -// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNodeLoadBalancerUtilization) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { - m.updateCapacity() - m.data.MoveTo(metrics.AppendEmpty()) - m.init() - } -} - -func newMetricNodeLoadBalancerUtilization(settings MetricSettings) metricNodeLoadBalancerUtilization { - m := metricNodeLoadBalancerUtilization{settings: settings} +func newMetricNsxInterfaceThroughput(settings MetricSettings) metricNsxInterfaceThroughput { + m := metricNsxInterfaceThroughput{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -212,23 +162,23 @@ func newMetricNodeLoadBalancerUtilization(settings MetricSettings) metricNodeLoa return m } -type metricNodeMemoryUsage struct { +type metricNsxNodeCacheMemoryUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills node.memory.usage metric with initial data. -func (m *metricNodeMemoryUsage) init() { - m.data.SetName("node.memory.usage") - m.data.SetDescription("The memory usage of the node") - m.data.SetUnit("By") +// init fills nsx.node.cache.memory.usage metric with initial data. +func (m *metricNsxNodeCacheMemoryUsage) init() { + m.data.SetName("nsx.node.cache.memory.usage") + m.data.SetDescription("The memory usage of the node's cache") + m.data.SetUnit("KBy") m.data.SetDataType(pmetric.MetricDataTypeSum) m.data.Sum().SetIsMonotonic(false) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) } -func (m *metricNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { +func (m *metricNsxNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { if !m.settings.Enabled { return } @@ -239,14 +189,14 @@ func (m *metricNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcom } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNodeMemoryUsage) updateCapacity() { +func (m *metricNsxNodeCacheMemoryUsage) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -254,8 +204,8 @@ func (m *metricNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { } } -func newMetricNodeMemoryUsage(settings MetricSettings) metricNodeMemoryUsage { - m := metricNodeMemoryUsage{settings: settings} +func newMetricNsxNodeCacheMemoryUsage(settings MetricSettings) metricNsxNodeCacheMemoryUsage { + m := metricNsxNodeCacheMemoryUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -263,52 +213,50 @@ func newMetricNodeMemoryUsage(settings MetricSettings) metricNodeMemoryUsage { return m } -type metricNsxInterfacePacketCount struct { +type metricNsxNodeCPUUtilization struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.interface.packet.count metric with initial data. -func (m *metricNsxInterfacePacketCount) init() { - m.data.SetName("nsx.interface.packet.count") - m.data.SetDescription("The number of packets flowing through the network interface.") - m.data.SetUnit("{messages}") - m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(true) - m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) - m.data.Sum().DataPoints().EnsureCapacity(m.capacity) +// init fills nsx.node.cpu.utilization metric with initial data. +func (m *metricNsxNodeCPUUtilization) init() { + m.data.SetName("nsx.node.cpu.utilization") + m.data.SetDescription("The average amount of CPU being used by the node.") + m.data.SetUnit("%") + m.data.SetDataType(pmetric.MetricDataTypeGauge) + m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxInterfacePacketCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { +func (m *metricNsxNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { if !m.settings.Enabled { return } - dp := m.data.Sum().DataPoints().AppendEmpty() + dp := m.data.Gauge().DataPoints().AppendEmpty() dp.SetStartTimestamp(start) dp.SetTimestamp(ts) - dp.SetIntVal(val) - dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) + dp.SetDoubleVal(val) + dp.Attributes().Insert(A.CPUProcessClass, pcommon.NewValueString(cpuProcessClassAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxInterfacePacketCount) updateCapacity() { - if m.data.Sum().DataPoints().Len() > m.capacity { - m.capacity = m.data.Sum().DataPoints().Len() +func (m *metricNsxNodeCPUUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxInterfacePacketCount) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { +func (m *metricNsxNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) m.init() } } -func newMetricNsxInterfacePacketCount(settings MetricSettings) metricNsxInterfacePacketCount { - m := metricNsxInterfacePacketCount{settings: settings} +func newMetricNsxNodeCPUUtilization(settings MetricSettings) metricNsxNodeCPUUtilization { + m := metricNsxNodeCPUUtilization{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -316,24 +264,24 @@ func newMetricNsxInterfacePacketCount(settings MetricSettings) metricNsxInterfac return m } -type metricNsxInterfaceThroughput struct { +type metricNsxNodeDiskUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.interface.throughput metric with initial data. -func (m *metricNsxInterfaceThroughput) init() { - m.data.SetName("nsx.interface.throughput") - m.data.SetDescription("The number of messages published to a queue.") - m.data.SetUnit("{messages}") +// init fills nsx.node.disk.usage metric with initial data. +func (m *metricNsxNodeDiskUsage) init() { + m.data.SetName("nsx.node.disk.usage") + m.data.SetDescription("The amount of storage space used by the node.") + m.data.SetUnit("By") m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(true) + m.data.Sum().SetIsMonotonic(false) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { +func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskAttributeValue string) { if !m.settings.Enabled { return } @@ -341,18 +289,18 @@ func (m *metricNsxInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) - dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) + dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxInterfaceThroughput) updateCapacity() { +func (m *metricNsxNodeDiskUsage) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxInterfaceThroughput) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxNodeDiskUsage) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -360,8 +308,8 @@ func (m *metricNsxInterfaceThroughput) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxInterfaceThroughput(settings MetricSettings) metricNsxInterfaceThroughput { - m := metricNsxInterfaceThroughput{settings: settings} +func newMetricNsxNodeDiskUsage(settings MetricSettings) metricNsxNodeDiskUsage { + m := metricNsxNodeDiskUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -369,22 +317,22 @@ func newMetricNsxInterfaceThroughput(settings MetricSettings) metricNsxInterface return m } -type metricNsxNodeCPUUtilization struct { +type metricNsxNodeDiskUtilization struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.cpu.utilization metric with initial data. -func (m *metricNsxNodeCPUUtilization) init() { - m.data.SetName("nsx.node.cpu.utilization") - m.data.SetDescription("The average amount of CPU being used by the node.") +// init fills nsx.node.disk.utilization metric with initial data. +func (m *metricNsxNodeDiskUtilization) init() { + m.data.SetName("nsx.node.disk.utilization") + m.data.SetDescription("The percentage of storage space utilized.") m.data.SetUnit("%") m.data.SetDataType(pmetric.MetricDataTypeGauge) m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { +func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, diskAttributeValue string) { if !m.settings.Enabled { return } @@ -392,18 +340,18 @@ func (m *metricNsxNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, t dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetDoubleVal(val) - dp.Attributes().Insert(A.CPUProcessClass, pcommon.NewValueString(cpuProcessClassAttributeValue)) + dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeCPUUtilization) updateCapacity() { +func (m *metricNsxNodeDiskUtilization) updateCapacity() { if m.data.Gauge().DataPoints().Len() > m.capacity { m.capacity = m.data.Gauge().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxNodeDiskUtilization) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -411,8 +359,8 @@ func (m *metricNsxNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxNodeCPUUtilization(settings MetricSettings) metricNsxNodeCPUUtilization { - m := metricNsxNodeCPUUtilization{settings: settings} +func newMetricNsxNodeDiskUtilization(settings MetricSettings) metricNsxNodeDiskUtilization { + m := metricNsxNodeDiskUtilization{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -420,52 +368,50 @@ func newMetricNsxNodeCPUUtilization(settings MetricSettings) metricNsxNodeCPUUti return m } -type metricNsxNodeDiskUsage struct { +type metricNsxNodeLoadBalancerUtilization struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.disk.usage metric with initial data. -func (m *metricNsxNodeDiskUsage) init() { - m.data.SetName("nsx.node.disk.usage") - m.data.SetDescription("The amount of storage space used by the node.") - m.data.SetUnit("By") - m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(false) - m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) - m.data.Sum().DataPoints().EnsureCapacity(m.capacity) +// init fills nsx.node.load_balancer.utilization metric with initial data. +func (m *metricNsxNodeLoadBalancerUtilization) init() { + m.data.SetName("nsx.node.load_balancer.utilization") + m.data.SetDescription("The utilization of load balancers by the node") + m.data.SetUnit("%") + m.data.SetDataType(pmetric.MetricDataTypeGauge) + m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskAttributeValue string) { +func (m *metricNsxNodeLoadBalancerUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { if !m.settings.Enabled { return } - dp := m.data.Sum().DataPoints().AppendEmpty() + dp := m.data.Gauge().DataPoints().AppendEmpty() dp.SetStartTimestamp(start) dp.SetTimestamp(ts) - dp.SetIntVal(val) - dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) + dp.SetDoubleVal(val) + dp.Attributes().Insert(A.LoadBalancer, pcommon.NewValueString(loadBalancerAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeDiskUsage) updateCapacity() { - if m.data.Sum().DataPoints().Len() > m.capacity { - m.capacity = m.data.Sum().DataPoints().Len() +func (m *metricNsxNodeLoadBalancerUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeDiskUsage) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { +func (m *metricNsxNodeLoadBalancerUtilization) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) m.init() } } -func newMetricNsxNodeDiskUsage(settings MetricSettings) metricNsxNodeDiskUsage { - m := metricNsxNodeDiskUsage{settings: settings} +func newMetricNsxNodeLoadBalancerUtilization(settings MetricSettings) metricNsxNodeLoadBalancerUtilization { + m := metricNsxNodeLoadBalancerUtilization{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -473,50 +419,50 @@ func newMetricNsxNodeDiskUsage(settings MetricSettings) metricNsxNodeDiskUsage { return m } -type metricNsxNodeDiskUtilization struct { +type metricNsxNodeMemoryUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.disk.utilization metric with initial data. -func (m *metricNsxNodeDiskUtilization) init() { - m.data.SetName("nsx.node.disk.utilization") - m.data.SetDescription("The percentage of storage space utilized.") - m.data.SetUnit("%") - m.data.SetDataType(pmetric.MetricDataTypeGauge) - m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) +// init fills nsx.node.memory.usage metric with initial data. +func (m *metricNsxNodeMemoryUsage) init() { + m.data.SetName("nsx.node.memory.usage") + m.data.SetDescription("The memory usage of the node") + m.data.SetUnit("KBy") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) } -func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, diskAttributeValue string) { +func (m *metricNsxNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { if !m.settings.Enabled { return } - dp := m.data.Gauge().DataPoints().AppendEmpty() + dp := m.data.Sum().DataPoints().AppendEmpty() dp.SetStartTimestamp(start) dp.SetTimestamp(ts) - dp.SetDoubleVal(val) - dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) + dp.SetIntVal(val) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeDiskUtilization) updateCapacity() { - if m.data.Gauge().DataPoints().Len() > m.capacity { - m.capacity = m.data.Gauge().DataPoints().Len() +func (m *metricNsxNodeMemoryUsage) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeDiskUtilization) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { +func (m *metricNsxNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) m.init() } } -func newMetricNsxNodeDiskUtilization(settings MetricSettings) metricNsxNodeDiskUtilization { - m := metricNsxNodeDiskUtilization{settings: settings} +func newMetricNsxNodeMemoryUsage(settings MetricSettings) metricNsxNodeMemoryUsage { + m := metricNsxNodeMemoryUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -527,19 +473,18 @@ func newMetricNsxNodeDiskUtilization(settings MetricSettings) metricNsxNodeDiskU // MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations // required to produce metric representation defined in metadata and user settings. type MetricsBuilder struct { - startTime pcommon.Timestamp // start time that will be applied to all recorded data points. - metricsCapacity int // maximum observed number of metrics per resource. - resourceCapacity int // maximum observed number of resource attributes. - metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. - metricNodeCacheMemoryUsage metricNodeCacheMemoryUsage - metricNodeCacheNetworkThroughput metricNodeCacheNetworkThroughput - metricNodeLoadBalancerUtilization metricNodeLoadBalancerUtilization - metricNodeMemoryUsage metricNodeMemoryUsage - metricNsxInterfacePacketCount metricNsxInterfacePacketCount - metricNsxInterfaceThroughput metricNsxInterfaceThroughput - metricNsxNodeCPUUtilization metricNsxNodeCPUUtilization - metricNsxNodeDiskUsage metricNsxNodeDiskUsage - metricNsxNodeDiskUtilization metricNsxNodeDiskUtilization + startTime pcommon.Timestamp // start time that will be applied to all recorded data points. + metricsCapacity int // maximum observed number of metrics per resource. + resourceCapacity int // maximum observed number of resource attributes. + metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. + metricNsxInterfacePacketCount metricNsxInterfacePacketCount + metricNsxInterfaceThroughput metricNsxInterfaceThroughput + metricNsxNodeCacheMemoryUsage metricNsxNodeCacheMemoryUsage + metricNsxNodeCPUUtilization metricNsxNodeCPUUtilization + metricNsxNodeDiskUsage metricNsxNodeDiskUsage + metricNsxNodeDiskUtilization metricNsxNodeDiskUtilization + metricNsxNodeLoadBalancerUtilization metricNsxNodeLoadBalancerUtilization + metricNsxNodeMemoryUsage metricNsxNodeMemoryUsage } // metricBuilderOption applies changes to default metrics builder. @@ -554,17 +499,16 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ - startTime: pcommon.NewTimestampFromTime(time.Now()), - metricsBuffer: pmetric.NewMetrics(), - metricNodeCacheMemoryUsage: newMetricNodeCacheMemoryUsage(settings.NodeCacheMemoryUsage), - metricNodeCacheNetworkThroughput: newMetricNodeCacheNetworkThroughput(settings.NodeCacheNetworkThroughput), - metricNodeLoadBalancerUtilization: newMetricNodeLoadBalancerUtilization(settings.NodeLoadBalancerUtilization), - metricNodeMemoryUsage: newMetricNodeMemoryUsage(settings.NodeMemoryUsage), - metricNsxInterfacePacketCount: newMetricNsxInterfacePacketCount(settings.NsxInterfacePacketCount), - metricNsxInterfaceThroughput: newMetricNsxInterfaceThroughput(settings.NsxInterfaceThroughput), - metricNsxNodeCPUUtilization: newMetricNsxNodeCPUUtilization(settings.NsxNodeCPUUtilization), - metricNsxNodeDiskUsage: newMetricNsxNodeDiskUsage(settings.NsxNodeDiskUsage), - metricNsxNodeDiskUtilization: newMetricNsxNodeDiskUtilization(settings.NsxNodeDiskUtilization), + startTime: pcommon.NewTimestampFromTime(time.Now()), + metricsBuffer: pmetric.NewMetrics(), + metricNsxInterfacePacketCount: newMetricNsxInterfacePacketCount(settings.NsxInterfacePacketCount), + metricNsxInterfaceThroughput: newMetricNsxInterfaceThroughput(settings.NsxInterfaceThroughput), + metricNsxNodeCacheMemoryUsage: newMetricNsxNodeCacheMemoryUsage(settings.NsxNodeCacheMemoryUsage), + metricNsxNodeCPUUtilization: newMetricNsxNodeCPUUtilization(settings.NsxNodeCPUUtilization), + metricNsxNodeDiskUsage: newMetricNsxNodeDiskUsage(settings.NsxNodeDiskUsage), + metricNsxNodeDiskUtilization: newMetricNsxNodeDiskUtilization(settings.NsxNodeDiskUtilization), + metricNsxNodeLoadBalancerUtilization: newMetricNsxNodeLoadBalancerUtilization(settings.NsxNodeLoadBalancerUtilization), + metricNsxNodeMemoryUsage: newMetricNsxNodeMemoryUsage(settings.NsxNodeMemoryUsage), } for _, op := range options { op(mb) @@ -592,6 +536,13 @@ func WithNsxInterfaceID(val string) ResourceOption { } } +// WithNsxNodeID sets provided value as "nsx.node.id" attribute for current resource. +func WithNsxNodeID(val string) ResourceOption { + return func(r pcommon.Resource) { + r.Attributes().UpsertString("nsx.node.id", val) + } +} + // WithNsxNodeName sets provided value as "nsx.node.name" attribute for current resource. func WithNsxNodeName(val string) ResourceOption { return func(r pcommon.Resource) { @@ -619,15 +570,14 @@ func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption) { ils := rm.ScopeMetrics().AppendEmpty() ils.Scope().SetName("otelcol/nsxreceiver") ils.Metrics().EnsureCapacity(mb.metricsCapacity) - mb.metricNodeCacheMemoryUsage.emit(ils.Metrics()) - mb.metricNodeCacheNetworkThroughput.emit(ils.Metrics()) - mb.metricNodeLoadBalancerUtilization.emit(ils.Metrics()) - mb.metricNodeMemoryUsage.emit(ils.Metrics()) mb.metricNsxInterfacePacketCount.emit(ils.Metrics()) mb.metricNsxInterfaceThroughput.emit(ils.Metrics()) + mb.metricNsxNodeCacheMemoryUsage.emit(ils.Metrics()) mb.metricNsxNodeCPUUtilization.emit(ils.Metrics()) mb.metricNsxNodeDiskUsage.emit(ils.Metrics()) mb.metricNsxNodeDiskUtilization.emit(ils.Metrics()) + mb.metricNsxNodeLoadBalancerUtilization.emit(ils.Metrics()) + mb.metricNsxNodeMemoryUsage.emit(ils.Metrics()) if ils.Metrics().Len() > 0 { mb.updateCapacity(rm) rm.MoveTo(mb.metricsBuffer.ResourceMetrics().AppendEmpty()) @@ -644,29 +594,9 @@ func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics { return metrics } -// RecordNodeCacheMemoryUsageDataPoint adds a data point to node.cache.memory.usage metric. -func (mb *MetricsBuilder) RecordNodeCacheMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { - mb.metricNodeCacheMemoryUsage.recordDataPoint(mb.startTime, ts, val) -} - -// RecordNodeCacheNetworkThroughputDataPoint adds a data point to node.cache.network.throughput metric. -func (mb *MetricsBuilder) RecordNodeCacheNetworkThroughputDataPoint(ts pcommon.Timestamp, val int64) { - mb.metricNodeCacheNetworkThroughput.recordDataPoint(mb.startTime, ts, val) -} - -// RecordNodeLoadBalancerUtilizationDataPoint adds a data point to node.load_balancer.utilization metric. -func (mb *MetricsBuilder) RecordNodeLoadBalancerUtilizationDataPoint(ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { - mb.metricNodeLoadBalancerUtilization.recordDataPoint(mb.startTime, ts, val, loadBalancerAttributeValue) -} - -// RecordNodeMemoryUsageDataPoint adds a data point to node.memory.usage metric. -func (mb *MetricsBuilder) RecordNodeMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { - mb.metricNodeMemoryUsage.recordDataPoint(mb.startTime, ts, val) -} - // RecordNsxInterfacePacketCountDataPoint adds a data point to nsx.interface.packet.count metric. -func (mb *MetricsBuilder) RecordNsxInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue string) { - mb.metricNsxInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue) +func (mb *MetricsBuilder) RecordNsxInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue string, packetTypeAttributeValue string) { + mb.metricNsxInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue, packetTypeAttributeValue) } // RecordNsxInterfaceThroughputDataPoint adds a data point to nsx.interface.throughput metric. @@ -674,6 +604,11 @@ func (mb *MetricsBuilder) RecordNsxInterfaceThroughputDataPoint(ts pcommon.Times mb.metricNsxInterfaceThroughput.recordDataPoint(mb.startTime, ts, val, directionAttributeValue) } +// RecordNsxNodeCacheMemoryUsageDataPoint adds a data point to nsx.node.cache.memory.usage metric. +func (mb *MetricsBuilder) RecordNsxNodeCacheMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNsxNodeCacheMemoryUsage.recordDataPoint(mb.startTime, ts, val) +} + // RecordNsxNodeCPUUtilizationDataPoint adds a data point to nsx.node.cpu.utilization metric. func (mb *MetricsBuilder) RecordNsxNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { mb.metricNsxNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue) @@ -689,6 +624,16 @@ func (mb *MetricsBuilder) RecordNsxNodeDiskUtilizationDataPoint(ts pcommon.Times mb.metricNsxNodeDiskUtilization.recordDataPoint(mb.startTime, ts, val, diskAttributeValue) } +// RecordNsxNodeLoadBalancerUtilizationDataPoint adds a data point to nsx.node.load_balancer.utilization metric. +func (mb *MetricsBuilder) RecordNsxNodeLoadBalancerUtilizationDataPoint(ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { + mb.metricNsxNodeLoadBalancerUtilization.recordDataPoint(mb.startTime, ts, val, loadBalancerAttributeValue) +} + +// RecordNsxNodeMemoryUsageDataPoint adds a data point to nsx.node.memory.usage metric. +func (mb *MetricsBuilder) RecordNsxNodeMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNsxNodeMemoryUsage.recordDataPoint(mb.startTime, ts, val) +} + // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { @@ -708,11 +653,14 @@ var Attributes = struct { Disk string // LoadBalancer (The name of the load balancer being utilized) LoadBalancer string + // PacketType (The type of packet counter) + PacketType string }{ "cpu.process.class", "direction", "disk", "load_balancer", + "type", } // A is an alias for Attributes. @@ -735,3 +683,14 @@ var AttributeDirection = struct { "received", "transmitted", } + +// AttributePacketType are the possible values that the attribute "packet.type" can have. +var AttributePacketType = struct { + Dropped string + Errored string + Success string +}{ + "dropped", + "errored", + "success", +} diff --git a/receiver/nsxreceiver/internal/model/interface.go b/receiver/nsxreceiver/internal/model/interface.go index 621eebb3a913..3056c58f5e01 100644 --- a/receiver/nsxreceiver/internal/model/interface.go +++ b/receiver/nsxreceiver/internal/model/interface.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" import "github.com/vmware/go-vmware-nsxt/manager" // NodeNetworkInterfacePropertiesListResult wraps the results of a node's network interface @@ -9,5 +23,9 @@ type NodeNetworkInterfacePropertiesListResult struct { // NetworkInterface is one of a node's nics type NetworkInterface struct { *manager.NodeNetworkInterfaceProperties `mapstructure:",squash"` - ID string `json:"id"` +} + +// NetworkInterfaceStats are the statistics on a node's network interface +type NetworkInterfaceStats struct { + *manager.NodeInterfaceStatisticsProperties `mapstructure:",squash"` } diff --git a/receiver/nsxreceiver/internal/model/node.go b/receiver/nsxreceiver/internal/model/node.go index 481450f3a8f9..7856bdfb0390 100644 --- a/receiver/nsxreceiver/internal/model/node.go +++ b/receiver/nsxreceiver/internal/model/node.go @@ -1,56 +1,135 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" -type TransportNodeList struct { - Results []TransportNode `json:"results"` +// ClusterNodeList is a result struct from +type ClusterNodeList struct { + Results []ClusterNode `json:"results"` } -type TransportNode struct { - ID string `json:"id"` - Name string `json:"display_name"` - Description string `json:"description"` - ResourceType string `json:"resource_type"` +// ClusterNode is a Controller Node or Manager Node +type ClusterNode struct { + NodeProperties `json:",squash"` + ControllerRole *ControllerRole `json:"controller_role,omitempty"` +} - ManagerRole *struct{} `json:"manager_role,omitempty"` - ControllerRole *struct{} `json:"controller_role,omitempty"` +// ControllerRole is a collection of information specific to controller nodes +type ControllerRole struct { + Type string `json:"type"` } -type TransportZoneEndpoint struct { - ZoneID string `json:"transport_zone_id"` +// TransportNodeList is a list of Transport Nodes +type TransportNodeList struct { + Results []TransportNode `json:"results"` } -// NodeStatListResult Runtime status information of fabric nodes -type NodeStatListResult struct { - Results []NodeStatus `json:"results"` +// TransportNode is a representation of an NSX host or edge transport node +type TransportNode struct { + NodeProperties `json:",squash"` + Description string `json:"description" ` } -type TransportNodeStatus struct { - NodeStatus NodeStatus `json:"node_status"` +// NodeProperties are identifiers of a node in NSX +type NodeProperties struct { + ID string `json:"id" mapstructure:"node_id"` + Name string `json:"display_name,omitempty" ` + ResourceType string `json:"resource_type"` } // NodeStatus is a status for a node type NodeStatus struct { - SystemStatus *SystemStatus `json:"system_status"` + LastHeartbeatTimestamp int64 `json:"last_heartbeat_timestamp"` + MpaConnectivityStatus string `json:"mpa_connectivity_status"` + MpaConnectivityStatusDetails string `json:"mpa_connectivity_status_details"` + LcpConnectivityStatus string `json:"lcp_connectivity_status"` + LcpConnectivityStatusDetails []struct { + ControlNodeIP string `json:"control_node_ip"` + Status string `json:"status"` + } `json:"lcp_connectivity_status_details"` + HostNodeDeploymentStatus string `json:"host_node_deployment_status"` + SoftwareVersion string `json:"software_version"` + SystemStatus struct { + CPUCores int `json:"cpu_cores"` + DpdkCPUCores int `json:"dpdk_cpu_cores"` + NonDpdkCPUCores int `json:"non_dpdk_cpu_cores"` + DiskSpaceTotal int `json:"disk_space_total"` + DiskSpaceUsed int `json:"disk_space_used"` + FileSystems []struct { + FileSystem string `json:"file_system"` + Mount string `json:"mount"` + Total int `json:"total"` + Type string `json:"type"` + Used int `json:"used"` + } `json:"file_systems"` + LoadAverage []float64 `json:"load_average"` + CPUUsage struct { + HighestCPUCoreUsageDpdk float64 `json:"highest_cpu_core_usage_dpdk"` + AvgCPUCoreUsageDpdk float64 `json:"avg_cpu_core_usage_dpdk"` + HighestCPUCoreUsageNonDpdk float64 `json:"highest_cpu_core_usage_non_dpdk"` + AvgCPUCoreUsageNonDpdk float64 `json:"avg_cpu_core_usage_non_dpdk"` + } `json:"cpu_usage"` + EdgeMemUsage *struct { + SystemMemUsage float64 `json:"system_mem_usage"` + SwapUsage float64 `json:"swap_usage"` + CacheUsage float64 `json:"cache_usage"` + DatapathTotalUsage float64 `json:"datapath_total_usage"` + DatapathMemUsageDetails struct { + DatapathHeapUsage float64 `json:"datapath_heap_usage"` + HighestDatapathMemPoolUsage float64 `json:"highest_datapath_mem_pool_usage"` + HighestDatapathMemPoolUsageNames []string `json:"highest_datapath_mem_pool_usage_names"` + DatapathMemPoolsUsage []struct { + Name string `json:"name"` + Description string `json:"description"` + Usage float64 `json:"usage"` + } `json:"datapath_mem_pools_usage"` + } `json:"datapath_mem_usage_details"` + } `json:"edge_mem_usage,omitempty"` + MemCache int `json:"mem_cache"` + MemTotal int `json:"mem_total"` + MemUsed int `json:"mem_used"` + Source string `json:"source"` + SwapTotal int `json:"swap_total"` + SwapUsed int `json:"swap_used"` + SystemTime int64 `json:"system_time"` + Uptime int64 `json:"uptime"` + } `json:"system_status"` +} + +type TransportNodeStatus struct { + NodeStatus NodeStatus `mapstructure:"node_status" json:"node_status"` } // SystemStatus is the system status portion of a node's status response type SystemStatus struct { - CPUCores int `json:"cpu_cores"` - DpdkCPUCores int `json:"dpdk_cpu_cores"` - NonDpdkCPUCores int `json:"non_dpdk_cpu_cores"` - DiskSpaceTotal int `json:"disk_space_total"` - DiskSpaceUsed int `json:"disk_space_used"` - FileSystems []FileSystemsUsage `json:"file_systems"` - LoadAverage []float64 `json:"load_average"` - CPUUsage *NodeSystemCPUUsage `json:"cpu_usage"` - EdgeMemUsage *MemSystemUsage `json:"edge_mem_usage"` - MemCache int `json:"mem_cache"` - MemTotal int `json:"mem_total"` - MemUsed int `json:"mem_used"` - Source string `json:"source"` - SwapTotal int `json:"swap_total"` - SwapUsed int `json:"swap_used"` - SystemTime int64 `json:"system_time"` - Uptime int64 `json:"uptime"` + CPUCores int `json:"cpu_cores"` + DpdkCPUCores int `json:"dpdk_cpu_cores"` + NonDpdkCPUCores int `json:"non_dpdk_cpu_cores"` + DiskSpaceTotal int `json:"disk_space_total"` + DiskSpaceUsed int `json:"disk_space_used"` + FileSystems []FileSystemsUsage `json:"file_systems"` + LoadAverage []float64 `json:"load_average"` + CPUUsage NodeSystemCPUUsage `json:"cpu_usage"` + EdgeMemUsage MemSystemUsage `json:"edge_mem_usage"` + MemCache int `json:"mem_cache"` + MemTotal int `json:"mem_total"` + MemUsed int `json:"mem_used"` + Source string `json:"source"` + SwapTotal int `json:"swap_total"` + SwapUsed int `json:"swap_used"` + SystemTime int64 `json:"system_time"` + Uptime int64 `json:"uptime"` } type NodeSystemCPUUsage struct { diff --git a/receiver/nsxreceiver/internal/model/router.go b/receiver/nsxreceiver/internal/model/router.go index 23f648de898b..31454fcc5548 100644 --- a/receiver/nsxreceiver/internal/model/router.go +++ b/receiver/nsxreceiver/internal/model/router.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // Router is a logical router's API information diff --git a/receiver/nsxreceiver/logs.go b/receiver/nsxreceiver/logs.go new file mode 100644 index 000000000000..1151e16ae147 --- /dev/null +++ b/receiver/nsxreceiver/logs.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package nsxreceiver + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" +) + +var _ component.Receiver = (*nsxLogsReceiver)(nil) + +type nsxLogsReceiver struct { + cfg *Config + params component.ReceiverCreateSettings + consumer consumer.Logs + syslogReceiver component.LogsReceiver +} + +func newLogsReceiver(c *Config, params component.ReceiverCreateSettings, consumer consumer.Logs) *nsxLogsReceiver { + return &nsxLogsReceiver{ + cfg: c, + params: params, + consumer: consumer, + } +} + +func (lr *nsxLogsReceiver) Start(ctx context.Context, h component.Host) error { + f := h.GetFactory(component.KindReceiver, "syslog") + rf, ok := f.(component.ReceiverFactory) + if !ok { + return fmt.Errorf("unable to wrap the syslog receiver that the %s component wraps", typeStr) + } + syslog, err := rf.CreateLogsReceiver(ctx, lr.params, lr.cfg.LoggingConfig.SysLogConfig, lr.consumer) + if err != nil { + return fmt.Errorf("unable to start the wrapped syslogreceiver: %w", err) + } + lr.syslogReceiver = syslog + return lr.syslogReceiver.Start(ctx, h) +} + +func (lr *nsxLogsReceiver) Shutdown(ctx context.Context) error { + if lr.syslogReceiver != nil { + return lr.syslogReceiver.Shutdown(ctx) + } + return nil +} diff --git a/receiver/nsxreceiver/metadata.yaml b/receiver/nsxreceiver/metadata.yaml index 46f290d1c414..71ffc6f8e0f3 100644 --- a/receiver/nsxreceiver/metadata.yaml +++ b/receiver/nsxreceiver/metadata.yaml @@ -4,6 +4,9 @@ resource_attributes: nsx.node.name: description: The name of the NSX Node. type: string + nsx.node.id: + description: The ID of the NSX Node. + type: string nsx.node.type: description: The type of NSX Node. type: string @@ -25,6 +28,13 @@ attributes: disk: value: disk description: The name of the mounted storage + packet.type: + value: type + description: The type of packet counter + enum: + - dropped + - errored + - success cpu.process.class: description: The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes enum: @@ -35,8 +45,8 @@ attributes: metrics: nsx.interface.throughput: - description: The number of messages published to a queue. - unit: "{messages}" + description: The number of Bytes flowing through the network interface. + unit: "By" sum: monotonic: true aggregation: cumulative @@ -44,14 +54,14 @@ metrics: enabled: true attributes: [direction] nsx.interface.packet.count: - description: The number of packets flowing through the network interface. - unit: "{messages}" + description: The number of packets flowing through the network interface on the node. + unit: "{packets}" sum: monotonic: true aggregation: cumulative value_type: int enabled: true - attributes: [direction] + attributes: [direction, packet.type] nsx.node.cpu.utilization: description: The average amount of CPU being used by the node. unit: "%" @@ -75,24 +85,24 @@ metrics: aggregation: cumulative enabled: true attributes: [disk] - node.load_balancer.utilization: + nsx.node.load_balancer.utilization: description: The utilization of load balancers by the node unit: "%" gauge: value_type: double enabled: true attributes: [load_balancer] - node.memory.usage: + nsx.node.memory.usage: description: The memory usage of the node - unit: By + unit: KBy sum: monotonic: false value_type: int aggregation: cumulative enabled: true - node.cache.memory.usage: - description: The memory usage of the node’s cache - unit: By + nsx.node.cache.memory.usage: + description: The memory usage of the node's cache + unit: KBy sum: monotonic: false value_type: int diff --git a/receiver/nsxreceiver/mock_client_test.go b/receiver/nsxreceiver/mock_client_test.go new file mode 100644 index 000000000000..e404f556b5a3 --- /dev/null +++ b/receiver/nsxreceiver/mock_client_test.go @@ -0,0 +1,165 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package nsxreceiver + +import ( + context "context" + testing "testing" + + mock "github.com/stretchr/testify/mock" + + model "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" +) + +const ( + transportNode1 = "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827" + transportNode2 = "f5045ed2-43ab-4a35-a2c5-d20c30a32292" + transportNodeNic1 = "vmk10" + transportNodeNic2 = "vmnic0" + managerNode1 = "b7a79908-9808-4c9e-bb49-b70008993fcb" + managerNodeNic1 = "eth0" + managerNodeNic2 = "lo" + controllerNode1 = "8aaacaaa-c51d-44f9-8051-f615458eebe2" +) + +// MockClient is an autogenerated mock type for the MockClient type +type MockClient struct { + mock.Mock +} + +// ClusterNodes provides a mock function with given fields: ctx +func (_m *MockClient) ClusterNodes(ctx context.Context) ([]model.ClusterNode, error) { + ret := _m.Called(ctx) + + var r0 []model.ClusterNode + if rf, ok := ret.Get(0).(func(context.Context) []model.ClusterNode); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.ClusterNode) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// InterfaceStatus provides a mock function with given fields: ctx, nodeID, interfaceID, class +func (_m *MockClient) InterfaceStatus(ctx context.Context, nodeID string, interfaceID string, class nodeClass) (*model.NetworkInterfaceStats, error) { + ret := _m.Called(ctx, nodeID, interfaceID, class) + + var r0 *model.NetworkInterfaceStats + if rf, ok := ret.Get(0).(func(context.Context, string, string, nodeClass) *model.NetworkInterfaceStats); ok { + r0 = rf(ctx, nodeID, interfaceID, class) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NetworkInterfaceStats) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string, string, nodeClass) error); ok { + r1 = rf(ctx, nodeID, interfaceID, class) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Interfaces provides a mock function with given fields: ctx, nodeID, class +func (_m *MockClient) Interfaces(ctx context.Context, nodeID string, class nodeClass) ([]model.NetworkInterface, error) { + ret := _m.Called(ctx, nodeID, class) + + var r0 []model.NetworkInterface + if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) []model.NetworkInterface); ok { + r0 = rf(ctx, nodeID, class) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.NetworkInterface) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string, nodeClass) error); ok { + r1 = rf(ctx, nodeID, class) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeStatus provides a mock function with given fields: ctx, nodeID, class +func (_m *MockClient) NodeStatus(ctx context.Context, nodeID string, class nodeClass) (*model.NodeStatus, error) { + ret := _m.Called(ctx, nodeID, class) + + var r0 *model.NodeStatus + if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) *model.NodeStatus); ok { + r0 = rf(ctx, nodeID, class) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NodeStatus) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string, nodeClass) error); ok { + r1 = rf(ctx, nodeID, class) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TransportNodes provides a mock function with given fields: ctx +func (_m *MockClient) TransportNodes(ctx context.Context) ([]model.TransportNode, error) { + ret := _m.Called(ctx) + + var r0 []model.TransportNode + if rf, ok := ret.Get(0).(func(context.Context) []model.TransportNode); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.TransportNode) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewMockClient creates a new instance of MockClient. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockClient(t testing.TB) *MockClient { + mock := &MockClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/receiver/nsxreceiver/receiver.go b/receiver/nsxreceiver/receiver.go new file mode 100644 index 000000000000..c06414de1e4f --- /dev/null +++ b/receiver/nsxreceiver/receiver.go @@ -0,0 +1,68 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package nsxreceiver + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/component" + "go.uber.org/multierr" + "go.uber.org/zap" +) + +var _ component.Receiver = (*nsxReceiver)(nil) + +type nsxReceiver struct { + config *Config + logger *zap.Logger + scraper component.Receiver + logsReceiver component.Receiver +} + +func (n *nsxReceiver) Start(ctx context.Context, host component.Host) error { + var err error + if n.scraper != nil && n.config.MetricsConfig.Endpoint != "" { + if scraperErr := n.scraper.Start(ctx, host); scraperErr != nil { + // Start should not stop the collector if the metrics client connection attempt does not succeed, + // so we log on start when we cannot connect + n.logger.Error(fmt.Sprintf("unable to initially connect to NSX API: %s", scraperErr.Error())) + } + } + + if n.logsReceiver != nil { + // if syslogreceiver is not bundled and logging is in the pipeline for vcenter, we probably want to not start the collector + if startErr := n.logsReceiver.Start(ctx, host); startErr != nil { + err = multierr.Append(err, startErr) + } + } + return err +} + +// Shutdown calls appropriate shutdowns for the NSX receiver +func (n *nsxReceiver) Shutdown(ctx context.Context) error { + var err error + if n.scraper != nil { + if scraperErr := n.scraper.Shutdown(ctx); scraperErr != nil { + err = multierr.Append(err, scraperErr) + } + } + if n.logsReceiver != nil { + if logsErr := n.logsReceiver.Shutdown(ctx); logsErr != nil { + err = multierr.Append(err, logsErr) + } + } + return err +} diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index c50b30786983..304c0ae20f79 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -1,8 +1,22 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "context" - "fmt" + "math" "sync" "time" @@ -18,7 +32,7 @@ import ( type scraper struct { config *Config settings component.TelemetrySettings - client *nsxClient + client Client mb *metadata.MetricsBuilder logger *zap.Logger } @@ -41,121 +55,198 @@ func (s *scraper) start(ctx context.Context, host component.Host) error { return nil } -func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { +type nodeClass int - colTime := pdata.NewTimestampFromTime(time.Now()) +const ( + transportClass nodeClass = iota + managerClass + controllerClass +) + +func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { errs := &scrapererror.ScrapeErrors{} r := s.retrieve(ctx, errs) + colTime := pdata.NewTimestampFromTime(time.Now()) s.process(r, colTime, errs) return s.mb.Emit(), errs.Combine() } -type retrieval struct { - nodes []nodeInfo +type nodeInfo struct { + nodeProps dm.NodeProperties + nodeType string + interfaces []interfaceInfo + stats *dm.NodeStatus } -type nodeInfo struct { - node dm.TransportNode - interfaces []dm.NetworkInterface - stats dm.NodeStatus +type interfaceInfo struct { + iFace dm.NetworkInterface + stats *dm.NetworkInterfaceStats } -func (s *scraper) retrieve(ctx context.Context, errs *scrapererror.ScrapeErrors) *retrieval { - r := &retrieval{} +func (s *scraper) retrieve(ctx context.Context, errs *scrapererror.ScrapeErrors) []*nodeInfo { + r := []*nodeInfo{} + + tNodes, err := s.client.TransportNodes(ctx) + if err != nil { + errs.AddPartial(1, err) + return r + } - nodes, err := s.retrieveNodes(ctx, r, errs) + cNodes, err := s.client.ClusterNodes(ctx) + if err != nil { + errs.AddPartial(1, err) + return r + } wg := &sync.WaitGroup{} - for _, n := range r.nodes { - go s.retrieveInterfaces(ctx, n, wg, errs) - go s.retrieveNodeStats(ctx, n, wg, errs) + for _, n := range tNodes { + nodeInfo := &nodeInfo{ + nodeProps: n.NodeProperties, + nodeType: "transport", + } + wg.Add(2) + go s.retrieveInterfaces(ctx, n.NodeProperties, nodeInfo, transportClass, wg, errs) + go s.retrieveNodeStats(ctx, n.NodeProperties, nodeInfo, transportClass, wg, errs) + + r = append(r, nodeInfo) } - wg.Wait() - return r -} + for _, n := range cNodes { + // no useful stats are recorded for controller nodes + if clusterNodeType(n) != "manager" { + continue + } -func (s *scraper) retrieveNodes( - ctx context.Context, - r *retrieval, - errs *scrapererror.ScrapeErrors, -) ([]dm.TransportNode, error) { - nodes, err := s.client.TransportNodes(ctx) - if err != nil { - errs.AddPartial(1, err) - return + nodeInfo := &nodeInfo{ + nodeProps: n.NodeProperties, + nodeType: "manager", + } + + wg.Add(2) + go s.retrieveInterfaces(ctx, n.NodeProperties, nodeInfo, managerClass, wg, errs) + go s.retrieveNodeStats(ctx, n.NodeProperties, nodeInfo, managerClass, wg, errs) + + r = append(r, nodeInfo) } - r.nodes = nodes + + wg.Wait() + + return r } func (s *scraper) retrieveInterfaces( ctx context.Context, - node dm.TransportNode, + nodeProps dm.NodeProperties, + nodeInfo *nodeInfo, + nodeClass nodeClass, wg *sync.WaitGroup, errs *scrapererror.ScrapeErrors, ) { defer wg.Done() - interfaces, err := s.client.Interfaces(ctx, node.ID) + interfaces, err := s.client.Interfaces(ctx, nodeProps.ID, nodeClass) if err != nil { errs.AddPartial(1, err) return } - - interfaces + nodeInfo.interfaces = []interfaceInfo{} + for _, i := range interfaces { + interfaceInfo := interfaceInfo{ + iFace: i, + } + stats, err := s.client.InterfaceStatus(ctx, nodeProps.ID, i.InterfaceId, nodeClass) + if err != nil { + errs.AddPartial(1, err) + } + interfaceInfo.stats = stats + nodeInfo.interfaces = append(nodeInfo.interfaces, interfaceInfo) + } } func (s *scraper) retrieveNodeStats( ctx context.Context, - node dm.TransportNode, + nodeProps dm.NodeProperties, + nodeInfo *nodeInfo, + nodeClass nodeClass, wg *sync.WaitGroup, errs *scrapererror.ScrapeErrors, ) { defer wg.Done() - ns, err := s.client.NodeStatus(ctx, node.ID) + ns, err := s.client.NodeStatus(ctx, nodeProps.ID, nodeClass) if err != nil { errs.AddPartial(1, err) return } - node.Stats = ns + nodeInfo.stats = ns } -func (s *scraper) process(retrieval *retrieval, colTime pdata.Timestamp, errs *scrapererror.ScrapeErrors) { - for _, n := range retrieval.nodes { - for _, i := range n.Interfaces { - s.recordNodeInterface(n, i) +func (s *scraper) process( + nodes []*nodeInfo, + colTime pdata.Timestamp, + errs *scrapererror.ScrapeErrors, +) { + for _, n := range nodes { + for _, i := range n.interfaces { + s.recordNodeInterface(colTime, n.nodeProps, i) } s.recordNode(colTime, n) } } -func (s *scraper) recordNodeInterface(node dm.TransportNode, i dm.NetworkInterface) { +func (s *scraper) recordNodeInterface(colTime pdata.Timestamp, nodeProps dm.NodeProperties, i interfaceInfo) { + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirection.Received, metadata.AttributePacketType.Dropped) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirection.Received, metadata.AttributePacketType.Errored) + successRxPackets := i.stats.RxPackets - i.stats.RxDropped - i.stats.RxErrors + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successRxPackets, metadata.AttributeDirection.Received, metadata.AttributePacketType.Success) + + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxDropped, metadata.AttributeDirection.Transmitted, metadata.AttributePacketType.Dropped) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxErrors, metadata.AttributeDirection.Transmitted, metadata.AttributePacketType.Errored) + successTxPackets := i.stats.TxPackets - i.stats.TxDropped - i.stats.TxErrors + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successTxPackets, metadata.AttributeDirection.Transmitted, metadata.AttributePacketType.Success) + s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.RxBytes, metadata.AttributeDirection.Received) + s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.TxBytes, metadata.AttributeDirection.Transmitted) + + s.mb.EmitForResource( + metadata.WithNsxInterfaceID(i.iFace.InterfaceId), + metadata.WithNsxNodeName(nodeProps.Name), + ) } -func (s *scraper) recordNode(colTime pdata.Timestamp, node dm.TransportNode) { - s.logger.Info(fmt.Sprintf("Node ID: %s", node.ID)) - ss := node.Stats.SystemStatus +func (s *scraper) recordNode( + colTime pdata.Timestamp, + info *nodeInfo, +) { + if info.stats == nil { + return + } + + ss := info.stats.SystemStatus s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClass.Datapath) s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClass.Services) - s.mb.RecordNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) - s.mb.RecordNodeCacheMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) + s.mb.RecordNsxNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) + + if ss.EdgeMemUsage != nil { + s.mb.RecordNsxNodeCacheMemoryUsageDataPoint(colTime, int64(ss.EdgeMemUsage.CacheUsage)) + } + + for _, fs := range ss.FileSystems { + s.mb.RecordNsxNodeDiskUsageDataPoint(colTime, int64(fs.Used), fs.Mount) + // ensure the prevention of division by 0 using math.Max + diskUtilization := float64(fs.Used) / math.Max(float64(fs.Total), 1) * 100 + s.mb.RecordNsxNodeDiskUtilizationDataPoint(colTime, diskUtilization, fs.Mount) + } s.mb.EmitForResource( - metadata.WithNsxNodeName(node.Name), - metadata.WithNsxNodeType(nodeType(node)), + metadata.WithNsxNodeName(info.nodeProps.Name), + metadata.WithNsxNodeID(info.nodeProps.ID), + metadata.WithNsxNodeType(info.nodeType), ) } -func nodeType(node dm.TransportNode) string { - switch { - case node.ResourceType == "TransportNode": - return "transport" - case node.ManagerRole != nil: - return "manager" - case node.ControllerRole != nil: +func clusterNodeType(node dm.ClusterNode) string { + if node.ControllerRole != nil { return "controller" - default: - return "" } + return "manager" } diff --git a/receiver/nsxreceiver/scraper_test.go b/receiver/nsxreceiver/scraper_test.go new file mode 100644 index 000000000000..f2bb96f69db8 --- /dev/null +++ b/receiver/nsxreceiver/scraper_test.go @@ -0,0 +1,140 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package nsxreceiver + +import ( + "context" + "encoding/json" + "io/ioutil" + "path/filepath" + "testing" + + mock "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" + dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" +) + +func TestScrape(t *testing.T) { + mockClient := NewMockClient(t) + + mockClient.On("ClusterNodes", mock.Anything).Return(loadTestClusterNodes()) + mockClient.On("TransportNodes", mock.Anything).Return(loadTestTransportNodes()) + + mockClient.On("NodeStatus", mock.Anything, transportNode1, transportClass).Return(loadTestNodeStatus(t, transportNode1, transportClass)) + mockClient.On("NodeStatus", mock.Anything, transportNode2, transportClass).Return(loadTestNodeStatus(t, transportNode2, transportClass)) + mockClient.On("NodeStatus", mock.Anything, transportNode2, transportClass).Return(loadTestNodeStatus(t, transportNode2, transportClass)) + mockClient.On("NodeStatus", mock.Anything, managerNode1, managerClass).Return(loadTestNodeStatus(t, managerNode1, managerClass)) + + mockClient.On("Interfaces", mock.Anything, managerNode1, managerClass).Return(loadTestNodeInterfaces(t, managerNode1, managerClass)) + mockClient.On("Interfaces", mock.Anything, transportNode1, transportClass).Return(loadTestNodeInterfaces(t, transportNode1, transportClass)) + mockClient.On("Interfaces", mock.Anything, transportNode2, transportClass).Return(loadTestNodeInterfaces(t, transportNode2, transportClass)) + + mockClient.On("InterfaceStatus", mock.Anything, transportNode1, transportNodeNic1, transportClass).Return(loadInterfaceStats(t, transportNode1, transportNodeNic1, transportClass)) + mockClient.On("InterfaceStatus", mock.Anything, transportNode1, transportNodeNic2, transportClass).Return(loadInterfaceStats(t, transportNode1, transportNodeNic2, transportClass)) + mockClient.On("InterfaceStatus", mock.Anything, transportNode2, transportNodeNic1, transportClass).Return(loadInterfaceStats(t, transportNode2, transportNodeNic1, transportClass)) + mockClient.On("InterfaceStatus", mock.Anything, transportNode2, transportNodeNic2, transportClass).Return(loadInterfaceStats(t, transportNode2, transportNodeNic2, transportClass)) + mockClient.On("InterfaceStatus", mock.Anything, managerNode1, managerNodeNic1, managerClass).Return(loadInterfaceStats(t, managerNode1, managerNodeNic1, managerClass)) + mockClient.On("InterfaceStatus", mock.Anything, managerNode1, managerNodeNic2, managerClass).Return(loadInterfaceStats(t, managerNode1, managerNodeNic2, managerClass)) + + scraper := newScraper( + &Config{ + MetricsConfig: &MetricsConfig{Settings: metadata.DefaultMetricsSettings()}, + }, + componenttest.NewNopTelemetrySettings(), + ) + scraper.client = mockClient + + metrics, err := scraper.scrape(context.Background()) + require.NoError(t, err) + + expectedMetrics, err := golden.ReadMetrics(filepath.Join("testdata", "metrics", "expected_metrics.json")) + require.NoError(t, err) + + err = scrapertest.CompareMetrics(metrics, expectedMetrics) + require.NoError(t, err) +} + +func loadTestNodeStatus(t *testing.T, nodeID string, class nodeClass) (*dm.NodeStatus, error) { + var classType string + switch class { + case transportClass: + classType = "transport" + default: + classType = "cluster" + } + testFile, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", classType, nodeID, "status.json")) + require.NoError(t, err) + var stats dm.NodeStatus + err = json.Unmarshal(testFile, &stats) + require.NoError(t, err) + return &stats, nil +} + +func loadTestNodeInterfaces(t *testing.T, nodeID string, class nodeClass) ([]dm.NetworkInterface, error) { + var classType string + switch class { + case transportClass: + classType = "transport" + default: + classType = "cluster" + } + testFile, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", classType, nodeID, "interfaces", "index.json")) + require.NoError(t, err) + var interfaces dm.NodeNetworkInterfacePropertiesListResult + err = json.Unmarshal(testFile, &interfaces) + require.NoError(t, err) + return interfaces.Results, nil +} + +func loadInterfaceStats(t *testing.T, nodeID, interfaceID string, class nodeClass) (*dm.NetworkInterfaceStats, error) { + var classType string + switch class { + case transportClass: + classType = "transport" + default: + classType = "cluster" + } + testFile, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", classType, nodeID, "interfaces", interfaceID, "stats.json")) + require.NoError(t, err) + var stats dm.NetworkInterfaceStats + err = json.Unmarshal(testFile, &stats) + require.NoError(t, err) + return &stats, nil +} + +func loadTestClusterNodes() ([]dm.ClusterNode, error) { + testFile, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "cluster_nodes.json")) + if err != nil { + return nil, err + } + var nodes dm.ClusterNodeList + err = json.Unmarshal(testFile, &nodes) + return nodes.Results, err +} + +func loadTestTransportNodes() ([]dm.TransportNode, error) { + testFile, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "transport_nodes.json")) + if err != nil { + return nil, err + } + var nodes dm.TransportNodeList + err = json.Unmarshal(testFile, &nodes) + return nodes.Results, err +} diff --git a/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json b/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json new file mode 100644 index 000000000000..b6e461f2c958 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json @@ -0,0 +1,57 @@ +{ + "results": [ + { + "controller_role": { + "control_cluster_listen_addr": { + "ip_address": "127.0.0.1", + "port": 7777 + }, + "host_msg_client_info": { + "account_name": "cvn-ccp-8aaacaaa-c51d-44f9-8051-f615458eebe2" + }, + "mpa_msg_client_info": { + "account_name": "cvn-mp-mpa-7ca5b9d1-7c44-4cd3-998c-a655750b07e6" + }, + "type": "ControllerClusterRoleConfig" + }, + "resource_type": "ClusterNodeConfig", + "id": "8aaacaaa-c51d-44f9-8051-f615458eebe2", + "display_name": "8aaacaaa-c51d-44f9-8051-f615458eebe2", + "_create_user": "admin", + "_create_time": 1620400784195, + "_last_modified_user": "system", + "_last_modified_time": 1640701315788, + "_system_owned": false, + "_protection": "NOT_PROTECTED", + "_revision": 4 + }, + { + "external_id": "b7a79908-9808-4c9e-bb49-b70008993fcb", + "manager_role": { + "appliance_connection_info": { + "ip_address": "192.168.20.60", + "port": 1234, + "entities_hosted": [ + { + "entity_type": "MP", + "entity_uuid": "b7a79908-9808-4c9e-bb49-b70008993fcb" + } + ] + }, + "type": "ManagementClusterRoleConfig" + }, + "appliance_mgmt_listen_addr": "192.168.20.60", + "resource_type": "ClusterNodeConfig", + "id": "b7a79908-9808-4c9e-bb49-b70008993fcb", + "display_name": "nsxmgr-03", + "_create_user": "system", + "_create_time": 1620401266727, + "_last_modified_user": "system", + "_last_modified_time": 1640702449127, + "_system_owned": false, + "_protection": "NOT_PROTECTED", + "_revision": 49 + } + ], + "result_count": 2 +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxreceiver/testdata/metrics/expected_metrics.json new file mode 100644 index 000000000000..6d31fcd86c40 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/expected_metrics.json @@ -0,0 +1,1796 @@ +{ + "resourceMetrics": [ + { + "resource": { + "attributes": [ + { + "key": "nsx.interface.id", + "value": { + "stringValue": "vmnic0" + } + }, + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "63594238" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsx.interface.throughput", + "description": "The number of Bytes flowing through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "4161088074" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.interface.id", + "value": { + "stringValue": "vmk10" + } + }, + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "63594238" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsx.interface.throughput", + "description": "The number of Bytes flowing through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "4161088074" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" + } + }, + { + "key": "nsx.node.id", + "value": { + "stringValue": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827" + } + }, + { + "key": "nsx.node.type", + "value": { + "stringValue": "transport" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.node.cpu.utilization", + "description": "The average amount of CPU being used by the node.", + "unit": "%", + "gauge": { + "dataPoints": [ + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "datapath" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "services" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + } + ] + } + }, + { + "name": "nsx.node.memory.usage", + "description": "The memory usage of the node", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.interface.id", + "value": { + "stringValue": "vmnic0" + } + }, + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "63594238" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsx.interface.throughput", + "description": "The number of Bytes flowing through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "4161088074" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.interface.id", + "value": { + "stringValue": "vmk10" + } + }, + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "63594238" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsx.interface.throughput", + "description": "The number of Bytes flowing through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "4161088074" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" + } + }, + { + "key": "nsx.node.id", + "value": { + "stringValue": "f5045ed2-43ab-4a35-a2c5-d20c30a32292" + } + }, + { + "key": "nsx.node.type", + "value": { + "stringValue": "transport" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.node.cpu.utilization", + "description": "The average amount of CPU being used by the node.", + "unit": "%", + "gauge": { + "dataPoints": [ + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "datapath" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "services" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + } + ] + } + }, + { + "name": "nsx.node.memory.usage", + "description": "The memory usage of the node", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.interface.id", + "value": { + "stringValue": "lo" + } + }, + { + "key": "nsx.node.name", + "value": { + "stringValue": "nsxmgr-03" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "288" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "12483778397" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "12313320048" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsx.interface.throughput", + "description": "The number of Bytes flowing through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "2837237037443" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "5877910030884" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.interface.id", + "value": { + "stringValue": "eth0" + } + }, + { + "key": "nsx.node.name", + "value": { + "stringValue": "nsxmgr-03" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "288" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "12483778397" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "12313320048" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsx.interface.throughput", + "description": "The number of Bytes flowing through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "2837237037443" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "5877910030884" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.node.name", + "value": { + "stringValue": "nsxmgr-03" + } + }, + { + "key": "nsx.node.id", + "value": { + "stringValue": "b7a79908-9808-4c9e-bb49-b70008993fcb" + } + }, + { + "key": "nsx.node.type", + "value": { + "stringValue": "manager" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.node.cpu.utilization", + "description": "The average amount of CPU being used by the node.", + "unit": "%", + "gauge": { + "dataPoints": [ + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "datapath" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "services" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + } + ] + } + }, + { + "name": "nsx.node.disk.usage", + "description": "The amount of storage space used by the node.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/dev" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/run" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "6612" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "7075020" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/dev/shm" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "6436" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/run/lock" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/sys/fs/cgroup" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/log" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "9788208" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/nonconfig" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "2280724" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/repository" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "5876104" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/tmp" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "15708" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/dump" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "902516" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/config" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "166988" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/boot" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "8424" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/image" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "54340" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/run/user/1007" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, + { + "name": "nsx.node.disk.utilization", + "description": "The percentage of storage space utilized.", + "unit": "%", + "gauge": { + "dataPoints": [ + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/dev" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/run" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0.26797134506052456 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 66.21743141110211 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/dev/shm" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0.052167766869415225 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/run/lock" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/sys/fs/cgroup" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/log" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 34.81667425730868 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/nonconfig" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 2.2126377725298423 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/repository" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 18.184516721289395 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/tmp" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0.4064022585492464 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/dump" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 9.30463398641599 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/config" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0.5502299137810142 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/boot" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0.8718114304165321 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/image" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0.12318272609130737 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/run/user/1007" + } + } + ], + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asDouble": 0 + } + ] + } + }, + { + "name": "nsx.node.memory.usage", + "description": "The memory usage of the node", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1651592756089350000", + "timeUnixNano": "1651592756089985000", + "asInt": "19636300" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json new file mode 100644 index 000000000000..7c9503e90d2a --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json @@ -0,0 +1,9 @@ +{ + "version": "3.1.2.0.0.17883600", + "control_cluster_status": { + "mgmt_connection_status": { + "connectivity_status": "CONNECTED" + }, + "control_cluster_status": "CONNECTED" + } +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json new file mode 100644 index 000000000000..ad654703a5e7 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json @@ -0,0 +1,15 @@ +{ + "interface_id": "eth0", + "rx_bytes": 2837237037443, + "rx_dropped": 288, + "rx_errors": 0, + "rx_frame": 0, + "rx_packets": 12483778685, + "tx_bytes": 5877910030884, + "tx_carrier": 0, + "tx_colls": 0, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 12313320048, + "source": "cached" +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json new file mode 100644 index 000000000000..769bb158c412 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json @@ -0,0 +1,37 @@ +{ + "results": [ + { + "admin_status": "UP", + "interface_id": "lo", + "link_status": "UP", + "mtu": 65536, + "interface_alias": [ + { + "broadcast_address": "0.0.0.0", + "ip_address": "127.0.0.1", + "ip_configuration": "NOT_CONFIGURED", + "netmask": "255.0.0.0", + "physical_address": "00:00:00:00:00:00" + } + ], + "source": "cached" + }, + { + "admin_status": "UP", + "interface_id": "eth0", + "link_status": "UP", + "mtu": 1500, + "interface_alias": [ + { + "broadcast_address": "192.168.20.63", + "ip_address": "192.168.20.60", + "ip_configuration": "STATIC", + "netmask": "255.255.255.192", + "physical_address": "00:50:56:80:8f:53" + } + ], + "source": "cached" + } + ], + "result_count": 2 +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json new file mode 100644 index 000000000000..0aec74cb97b7 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json @@ -0,0 +1,15 @@ +{ + "interface_id": "lo", + "rx_bytes": 2837237037443, + "rx_dropped": 288, + "rx_errors": 0, + "rx_frame": 0, + "rx_packets": 12483778685, + "tx_bytes": 5877910030884, + "tx_carrier": 0, + "tx_colls": 0, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 12313320048, + "source": "cached" +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json new file mode 100644 index 000000000000..de25c08dd83c --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json @@ -0,0 +1,131 @@ +{ + "version": "3.1.2.0.0.17883600", + "mgmt_cluster_status": { + "mgmt_cluster_status": "CONNECTED" + }, + "system_status": { + "cpu_cores": 6, + "disk_space_total": 263182156, + "disk_space_used": 26168032, + "file_systems": [ + { + "file_system": "udev", + "mount": "/dev", + "total": 12320824, + "type": "devtmpfs", + "used": 0 + }, + { + "file_system": "tmpfs", + "mount": "/run", + "total": 2467428, + "type": "tmpfs", + "used": 6612 + }, + { + "file_system": "/dev/sda3", + "mount": "/", + "total": 10684528, + "type": "ext4", + "used": 7075020 + }, + { + "file_system": "tmpfs", + "mount": "/dev/shm", + "total": 12337120, + "type": "tmpfs", + "used": 6436 + }, + { + "file_system": "tmpfs", + "mount": "/run/lock", + "total": 5120, + "type": "tmpfs", + "used": 0 + }, + { + "file_system": "tmpfs", + "mount": "/sys/fs/cgroup", + "total": 12337120, + "type": "tmpfs", + "used": 0 + }, + { + "file_system": "/dev/mapper/nsx-var+log", + "mount": "/var/log", + "total": 28113564, + "type": "ext4", + "used": 9788208 + }, + { + "file_system": "/dev/mapper/nsx-secondary", + "mount": "/nonconfig", + "total": 103077152, + "type": "ext4", + "used": 2280724 + }, + { + "file_system": "/dev/mapper/nsx-repository", + "mount": "/repository", + "total": 32313776, + "type": "ext4", + "used": 5876104 + }, + { + "file_system": "/dev/mapper/nsx-tmp", + "mount": "/tmp", + "total": 3865136, + "type": "ext4", + "used": 15708 + }, + { + "file_system": "/dev/mapper/nsx-var+dump", + "mount": "/var/dump", + "total": 9699640, + "type": "ext4", + "used": 902516 + }, + { + "file_system": "/dev/mapper/nsx-config__bak", + "mount": "/config", + "total": 30348768, + "type": "ext4", + "used": 166988 + }, + { + "file_system": "/dev/sda1", + "mount": "/boot", + "total": 966264, + "type": "ext4", + "used": 8424 + }, + { + "file_system": "/dev/mapper/nsx-image", + "mount": "/image", + "total": 44113328, + "type": "ext4", + "used": 54340 + }, + { + "file_system": "tmpfs", + "mount": "/run/user/1007", + "total": 2467424, + "type": "tmpfs", + "used": 0 + } + ], + "load_average": [ + 1.64, + 1.04, + 0.92 + ], + "mem_cache": 1716556, + "mem_total": 24674244, + "mem_used": 19636300, + "source": "cached", + "swap_total": 0, + "swap_used": 0, + "system_time": 1651589654000, + "uptime": 10887499000 + } +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json new file mode 100644 index 000000000000..8764d0ffb16d --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json @@ -0,0 +1,30 @@ +{ + "results": [ + { + "admin_status": "UP", + "interface_id": "vmnic0", + "link_status": "UP", + "mtu": 9000, + "interface_type": "PHYSICAL", + "connected_switch": "Datacenter-dvs", + "connected_switch_type": "DVS", + "interface_alias": [], + "source": "cached", + "ens_capable": true, + "ens_interrupt_capable": true + }, + { + "admin_status": "UP", + "interface_id": "vmk10", + "link_status": "UP", + "mtu": 9000, + "interface_type": "VIRTUAL", + "connected_switch_type": "DVS", + "interface_alias": [], + "source": "cached", + "host_managed": true, + "lport_attachment_id": "" + } + ], + "result_count": 2 +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json new file mode 100644 index 000000000000..faf97ca83161 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json @@ -0,0 +1,13 @@ +{ + "interface_id": "vmk10", + "rx_bytes": 4161088074, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 63594238, + "tx_bytes": 0, + "tx_carrier": 0, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 0, + "source": "cached" +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json new file mode 100644 index 000000000000..544e4b613765 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json @@ -0,0 +1,13 @@ +{ + "interface_id": "vmnic0", + "rx_bytes": 4161088074, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 63594238, + "tx_bytes": 0, + "tx_carrier": 0, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 0, + "source": "cached" +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json new file mode 100644 index 000000000000..1dce9043f15f --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json @@ -0,0 +1,137 @@ +{ + "node_uuid": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827", + "node_display_name": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog", + "status": "UP", + "node_status": { + "last_heartbeat_timestamp": 1644235372709, + "last_sync_time": 1651520164106, + "mpa_connectivity_status": "UP", + "mpa_connectivity_status_details": "Client is responding to heartbeats", + "lcp_connectivity_status": "UP", + "lcp_connectivity_status_details": [ + { + "control_node_ip": "192.168.20.59", + "status": "UP" + } + ], + "host_node_deployment_status": "INSTALL_SUCCESSFUL", + "inventory_sync_paused": false, + "software_version": "3.1.2.0.0.17883598", + "system_status": { + "cpu_cores": 72, + "file_systems": [ + { + "file_system": "root", + "mount": "/", + "total": 32768, + "type": "ramdisk", + "used": 6344 + }, + { + "file_system": "etc", + "mount": "/etc", + "total": 28672, + "type": "ramdisk", + "used": 1092 + }, + { + "file_system": "opt", + "mount": "/opt", + "total": 32768, + "type": "ramdisk", + "used": 704 + }, + { + "file_system": "var", + "mount": "/var", + "total": 49152, + "type": "ramdisk", + "used": 868 + }, + { + "file_system": "tmp", + "mount": "/tmp", + "total": 262144, + "type": "ramdisk", + "used": 16 + }, + { + "file_system": "iofilters", + "mount": "/var/run/iofilters", + "total": 32768, + "type": "ramdisk", + "used": 0 + }, + { + "file_system": "shm", + "mount": "/var/run/shm", + "total": 1048576, + "type": "ramdisk", + "used": 0 + }, + { + "file_system": "crx", + "mount": "/var/run/crx", + "total": 1048576, + "type": "ramdisk", + "used": 0 + }, + { + "file_system": "configstore", + "mount": "/etc/vmware/configstore", + "total": 32768, + "type": "ramdisk", + "used": 272 + }, + { + "file_system": "configstorebkp", + "mount": "/var/lib/vmware/configstore/backup", + "total": 32768, + "type": "ramdisk", + "used": 272 + }, + { + "file_system": "vsantraces", + "mount": "/vsantraces", + "total": 307200, + "type": "ramdisk", + "used": 270116 + }, + { + "file_system": "hostdstats", + "mount": "/var/lib/vmware/hostd/stats", + "total": 2102272, + "type": "ramdisk", + "used": 5456 + }, + { + "file_system": "nestdb", + "mount": "/var/lib/vmware/nsx/nestdb/db", + "total": 524288, + "type": "ramdisk", + "used": 6344 + }, + { + "file_system": "nsx-idps", + "mount": "/etc/nsx-idps/rules", + "total": 65536, + "type": "ramdisk", + "used": 7584 + } + ], + "load_average": [ + 0.04, + 0.04, + 0.05 + ], + "mem_cache": 0, + "mem_total": 803479616, + "mem_used": 89169108, + "source": "cached", + "swap_total": 0, + "swap_used": 0, + "system_time": 1651520972000, + "uptime": 7285177000 + } + } +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json new file mode 100644 index 000000000000..8764d0ffb16d --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json @@ -0,0 +1,30 @@ +{ + "results": [ + { + "admin_status": "UP", + "interface_id": "vmnic0", + "link_status": "UP", + "mtu": 9000, + "interface_type": "PHYSICAL", + "connected_switch": "Datacenter-dvs", + "connected_switch_type": "DVS", + "interface_alias": [], + "source": "cached", + "ens_capable": true, + "ens_interrupt_capable": true + }, + { + "admin_status": "UP", + "interface_id": "vmk10", + "link_status": "UP", + "mtu": 9000, + "interface_type": "VIRTUAL", + "connected_switch_type": "DVS", + "interface_alias": [], + "source": "cached", + "host_managed": true, + "lport_attachment_id": "" + } + ], + "result_count": 2 +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json new file mode 100644 index 000000000000..faf97ca83161 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json @@ -0,0 +1,13 @@ +{ + "interface_id": "vmk10", + "rx_bytes": 4161088074, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 63594238, + "tx_bytes": 0, + "tx_carrier": 0, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 0, + "source": "cached" +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json new file mode 100644 index 000000000000..544e4b613765 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json @@ -0,0 +1,13 @@ +{ + "interface_id": "vmnic0", + "rx_bytes": 4161088074, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 63594238, + "tx_bytes": 0, + "tx_carrier": 0, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 0, + "source": "cached" +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json new file mode 100644 index 000000000000..1cce6b6fb537 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json @@ -0,0 +1,137 @@ +{ + "node_uuid": "f5045ed2-43ab-4a35-a2c5-d20c30a32292", + "node_display_name": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog", + "status": "UP", + "node_status": { + "last_heartbeat_timestamp": 1644232162899, + "last_sync_time": 1651520104276, + "mpa_connectivity_status": "UP", + "mpa_connectivity_status_details": "Client is responding to heartbeats", + "lcp_connectivity_status": "UP", + "lcp_connectivity_status_details": [ + { + "control_node_ip": "192.168.20.60", + "status": "UP" + } + ], + "host_node_deployment_status": "INSTALL_SUCCESSFUL", + "inventory_sync_paused": false, + "software_version": "3.1.2.0.0.17883598", + "system_status": { + "cpu_cores": 72, + "file_systems": [ + { + "file_system": "root", + "mount": "/", + "total": 32768, + "type": "ramdisk", + "used": 6344 + }, + { + "file_system": "etc", + "mount": "/etc", + "total": 28672, + "type": "ramdisk", + "used": 1092 + }, + { + "file_system": "opt", + "mount": "/opt", + "total": 32768, + "type": "ramdisk", + "used": 704 + }, + { + "file_system": "var", + "mount": "/var", + "total": 49152, + "type": "ramdisk", + "used": 868 + }, + { + "file_system": "tmp", + "mount": "/tmp", + "total": 262144, + "type": "ramdisk", + "used": 24 + }, + { + "file_system": "iofilters", + "mount": "/var/run/iofilters", + "total": 32768, + "type": "ramdisk", + "used": 0 + }, + { + "file_system": "shm", + "mount": "/var/run/shm", + "total": 1048576, + "type": "ramdisk", + "used": 0 + }, + { + "file_system": "crx", + "mount": "/var/run/crx", + "total": 1048576, + "type": "ramdisk", + "used": 0 + }, + { + "file_system": "configstore", + "mount": "/etc/vmware/configstore", + "total": 32768, + "type": "ramdisk", + "used": 276 + }, + { + "file_system": "configstorebkp", + "mount": "/var/lib/vmware/configstore/backup", + "total": 32768, + "type": "ramdisk", + "used": 276 + }, + { + "file_system": "vsantraces", + "mount": "/vsantraces", + "total": 307200, + "type": "ramdisk", + "used": 273024 + }, + { + "file_system": "hostdstats", + "mount": "/var/lib/vmware/hostd/stats", + "total": 2102272, + "type": "ramdisk", + "used": 5904 + }, + { + "file_system": "nestdb", + "mount": "/var/lib/vmware/nsx/nestdb/db", + "total": 524288, + "type": "ramdisk", + "used": 7652 + }, + { + "file_system": "nsx-idps", + "mount": "/etc/nsx-idps/rules", + "total": 65536, + "type": "ramdisk", + "used": 7584 + } + ], + "load_average": [ + 0.07, + 0.08, + 0.08 + ], + "mem_cache": 0, + "mem_total": 803479616, + "mem_used": 143728936, + "source": "cached", + "swap_total": 0, + "swap_used": 0, + "system_time": 1651520952000, + "uptime": 7288252000 + } + } +} \ No newline at end of file diff --git a/receiver/nsxreceiver/testdata/metrics/transport_nodes.json b/receiver/nsxreceiver/testdata/metrics/transport_nodes.json new file mode 100644 index 000000000000..1ab69cc56b66 --- /dev/null +++ b/receiver/nsxreceiver/testdata/metrics/transport_nodes.json @@ -0,0 +1,71 @@ +{ + "results": [ + { + "node_id": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827", + "transport_zone_endpoints": [], + "maintenance_mode": "DISABLED", + "node_deployment_info": { + "os_type": "ESXI", + "os_version": "7.0.2", + "managed_by_server": "192.168.20.6", + "discovered_node_id": "38cb8c59-9023-400e-8de3-d2359ecda55a:host-1009", + "resource_type": "HostNode", + "id": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827", + "display_name": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog", + "external_id": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827", + "fqdn": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog", + "_create_user": "admin", + "_create_time": 1634081227406, + "_last_modified_user": "admin", + "_last_modified_time": 1634081227406, + "_protection": "NOT_PROTECTED", + "_revision": 0 + }, + "is_overridden": false, + "resource_type": "TransportNode", + "id": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827", + "display_name": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog", + "_create_user": "admin", + "_create_time": 1634081228590, + "_last_modified_user": "system", + "_last_modified_time": 1634107238431, + "_system_owned": false, + "_protection": "NOT_PROTECTED", + "_revision": 1 + }, + { + "node_id": "f5045ed2-43ab-4a35-a2c5-d20c30a32292", + "node_deployment_info": { + "os_type": "ESXI", + "os_version": "7.0.2", + "managed_by_server": "192.168.20.6", + "discovered_node_id": "38cb8c59-9023-400e-8de3-d2359ecda55a:host-1002", + "resource_type": "HostNode", + "id": "f5045ed2-43ab-4a35-a2c5-d20c30a32292", + "display_name": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog", + "external_id": "f5045ed2-43ab-4a35-a2c5-d20c30a32292", + "fqdn": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog", + "_create_user": "admin", + "_create_time": 1634076299757, + "_last_modified_user": "admin", + "_last_modified_time": 1634076299757, + "_protection": "NOT_PROTECTED", + "_revision": 0 + }, + "is_overridden": false, + "resource_type": "TransportNode", + "id": "f5045ed2-43ab-4a35-a2c5-d20c30a32292", + "display_name": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog", + "_create_user": "admin", + "_create_time": 1634076301355, + "_last_modified_user": "system", + "_last_modified_time": 1634107238420, + "_system_owned": false, + "_protection": "NOT_PROTECTED", + "_revision": 1 + } + ], + "result_count": 2, + "sort_by": "display_name", + "sort_ascending": true +} \ No newline at end of file From 54847e3ebf4007c5b6e0aefea55f6a69ba479ec5 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 11:53:55 -0400 Subject: [PATCH 05/48] log error on failed start --- receiver/nsxreceiver/scraper.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index 304c0ae20f79..71834fa114f5 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -16,6 +16,7 @@ package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector import ( "context" + "fmt" "math" "sync" "time" @@ -49,9 +50,10 @@ func newScraper(cfg *Config, settings component.TelemetrySettings) *scraper { func (s *scraper) start(ctx context.Context, host component.Host) error { client, err := newClient(s.config, s.settings, host, s.logger.Named("client")) if err != nil { - return err + s.logger.Error(fmt.Sprintf("unable to instantiate client %s", err.Error())) + } else { + s.client = client } - s.client = client return nil } From 23ea4236f0023b3d68aa759d6c8dcff068408a9b Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 12:05:43 -0400 Subject: [PATCH 06/48] ensure client on scrape --- receiver/nsxreceiver/scraper.go | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index 71834fa114f5..b9a4f907c52a 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -23,6 +23,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/model/pdata" + "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/receiver/scrapererror" "go.uber.org/zap" @@ -33,6 +34,7 @@ import ( type scraper struct { config *Config settings component.TelemetrySettings + host component.Host client Client mb *metadata.MetricsBuilder logger *zap.Logger @@ -48,11 +50,10 @@ func newScraper(cfg *Config, settings component.TelemetrySettings) *scraper { } func (s *scraper) start(ctx context.Context, host component.Host) error { - client, err := newClient(s.config, s.settings, host, s.logger.Named("client")) + s.host = host + err := s.ensureClient() if err != nil { s.logger.Error(fmt.Sprintf("unable to instantiate client %s", err.Error())) - } else { - s.client = client } return nil } @@ -67,6 +68,11 @@ const ( func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { errs := &scrapererror.ScrapeErrors{} + if err := s.ensureClient(); err != nil { + errs.Add(err) + return pmetric.NewMetrics(), errs.Combine() + } + r := s.retrieve(ctx, errs) colTime := pdata.NewTimestampFromTime(time.Now()) @@ -246,6 +252,18 @@ func (s *scraper) recordNode( ) } +func (s *scraper) ensureClient() error { + if s.client != nil { + return nil + } + client, err := newClient(s.config, s.settings, s.host, s.logger.Named("client")) + if err != nil { + return err + } + s.client = client + return nil +} + func clusterNodeType(node dm.ClusterNode) string { if node.ControllerRole != nil { return "controller" From 900f710660894527b14c6b949d3010074b8ec8b9 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 12:10:35 -0400 Subject: [PATCH 07/48] remove router since no stats can be grabbed for it --- receiver/nsxreceiver/internal/model/router.go | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 receiver/nsxreceiver/internal/model/router.go diff --git a/receiver/nsxreceiver/internal/model/router.go b/receiver/nsxreceiver/internal/model/router.go deleted file mode 100644 index 31454fcc5548..000000000000 --- a/receiver/nsxreceiver/internal/model/router.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package model - -// Router is a logical router's API information -type Router struct { -} From 84610fe8a1454ac4082969aa040d638e827bf8c8 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 15:28:30 -0400 Subject: [PATCH 08/48] more unit tests --- receiver/nsxreceiver/client.go | 11 +- receiver/nsxreceiver/client_test.go | 303 ++++++++++++++++++++++++++ receiver/nsxreceiver/receiver.go | 4 +- receiver/nsxreceiver/receiver_test.go | 157 +++++++++++++ receiver/nsxreceiver/scraper.go | 3 +- 5 files changed, 467 insertions(+), 11 deletions(-) create mode 100644 receiver/nsxreceiver/client_test.go create mode 100644 receiver/nsxreceiver/receiver_test.go diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go index d6711e32335b..39cc80f2de79 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxreceiver/client.go @@ -50,8 +50,7 @@ type nsxClient struct { } var ( - errUnauthenticated = errors.New("STATUS 401, unauthenticated") - errUnauthorized = errors.New("STATUS 403, unauthorized") + errUnauthorized = errors.New("STATUS 403, unauthorized") ) func newClient(c *Config, settings component.TelemetrySettings, host component.Host, logger *zap.Logger) (*nsxClient, error) { @@ -203,8 +202,6 @@ func (c *nsxClient) doRequest(ctx context.Context, path string, options ...reque body, _ := io.ReadAll(resp.Body) switch resp.StatusCode { - case 401: - return nil, errUnauthenticated case 403: return nil, errUnauthorized default: @@ -225,16 +222,16 @@ func (c *nsxClient) nodeStatusEndpoint(class nodeClass, nodeID string) string { func (c *nsxClient) interfacesEndpoint(class nodeClass, nodeID string) string { switch class { case transportClass: - return fmt.Sprintf("/api/v1/transport-nodes/%s/status", nodeID) + return fmt.Sprintf("/api/v1/transport-nodes/%s/network/interfaces", nodeID) default: - return fmt.Sprintf("/api/v1/cluster/nodes/%s/status", nodeID) + return fmt.Sprintf("/api/v1/cluster/nodes/%s/network/interfaces", nodeID) } } func (c *nsxClient) interfaceStatusEndpoint(class nodeClass, nodeID, interfaceID string) string { switch class { case transportClass: - return fmt.Sprintf("/api/v1/fabric/nodes/%s/network/interfaces/%s/stats", nodeID, interfaceID) + return fmt.Sprintf("/api/v1/transport-nodes/%s/network/interfaces/%s/stats", nodeID, interfaceID) default: return fmt.Sprintf("/api/v1/cluster/nodes/%s/network/interfaces/%s/stats", nodeID, interfaceID) } diff --git a/receiver/nsxreceiver/client_test.go b/receiver/nsxreceiver/client_test.go new file mode 100644 index 000000000000..15aefe6d4563 --- /dev/null +++ b/receiver/nsxreceiver/client_test.go @@ -0,0 +1,303 @@ +package nsxreceiver + +import ( + "context" + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/confighttp" + "go.uber.org/zap" +) + +const ( + goodUser = "" + goodPassword = "" + user500 = "user500" + badPassword = "password123" +) + +func TestNewClientFailureToParse(t *testing.T) { + _, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://\x00", + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.Error(t, err) +} + +func TestTransportNodes(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + nodes, err := client.TransportNodes(context.Background()) + require.NoError(t, err) + require.NotEmpty(t, nodes) +} + +func TestClusterNodes(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + nodes, err := client.ClusterNodes(context.Background()) + require.NoError(t, err) + require.NotEmpty(t, nodes) +} + +func TestClusterNodeInterface(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + iFaces, err := client.Interfaces(context.Background(), managerNode1, managerClass) + require.NoError(t, err) + require.NotEmpty(t, iFaces) +} + +func TestTransportNodeInterface(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + iFaces, err := client.Interfaces(context.Background(), transportNode1, transportClass) + require.NoError(t, err) + require.NotEmpty(t, iFaces) +} + +func TestTransportNodeStatus(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + transportStatus, err := client.NodeStatus(context.Background(), transportNode1, transportClass) + require.NoError(t, err) + require.NotZero(t, transportStatus.SystemStatus.MemTotal) +} + +func TestClusterNodeStatus(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + transportStatus, err := client.NodeStatus(context.Background(), managerNode1, managerClass) + require.NoError(t, err) + require.NotZero(t, transportStatus.SystemStatus.MemTotal) +} + +func TestTransportNodeInterfaceStatus(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + iStats, err := client.InterfaceStatus(context.Background(), transportNode1, transportNodeNic1, transportClass) + require.NoError(t, err) + require.NotZero(t, iStats.RxBytes) +} + +func TestManagerNodeInterfaceStatus(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + iStats, err := client.InterfaceStatus(context.Background(), managerNode1, managerNodeNic1, managerClass) + require.NoError(t, err) + require.NotZero(t, iStats.RxBytes) +} + +func TestDoRequestBadUrl(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + + _, err = client.doRequest(context.Background(), "\x00") + require.ErrorContains(t, err, "parse") +} + +func TestPermissionDenied(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + + _, err = client.ClusterNodes(context.Background()) + require.ErrorContains(t, err, errUnauthorized.Error()) +} + +func TestInternalServerError(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + Username: user500, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + + _, err = client.ClusterNodes(context.Background()) + require.ErrorContains(t, err, "500") +} + +// mockServer gives a mock NSX REST API server for testing; if username or password is included, they will be required for the client. +// otherwise, authorization is ignored. +func mockServer(t *testing.T) *httptest.Server { + tNodeBytes, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "transport_nodes.json")) + require.NoError(t, err) + + cNodeBytes, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "cluster_nodes.json")) + require.NoError(t, err) + + mNodeInterfaces, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", "cluster", managerNode1, "interfaces", "index.json")) + require.NoError(t, err) + + tNodeInterfaces, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", "transport", transportNode1, "interfaces", "index.json")) + require.NoError(t, err) + + tNodeStatus, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", "transport", transportNode1, "status.json")) + require.NoError(t, err) + + mNodeStatus, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", "cluster", managerNode1, "status.json")) + require.NoError(t, err) + + tNodeInterfaceStats, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", "transport", transportNode1, "interfaces", transportNodeNic1, "stats.json")) + require.NoError(t, err) + + mNodeInterfaceStats, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", "cluster", managerNode1, "interfaces", managerNodeNic1, "stats.json")) + require.NoError(t, err) + + nsxMock := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + authUser, authPass, ok := req.BasicAuth() + if !ok { + rw.WriteHeader(401) + return + } else if authUser == user500 { + rw.WriteHeader(500) + return + } else if authUser != goodUser || authPass != goodPassword { + rw.WriteHeader(403) + return + } + + if req.URL.Path == "/api/v1/transport-nodes" { + rw.WriteHeader(200) + _, err = rw.Write(tNodeBytes) + require.NoError(t, err) + return + } + + if req.URL.Path == "/api/v1/cluster/nodes" { + rw.WriteHeader(200) + _, err = rw.Write(cNodeBytes) + require.NoError(t, err) + return + } + + if req.URL.Path == fmt.Sprintf("/api/v1/cluster/nodes/%s/network/interfaces", managerNode1) { + rw.WriteHeader(200) + _, err = rw.Write(mNodeInterfaces) + require.NoError(t, err) + return + } + + if req.URL.Path == fmt.Sprintf("/api/v1/transport-nodes/%s/status", transportNode1) { + rw.WriteHeader(200) + _, err = rw.Write(tNodeStatus) + require.NoError(t, err) + return + } + + if req.URL.Path == fmt.Sprintf("/api/v1/transport-nodes/%s/network/interfaces", transportNode1) { + rw.WriteHeader(200) + _, err = rw.Write(tNodeInterfaces) + require.NoError(t, err) + return + } + + if req.URL.Path == fmt.Sprintf("/api/v1/transport-nodes/%s/network/interfaces/%s/stats", transportNode1, transportNodeNic1) { + rw.WriteHeader(200) + _, err = rw.Write(tNodeInterfaceStats) + require.NoError(t, err) + return + } + + if req.URL.Path == fmt.Sprintf("/api/v1/cluster/nodes/%s/network/interfaces/%s/stats", managerNode1, managerNodeNic1) { + rw.WriteHeader(200) + _, err = rw.Write(mNodeInterfaceStats) + require.NoError(t, err) + return + } + + if req.URL.Path == fmt.Sprintf("/api/v1/cluster/nodes/%s/status", managerNode1) { + rw.WriteHeader(200) + _, err = rw.Write(mNodeStatus) + require.NoError(t, err) + return + } + + rw.WriteHeader(404) + })) + + return nsxMock +} diff --git a/receiver/nsxreceiver/receiver.go b/receiver/nsxreceiver/receiver.go index c06414de1e4f..4a95162b959b 100644 --- a/receiver/nsxreceiver/receiver.go +++ b/receiver/nsxreceiver/receiver.go @@ -38,12 +38,12 @@ func (n *nsxReceiver) Start(ctx context.Context, host component.Host) error { if scraperErr := n.scraper.Start(ctx, host); scraperErr != nil { // Start should not stop the collector if the metrics client connection attempt does not succeed, // so we log on start when we cannot connect - n.logger.Error(fmt.Sprintf("unable to initially connect to NSX API: %s", scraperErr.Error())) + n.logger.Error(fmt.Sprintf("unable to initially start connecting to the NSX API: %s", scraperErr.Error())) } } if n.logsReceiver != nil { - // if syslogreceiver is not bundled and logging is in the pipeline for vcenter, we probably want to not start the collector + // if syslogreceiver is not bundled and logging is in the pipeline for NSX, we probably want to not start the collector if startErr := n.logsReceiver.Start(ctx, host); startErr != nil { err = multierr.Append(err, startErr) } diff --git a/receiver/nsxreceiver/receiver_test.go b/receiver/nsxreceiver/receiver_test.go new file mode 100644 index 000000000000..8d3908da05ab --- /dev/null +++ b/receiver/nsxreceiver/receiver_test.go @@ -0,0 +1,157 @@ +package nsxreceiver + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver/scraperhelper" +) + +type receiverOps func(t *testing.T, rcvr *nsxReceiver) + +func TestStart(t *testing.T) { + defaultConfig := createDefaultConfig().(*Config) + cases := []struct { + desc string + config *Config + ops []receiverOps + expectedError error + }{ + { + desc: "default", + config: defaultConfig, + }, + { + desc: "metrics config", + config: &Config{ + MetricsConfig: &MetricsConfig{ + ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(defaultConfig.ID().Type()), + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "https://localhost/", + }, + }, + }, + ops: []receiverOps{metricFactoryCreation}, + }, + { + desc: "metrics config failure via control character", + config: &Config{ + MetricsConfig: &MetricsConfig{ + ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(defaultConfig.ID().Type()), + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: string([]byte{0x7f}), + }, + }, + }, + ops: []receiverOps{metricFactoryCreation}, + }, + { + desc: "metrics config failure via control character, should not fail ", + config: &Config{ + MetricsConfig: &MetricsConfig{ + ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(defaultConfig.ID().Type()), + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: string([]byte{0x7f}), + }, + }, + }, + ops: []receiverOps{metricFactoryCreation}, + }, + { + desc: "syslogreceiver not packaged", + config: &Config{ + MetricsConfig: defaultConfig.MetricsConfig, + LoggingConfig: defaultConfig.LoggingConfig, + }, + ops: []receiverOps{loggingFactoryCreation}, + expectedError: errors.New("unable to wrap the syslog receiver"), + }, + } + + for _, tc := range cases { + t.Run(tc.desc, func(t *testing.T) { + rcvr := &nsxReceiver{ + config: tc.config, + } + + for _, op := range tc.ops { + op(t, rcvr) + } + + err := rcvr.Start(context.Background(), componenttest.NewNopHost()) + if tc.expectedError != nil { + require.ErrorContains(t, err, tc.expectedError.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + +var metricFactoryCreation = func(t *testing.T, rcvr *nsxReceiver) { + factory := &nsxReceiverFactory{ + receivers: map[*Config]*nsxReceiver{}, + } + sink := &consumertest.MetricsSink{} + mr, err := factory.createMetricsReceiver(context.Background(), componenttest.NewNopReceiverCreateSettings(), rcvr.config, sink) + require.NoError(t, err) + rcvr.scraper = mr +} + +var loggingFactoryCreation = func(t *testing.T, rcvr *nsxReceiver) { + factory := &nsxReceiverFactory{ + receivers: map[*Config]*nsxReceiver{}, + } + sink := &consumertest.LogsSink{} + lr, err := factory.createLogsReceiver(context.Background(), componenttest.NewNopReceiverCreateSettings(), rcvr.config, sink) + require.NoError(t, err) + rcvr.logsReceiver = lr +} + +func TestShutdown(t *testing.T) { + defaultConfig := createDefaultConfig().(*Config) + cases := []struct { + desc string + config *Config + ops []receiverOps + expectedError error + }{ + { + desc: "default", + config: defaultConfig, + }, + { + desc: "with metrics receiver", + config: defaultConfig, + ops: []receiverOps{metricFactoryCreation}, + }, + { + desc: "with logging receiver", + config: defaultConfig, + ops: []receiverOps{loggingFactoryCreation}, + }, + } + + for _, tc := range cases { + t.Run(tc.desc, func(t *testing.T) { + rcvr := &nsxReceiver{ + config: tc.config, + } + for _, op := range tc.ops { + op(t, rcvr) + } + _ = rcvr.Start(context.Background(), componenttest.NewNopHost()) + err := rcvr.Shutdown(context.Background()) + if tc.expectedError != nil { + require.ErrorContains(t, err, tc.expectedError.Error()) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index b9a4f907c52a..9f35c2ad96cf 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -16,7 +16,6 @@ package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector import ( "context" - "fmt" "math" "sync" "time" @@ -53,7 +52,7 @@ func (s *scraper) start(ctx context.Context, host component.Host) error { s.host = host err := s.ensureClient() if err != nil { - s.logger.Error(fmt.Sprintf("unable to instantiate client %s", err.Error())) + return err } return nil } From 460cc988a68c6485923dce876ee0a71cb3b58660 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 15:33:50 -0400 Subject: [PATCH 09/48] addlicense to test files --- receiver/nsxreceiver/client_test.go | 14 ++++++++++++++ receiver/nsxreceiver/doc.go | 17 +++++++++++++++++ receiver/nsxreceiver/receiver_test.go | 14 ++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 receiver/nsxreceiver/doc.go diff --git a/receiver/nsxreceiver/client_test.go b/receiver/nsxreceiver/client_test.go index 15aefe6d4563..84fe73cab4d6 100644 --- a/receiver/nsxreceiver/client_test.go +++ b/receiver/nsxreceiver/client_test.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver import ( diff --git a/receiver/nsxreceiver/doc.go b/receiver/nsxreceiver/doc.go new file mode 100644 index 000000000000..3448ca9dc4d3 --- /dev/null +++ b/receiver/nsxreceiver/doc.go @@ -0,0 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate mdatagen --experimental-gen metadata.yaml + +package nsxreceiver diff --git a/receiver/nsxreceiver/receiver_test.go b/receiver/nsxreceiver/receiver_test.go index 8d3908da05ab..659e1be18d71 100644 --- a/receiver/nsxreceiver/receiver_test.go +++ b/receiver/nsxreceiver/receiver_test.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package nsxreceiver import ( From 49574f4c59c7c7a7e05bf8c9735ebd930138124b Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 16:11:10 -0400 Subject: [PATCH 10/48] more tests --- receiver/nsxreceiver/config.go | 31 +- receiver/nsxreceiver/config_test.go | 70 + receiver/nsxreceiver/scraper_test.go | 52 +- .../testdata/metrics/expected_metrics.json | 1542 +++++++++++++---- .../status.json | 12 + .../status.json | 12 + 6 files changed, 1341 insertions(+), 378 deletions(-) diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index e2653da7f948..0ad2065ada98 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -15,6 +15,10 @@ package nsxreceiver import ( + "errors" + "fmt" + "net/url" + "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/receiver/scraperhelper" @@ -54,7 +58,32 @@ func (c *Config) Validate() error { } func (c *Config) validateMetrics() error { - return nil + mc := c.MetricsConfig + // do not require the configuration validation to specify metrics if not needed + // creating a default config by default creates a non-nil metrics config + if mc == nil || mc.Endpoint == "" { + return nil + } + + var err error + res, err := url.Parse(mc.Endpoint) + if err != nil { + err = multierr.Append(err, fmt.Errorf("unable to parse url %s: %w", c.MetricsConfig.Endpoint, err)) + return err + } + + if res.Scheme != "http" && res.Scheme != "https" { + err = multierr.Append(err, errors.New("url scheme must be http or https")) + } + + if mc.Username == "" { + err = multierr.Append(err, errors.New("username not provided and is required")) + } + + if mc.Password == "" { + err = multierr.Append(err, errors.New("password not provided and is required")) + } + return err } func (c *Config) validateLogs() error { diff --git a/receiver/nsxreceiver/config_test.go b/receiver/nsxreceiver/config_test.go index c3342ec4cf2d..9ba7cf5b41b1 100644 --- a/receiver/nsxreceiver/config_test.go +++ b/receiver/nsxreceiver/config_test.go @@ -15,12 +15,82 @@ package nsxreceiver import ( + "errors" "testing" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/config/confighttp" ) func TestID(t *testing.T) { config := createDefaultConfig() require.NotEmpty(t, config.ID()) } + +func TestMetricValidation(t *testing.T) { + defaultConfig := createDefaultConfig().(*Config) + cases := []struct { + desc string + cfg *Config + expectedError error + }{ + { + desc: "default config", + cfg: defaultConfig, + }, + { + desc: "not valid scheme", + cfg: &Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "wss://not-supported-websockets", + }, + }, + }, + expectedError: errors.New("url scheme must be http or https"), + }, + { + desc: "unparseable url", + cfg: &Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "\x00", + }, + }, + }, + expectedError: errors.New("parse"), + }, + { + desc: "username not provided", + cfg: &Config{ + MetricsConfig: &MetricsConfig{ + Password: "password", + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://localhost", + }, + }, + }, + expectedError: errors.New("username not provided"), + }, + { + desc: "password not provided", + cfg: &Config{ + MetricsConfig: &MetricsConfig{ + Username: "otelu", + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://localhost", + }, + }, + }, + expectedError: errors.New("password not provided"), + }, + } + for _, tc := range cases { + err := tc.cfg.Validate() + if tc.expectedError != nil { + require.ErrorContains(t, err, tc.expectedError.Error()) + } else { + require.NoError(t, err) + } + } +} diff --git a/receiver/nsxreceiver/scraper_test.go b/receiver/nsxreceiver/scraper_test.go index f2bb96f69db8..1e4bb1e85328 100644 --- a/receiver/nsxreceiver/scraper_test.go +++ b/receiver/nsxreceiver/scraper_test.go @@ -20,10 +20,13 @@ import ( "io/ioutil" "path/filepath" "testing" + "time" mock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/model/pdata" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest/golden" @@ -71,6 +74,39 @@ func TestScrape(t *testing.T) { require.NoError(t, err) } +func TestScrapeBadConfig(t *testing.T) { + scraper := newScraper( + &Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://\x00", + }, + Settings: metadata.DefaultMetricsSettings(), + }, + }, + componenttest.NewNopTelemetrySettings(), + ) + scraper.host = componenttest.NewNopHost() + _, err := scraper.scrape(context.Background()) + require.Error(t, err) +} + +func TestScraperRecordNoStat(t *testing.T) { + scraper := newScraper( + &Config{ + MetricsConfig: &MetricsConfig{ + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://localhost", + }, + Settings: metadata.DefaultMetricsSettings(), + }, + }, + componenttest.NewNopTelemetrySettings(), + ) + scraper.host = componenttest.NewNopHost() + scraper.recordNode(pdata.NewTimestampFromTime(time.Now()), &nodeInfo{stats: nil}) +} + func loadTestNodeStatus(t *testing.T, nodeID string, class nodeClass) (*dm.NodeStatus, error) { var classType string switch class { @@ -81,10 +117,18 @@ func loadTestNodeStatus(t *testing.T, nodeID string, class nodeClass) (*dm.NodeS } testFile, err := ioutil.ReadFile(filepath.Join("testdata", "metrics", "nodes", classType, nodeID, "status.json")) require.NoError(t, err) - var stats dm.NodeStatus - err = json.Unmarshal(testFile, &stats) - require.NoError(t, err) - return &stats, nil + switch class { + case transportClass: + var stats dm.TransportNodeStatus + err = json.Unmarshal(testFile, &stats) + require.NoError(t, err) + return &stats.NodeStatus, nil + default: + var stats dm.NodeStatus + err = json.Unmarshal(testFile, &stats) + require.NoError(t, err) + return &stats, nil + } } func loadTestNodeInterfaces(t *testing.T, nodeID string, class nodeClass) ([]dm.NetworkInterface, error) { diff --git a/receiver/nsxreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxreceiver/testdata/metrics/expected_metrics.json index 6d31fcd86c40..95d62f5a259c 100644 --- a/receiver/nsxreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxreceiver/testdata/metrics/expected_metrics.json @@ -44,8 +44,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -63,8 +63,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -82,8 +82,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "63594238" }, { @@ -101,8 +101,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -120,8 +120,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -139,8 +139,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" } ], @@ -163,8 +163,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "4161088074" }, { @@ -176,8 +176,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" } ], @@ -233,8 +233,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -252,8 +252,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -271,8 +271,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "63594238" }, { @@ -290,8 +290,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -309,8 +309,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -328,8 +328,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" } ], @@ -352,8 +352,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "4161088074" }, { @@ -365,8 +365,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" } ], @@ -407,6 +407,21 @@ "name": "otelcol/nsxreceiver" }, "metrics": [ + { + "name": "nsx.node.cache.memory.usage", + "description": "The memory usage of the node's cache", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "8" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, { "name": "nsx.node.cpu.utilization", "description": "The average amount of CPU being used by the node.", @@ -422,9 +437,9 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asDouble": 0 + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.01 }, { "attributes": [ @@ -435,344 +450,538 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asDouble": 0 + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 4.34 } ] } }, { - "name": "nsx.node.memory.usage", - "description": "The memory usage of the node", - "unit": "KBy", - "sum": { - "dataPoints": [ - { - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" - } - ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" - } - } - ] - } - ] - }, - { - "resource": { - "attributes": [ - { - "key": "nsx.interface.id", - "value": { - "stringValue": "vmnic0" - } - }, - { - "key": "nsx.node.name", - "value": { - "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" - } - } - ] - }, - "scopeMetrics": [ - { - "scope": { - "name": "otelcol/nsxreceiver" - }, - "metrics": [ - { - "name": "nsx.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", - "unit": "{packets}", + "name": "nsx.node.disk.usage", + "description": "The amount of storage space used by the node.", + "unit": "By", "sum": { "dataPoints": [ { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "received" + "stringValue": "/" } - }, + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "6344" + }, + { + "attributes": [ { - "key": "type", + "key": "disk", "value": { - "stringValue": "dropped" + "stringValue": "/etc" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "1092" }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "received" + "stringValue": "/opt" } - }, + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "704" + }, + { + "attributes": [ { - "key": "type", + "key": "disk", "value": { - "stringValue": "errored" + "stringValue": "/var" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "868" }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "received" + "stringValue": "/tmp" } - }, + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "16" + }, + { + "attributes": [ { - "key": "type", + "key": "disk", "value": { - "stringValue": "success" + "stringValue": "/var/run/iofilters" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "63594238" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "transmitted" + "stringValue": "/var/run/shm" } - }, + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ { - "key": "type", + "key": "disk", "value": { - "stringValue": "dropped" + "stringValue": "/var/run/crx" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "transmitted" + "stringValue": "/etc/vmware/configstore" } - }, + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "272" + }, + { + "attributes": [ { - "key": "type", + "key": "disk", "value": { - "stringValue": "errored" + "stringValue": "/var/lib/vmware/configstore/backup" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "272" }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "transmitted" + "stringValue": "/vsantraces" } - }, + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "270116" + }, + { + "attributes": [ { - "key": "type", + "key": "disk", "value": { - "stringValue": "success" + "stringValue": "/var/lib/vmware/hostd/stats" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" - } - ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", - "isMonotonic": true - } - }, - { - "name": "nsx.interface.throughput", - "description": "The number of Bytes flowing through the network interface.", - "unit": "By", - "sum": { - "dataPoints": [ + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "5456" + }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "received" + "stringValue": "/var/lib/vmware/nsx/nestdb/db" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "4161088074" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "6344" }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "transmitted" + "stringValue": "/etc/nsx-idps/rules" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "7584" } ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", - "isMonotonic": true + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" } - } - ] - } - ] - }, - { - "resource": { - "attributes": [ - { - "key": "nsx.interface.id", - "value": { - "stringValue": "vmk10" - } - }, - { - "key": "nsx.node.name", - "value": { - "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" - } - } - ] - }, - "scopeMetrics": [ - { - "scope": { - "name": "otelcol/nsxreceiver" - }, - "metrics": [ + }, { - "name": "nsx.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", - "unit": "{packets}", - "sum": { + "name": "nsx.node.disk.utilization", + "description": "The percentage of storage space utilized.", + "unit": "%", + "gauge": { "dataPoints": [ { "attributes": [ { - "key": "direction", - "value": { - "stringValue": "received" - } - }, - { - "key": "type", + "key": "disk", "value": { - "stringValue": "dropped" + "stringValue": "/" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 19.3603515625 }, { "attributes": [ { - "key": "direction", - "value": { - "stringValue": "received" - } - }, - { - "key": "type", + "key": "disk", "value": { - "stringValue": "errored" + "stringValue": "/etc" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 3.80859375 }, { "attributes": [ { - "key": "direction", - "value": { - "stringValue": "received" - } - }, - { - "key": "type", + "key": "disk", "value": { - "stringValue": "success" + "stringValue": "/opt" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "63594238" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 2.1484375 }, { "attributes": [ { - "key": "direction", - "value": { - "stringValue": "transmitted" - } - }, - { - "key": "type", + "key": "disk", "value": { - "stringValue": "dropped" + "stringValue": "/var" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 1.7659505208333333 }, { "attributes": [ { - "key": "direction", + "key": "disk", "value": { - "stringValue": "transmitted" + "stringValue": "/tmp" } - }, + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.006103515625 + }, + { + "attributes": [ { - "key": "type", + "key": "disk", "value": { - "stringValue": "errored" + "stringValue": "/var/run/iofilters" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/shm" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/crx" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc/vmware/configstore" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.830078125 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/configstore/backup" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.830078125 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/vsantraces" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 87.92838541666667 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/hostd/stats" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.25952873843156354 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/nsx/nestdb/db" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 1.21002197265625 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc/nsx-idps/rules" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 11.572265625 + } + ] + } + }, + { + "name": "nsx.node.memory.usage", + "description": "The memory usage of the node", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "89169108" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.interface.id", + "value": { + "stringValue": "vmnic0" + } + }, + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "63594238" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" }, { "attributes": [ @@ -789,8 +998,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" } ], @@ -813,8 +1022,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "4161088074" }, { @@ -826,8 +1035,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" } ], @@ -843,21 +1052,15 @@ "resource": { "attributes": [ { - "key": "nsx.node.name", - "value": { - "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" - } - }, - { - "key": "nsx.node.id", + "key": "nsx.interface.id", "value": { - "stringValue": "f5045ed2-43ab-4a35-a2c5-d20c30a32292" + "stringValue": "vmk10" } }, { - "key": "nsx.node.type", + "key": "nsx.node.name", "value": { - "stringValue": "transport" + "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" } } ] @@ -869,40 +1072,633 @@ }, "metrics": [ { - "name": "nsx.node.cpu.utilization", - "description": "The average amount of CPU being used by the node.", - "unit": "%", - "gauge": { + "name": "nsx.interface.packet.count", + "description": "The number of packets flowing through the network interface on the node.", + "unit": "{packets}", + "sum": { "dataPoints": [ { "attributes": [ { - "key": "cpu.process.class", + "key": "direction", "value": { - "stringValue": "datapath" + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asDouble": 0 + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" }, { "attributes": [ { - "key": "cpu.process.class", + "key": "direction", "value": { - "stringValue": "services" + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asDouble": 0 - } - ] - } - }, + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "63594238" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "dropped" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "errored" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + }, + { + "key": "type", + "value": { + "stringValue": "success" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsx.interface.throughput", + "description": "The number of Bytes flowing through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "4161088074" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "nsx.node.name", + "value": { + "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" + } + }, + { + "key": "nsx.node.id", + "value": { + "stringValue": "f5045ed2-43ab-4a35-a2c5-d20c30a32292" + } + }, + { + "key": "nsx.node.type", + "value": { + "stringValue": "transport" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxreceiver" + }, + "metrics": [ + { + "name": "nsx.node.cache.memory.usage", + "description": "The memory usage of the node's cache", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "8" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, + { + "name": "nsx.node.cpu.utilization", + "description": "The average amount of CPU being used by the node.", + "unit": "%", + "gauge": { + "dataPoints": [ + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "datapath" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.01 + }, + { + "attributes": [ + { + "key": "cpu.process.class", + "value": { + "stringValue": "services" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 4.34 + } + ] + } + }, + { + "name": "nsx.node.disk.usage", + "description": "The amount of storage space used by the node.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "6344" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "1092" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/opt" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "704" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "868" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/tmp" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "24" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/iofilters" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/shm" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/crx" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "0" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc/vmware/configstore" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "276" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/configstore/backup" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "276" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/vsantraces" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "273024" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/hostd/stats" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "5904" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/nsx/nestdb/db" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "7652" + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc/nsx-idps/rules" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "7584" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, + { + "name": "nsx.node.disk.utilization", + "description": "The percentage of storage space utilized.", + "unit": "%", + "gauge": { + "dataPoints": [ + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 19.3603515625 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 3.80859375 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/opt" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 2.1484375 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 1.7659505208333333 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/tmp" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.0091552734375 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/iofilters" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/shm" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/run/crx" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc/vmware/configstore" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.84228515625 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/configstore/backup" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.84228515625 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/vsantraces" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 88.875 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/hostd/stats" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 0.280839016074038 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/var/lib/vmware/nsx/nestdb/db" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 1.459503173828125 + }, + { + "attributes": [ + { + "key": "disk", + "value": { + "stringValue": "/etc/nsx-idps/rules" + } + } + ], + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asDouble": 11.572265625 + } + ] + } + }, { "name": "nsx.node.memory.usage", "description": "The memory usage of the node", @@ -910,9 +1706,9 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", - "asInt": "0" + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", + "asInt": "143728936" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" @@ -966,8 +1762,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "288" }, { @@ -985,8 +1781,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1004,8 +1800,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "12483778397" }, { @@ -1023,8 +1819,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1042,8 +1838,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1061,8 +1857,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "12313320048" } ], @@ -1085,8 +1881,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "2837237037443" }, { @@ -1098,8 +1894,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "5877910030884" } ], @@ -1155,8 +1951,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "288" }, { @@ -1174,8 +1970,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1193,8 +1989,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "12483778397" }, { @@ -1212,8 +2008,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1231,8 +2027,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1250,8 +2046,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "12313320048" } ], @@ -1274,8 +2070,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "2837237037443" }, { @@ -1287,8 +2083,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "5877910030884" } ], @@ -1344,8 +2140,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0 }, { @@ -1357,8 +2153,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0 } ] @@ -1379,8 +2175,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1392,8 +2188,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "6612" }, { @@ -1405,8 +2201,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "7075020" }, { @@ -1418,8 +2214,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "6436" }, { @@ -1431,8 +2227,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1444,8 +2240,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" }, { @@ -1457,8 +2253,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "9788208" }, { @@ -1470,8 +2266,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "2280724" }, { @@ -1483,8 +2279,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "5876104" }, { @@ -1496,8 +2292,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "15708" }, { @@ -1509,8 +2305,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "902516" }, { @@ -1522,8 +2318,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "166988" }, { @@ -1535,8 +2331,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "8424" }, { @@ -1548,8 +2344,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "54340" }, { @@ -1561,8 +2357,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "0" } ], @@ -1584,8 +2380,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0 }, { @@ -1597,8 +2393,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0.26797134506052456 }, { @@ -1610,8 +2406,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 66.21743141110211 }, { @@ -1623,8 +2419,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0.052167766869415225 }, { @@ -1636,8 +2432,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0 }, { @@ -1649,8 +2445,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0 }, { @@ -1662,8 +2458,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 34.81667425730868 }, { @@ -1675,8 +2471,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 2.2126377725298423 }, { @@ -1688,8 +2484,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 18.184516721289395 }, { @@ -1701,8 +2497,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0.4064022585492464 }, { @@ -1714,8 +2510,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 9.30463398641599 }, { @@ -1727,8 +2523,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0.5502299137810142 }, { @@ -1740,8 +2536,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0.8718114304165321 }, { @@ -1753,8 +2549,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0.12318272609130737 }, { @@ -1766,8 +2562,8 @@ } } ], - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asDouble": 0 } ] @@ -1780,8 +2576,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1651592756089350000", - "timeUnixNano": "1651592756089985000", + "startTimeUnixNano": "1651607561315379000", + "timeUnixNano": "1651607561316127000", "asInt": "19636300" } ], diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json index 1dce9043f15f..cfc94086f8a1 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json @@ -19,6 +19,12 @@ "software_version": "3.1.2.0.0.17883598", "system_status": { "cpu_cores": 72, + "cpu_usage": { + "highest_cpu_core_usage_dpdk": 0.02, + "avg_cpu_core_usage_dpdk": 0.01, + "highest_cpu_core_usage_non_dpdk": 6.63, + "avg_cpu_core_usage_non_dpdk": 4.34 + }, "file_systems": [ { "file_system": "root", @@ -119,6 +125,12 @@ "used": 7584 } ], + "edge_mem_usage": { + "system_mem_usage": 50.99, + "swap_usage": 0.0, + "cache_usage": 8.69, + "datapath_total_usage": 48.52 + }, "load_average": [ 0.04, 0.04, diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json index 1cce6b6fb537..37bf0271266b 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json @@ -19,6 +19,12 @@ "software_version": "3.1.2.0.0.17883598", "system_status": { "cpu_cores": 72, + "cpu_usage": { + "highest_cpu_core_usage_dpdk": 0.02, + "avg_cpu_core_usage_dpdk": 0.01, + "highest_cpu_core_usage_non_dpdk": 6.63, + "avg_cpu_core_usage_non_dpdk": 4.34 + }, "file_systems": [ { "file_system": "root", @@ -119,6 +125,12 @@ "used": 7584 } ], + "edge_mem_usage": { + "system_mem_usage": 50.99, + "swap_usage": 0.0, + "cache_usage": 8.69, + "datapath_total_usage": 48.52 + }, "load_average": [ 0.07, 0.08, From edcc70590849914ca611bb33bd2ef4f7204d87ad Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 16:37:55 -0400 Subject: [PATCH 11/48] more tests --- receiver/nsxreceiver/client.go | 6 +- receiver/nsxreceiver/client_test.go | 66 ++++++++++++++++++- receiver/nsxreceiver/factory_test.go | 26 ++++++++ .../nsxreceiver/internal/model/interface.go | 2 + receiver/nsxreceiver/internal/model/node.go | 8 ++- receiver/nsxreceiver/mock_client_test.go | 1 - receiver/nsxreceiver/scraper.go | 15 ++--- receiver/nsxreceiver/scraper_test.go | 44 +++++++++++-- 8 files changed, 148 insertions(+), 20 deletions(-) diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go index 39cc80f2de79..78fa0c774384 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxreceiver/client.go @@ -23,7 +23,6 @@ import ( "net/http" "net/url" - nsxt "github.com/vmware/go-vmware-nsxt" "go.opentelemetry.io/collector/component" "go.uber.org/zap" @@ -43,7 +42,6 @@ type Client interface { type nsxClient struct { config *Config - driver *nsxt.APIClient client *http.Client endpoint *url.URL logger *zap.Logger @@ -155,11 +153,11 @@ func (c *nsxClient) InterfaceStatus( ) if err != nil { - return nil, fmt.Errorf("unable to get interface stats ") + return nil, fmt.Errorf("unable to get interface stats: %w", err) } var interfaceStats dm.NetworkInterfaceStats err = json.Unmarshal(body, &interfaceStats) - return &interfaceStats, nil + return &interfaceStats, err } type requestOption func(req *http.Request) *http.Request diff --git a/receiver/nsxreceiver/client_test.go b/receiver/nsxreceiver/client_test.go index 84fe73cab4d6..651c4e30de31 100644 --- a/receiver/nsxreceiver/client_test.go +++ b/receiver/nsxreceiver/client_test.go @@ -182,7 +182,7 @@ func TestDoRequestBadUrl(t *testing.T) { require.ErrorContains(t, err, "parse") } -func TestPermissionDenied(t *testing.T) { +func TestPermissionDenied_ClusterNodes(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ MetricsConfig: &MetricsConfig{ @@ -198,6 +198,70 @@ func TestPermissionDenied(t *testing.T) { require.ErrorContains(t, err, errUnauthorized.Error()) } +func TestPermissionDenied_Interfaces(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + + _, err = client.Interfaces(context.Background(), managerNode1, managerClass) + require.ErrorContains(t, err, errUnauthorized.Error()) +} + +func TestPermissionDenied_InterfaceStatus(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + + _, err = client.InterfaceStatus(context.Background(), managerNode1, managerNodeNic1, managerClass) + require.ErrorContains(t, err, errUnauthorized.Error()) +} + +func TestPermissionDenied_NodeStatus(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + + _, err = client.NodeStatus(context.Background(), managerNode1, managerClass) + require.ErrorContains(t, err, errUnauthorized.Error()) +} + +func TestPermissionDenied_TransportNodes(t *testing.T) { + nsxMock := mockServer(t) + client, err := newClient(&Config{ + MetricsConfig: &MetricsConfig{ + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, + }, + }, + }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) + require.NoError(t, err) + + _, err = client.TransportNodes(context.Background()) + require.ErrorContains(t, err, errUnauthorized.Error()) +} + func TestInternalServerError(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ diff --git a/receiver/nsxreceiver/factory_test.go b/receiver/nsxreceiver/factory_test.go index 95e837bb36a7..0d4475902bcb 100644 --- a/receiver/nsxreceiver/factory_test.go +++ b/receiver/nsxreceiver/factory_test.go @@ -23,6 +23,8 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver/scraperhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver" ) func TestType(t *testing.T) { @@ -53,3 +55,27 @@ func TestCreateMetricsReceiver(t *testing.T) { ) require.NoError(t, err) } + +func TestCreateMetricsReceiverNotNSX(t *testing.T) { + factory := NewFactory() + _, err := factory.CreateMetricsReceiver( + context.Background(), + componenttest.NewNopReceiverCreateSettings(), + &syslogreceiver.SysLogConfig{}, + consumertest.NewNop(), + ) + require.Error(t, err) + require.ErrorContains(t, err, errConfigNotNSX.Error()) +} + +func TestCreateLogsReceiverNotNSX(t *testing.T) { + factory := NewFactory() + _, err := factory.CreateLogsReceiver( + context.Background(), + componenttest.NewNopReceiverCreateSettings(), + &syslogreceiver.SysLogConfig{}, + consumertest.NewNop(), + ) + require.Error(t, err) + require.ErrorContains(t, err, errConfigNotNSX.Error()) +} diff --git a/receiver/nsxreceiver/internal/model/interface.go b/receiver/nsxreceiver/internal/model/interface.go index 3056c58f5e01..51c15f8645ad 100644 --- a/receiver/nsxreceiver/internal/model/interface.go +++ b/receiver/nsxreceiver/internal/model/interface.go @@ -15,6 +15,8 @@ package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" import "github.com/vmware/go-vmware-nsxt/manager" // NodeNetworkInterfacePropertiesListResult wraps the results of a node's network interface + +// NodeNetworkInterfacePropertiesListResult contains the results of the Node's Network Interfaces type NodeNetworkInterfacePropertiesListResult struct { // Node network interface property results Results []NetworkInterface `json:"results"` diff --git a/receiver/nsxreceiver/internal/model/node.go b/receiver/nsxreceiver/internal/model/node.go index 7856bdfb0390..fc266df92587 100644 --- a/receiver/nsxreceiver/internal/model/node.go +++ b/receiver/nsxreceiver/internal/model/node.go @@ -21,7 +21,7 @@ type ClusterNodeList struct { // ClusterNode is a Controller Node or Manager Node type ClusterNode struct { - NodeProperties `json:",squash"` + NodeProperties `mapstructure:",squash"` ControllerRole *ControllerRole `json:"controller_role,omitempty"` } @@ -37,7 +37,7 @@ type TransportNodeList struct { // TransportNode is a representation of an NSX host or edge transport node type TransportNode struct { - NodeProperties `json:",squash"` + NodeProperties `mapstructure:",squash"` Description string `json:"description" ` } @@ -107,6 +107,7 @@ type NodeStatus struct { } `json:"system_status"` } +// TransportNodeStatus wraps a node_status because it is wrapped in the HTTP response type TransportNodeStatus struct { NodeStatus NodeStatus `mapstructure:"node_status" json:"node_status"` } @@ -132,6 +133,7 @@ type SystemStatus struct { Uptime int64 `json:"uptime"` } +// NodeSystemCPUUsage is a report of the CPU usage of the node type NodeSystemCPUUsage struct { HighestCPUCoreUsageDpdk float64 `json:"highest_cpu_core_usage_dpdk"` AvgCPUCoreUsageDpdk float64 `json:"avg_cpu_core_usage_dpdk"` @@ -139,6 +141,7 @@ type NodeSystemCPUUsage struct { AvgCPUCoreUsageNonDpdk float64 `json:"avg_cpu_core_usage_non_dpdk"` } +// FileSystemsUsage is a report of the storage used by the node type FileSystemsUsage struct { // Name of the filesystem FileSystem string `json:"file_system"` @@ -148,6 +151,7 @@ type FileSystemsUsage struct { Used int `json:"used"` } +// MemSystemUsage is a report of how the node is using its memory type MemSystemUsage struct { SystemMemUsage float64 `json:"system_mem_usage"` SwapUsage float64 `json:"swap_usage"` diff --git a/receiver/nsxreceiver/mock_client_test.go b/receiver/nsxreceiver/mock_client_test.go index e404f556b5a3..6abf7b6a23e3 100644 --- a/receiver/nsxreceiver/mock_client_test.go +++ b/receiver/nsxreceiver/mock_client_test.go @@ -31,7 +31,6 @@ const ( managerNode1 = "b7a79908-9808-4c9e-bb49-b70008993fcb" managerNodeNic1 = "eth0" managerNodeNic2 = "lo" - controllerNode1 = "8aaacaaa-c51d-44f9-8051-f615458eebe2" ) // MockClient is an autogenerated mock type for the MockClient type diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index 9f35c2ad96cf..017f027d0bae 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -62,7 +62,6 @@ type nodeClass int const ( transportClass nodeClass = iota managerClass - controllerClass ) func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { @@ -75,18 +74,19 @@ func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { r := s.retrieve(ctx, errs) colTime := pdata.NewTimestampFromTime(time.Now()) - s.process(r, colTime, errs) + s.process(r, colTime) + return s.mb.Emit(), errs.Combine() } type nodeInfo struct { nodeProps dm.NodeProperties nodeType string - interfaces []interfaceInfo + interfaces []interfaceInformation stats *dm.NodeStatus } -type interfaceInfo struct { +type interfaceInformation struct { iFace dm.NetworkInterface stats *dm.NetworkInterfaceStats } @@ -156,9 +156,9 @@ func (s *scraper) retrieveInterfaces( errs.AddPartial(1, err) return } - nodeInfo.interfaces = []interfaceInfo{} + nodeInfo.interfaces = []interfaceInformation{} for _, i := range interfaces { - interfaceInfo := interfaceInfo{ + interfaceInfo := interfaceInformation{ iFace: i, } stats, err := s.client.InterfaceStatus(ctx, nodeProps.ID, i.InterfaceId, nodeClass) @@ -190,7 +190,6 @@ func (s *scraper) retrieveNodeStats( func (s *scraper) process( nodes []*nodeInfo, colTime pdata.Timestamp, - errs *scrapererror.ScrapeErrors, ) { for _, n := range nodes { for _, i := range n.interfaces { @@ -200,7 +199,7 @@ func (s *scraper) process( } } -func (s *scraper) recordNodeInterface(colTime pdata.Timestamp, nodeProps dm.NodeProperties, i interfaceInfo) { +func (s *scraper) recordNodeInterface(colTime pdata.Timestamp, nodeProps dm.NodeProperties, i interfaceInformation) { s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirection.Received, metadata.AttributePacketType.Dropped) s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirection.Received, metadata.AttributePacketType.Errored) successRxPackets := i.stats.RxPackets - i.stats.RxDropped - i.stats.RxErrors diff --git a/receiver/nsxreceiver/scraper_test.go b/receiver/nsxreceiver/scraper_test.go index 1e4bb1e85328..3e353e18ae9d 100644 --- a/receiver/nsxreceiver/scraper_test.go +++ b/receiver/nsxreceiver/scraper_test.go @@ -91,6 +91,42 @@ func TestScrapeBadConfig(t *testing.T) { require.Error(t, err) } +func TestScrapeTransportNodeErrors(t *testing.T) { + mockClient := NewMockClient(t) + + // mockClient.On("ClusterNodes", mock.Anything).Return(nil, errUnauthorized) + mockClient.On("TransportNodes", mock.Anything).Return(nil, errUnauthorized) + scraper := newScraper( + &Config{ + MetricsConfig: &MetricsConfig{Settings: metadata.DefaultMetricsSettings()}, + }, + componenttest.NewNopTelemetrySettings(), + ) + scraper.client = mockClient + + _, err := scraper.scrape(context.Background()) + require.Error(t, err) + require.ErrorContains(t, err, errUnauthorized.Error()) +} + +func TestScrapeClusterNodeErrors(t *testing.T) { + mockClient := NewMockClient(t) + + mockClient.On("ClusterNodes", mock.Anything).Return(nil, errUnauthorized) + mockClient.On("TransportNodes", mock.Anything).Return(loadTestTransportNodes()) + scraper := newScraper( + &Config{ + MetricsConfig: &MetricsConfig{Settings: metadata.DefaultMetricsSettings()}, + }, + componenttest.NewNopTelemetrySettings(), + ) + scraper.client = mockClient + + _, err := scraper.scrape(context.Background()) + require.Error(t, err) + require.ErrorContains(t, err, errUnauthorized.Error()) +} + func TestScraperRecordNoStat(t *testing.T) { scraper := newScraper( &Config{ @@ -122,12 +158,12 @@ func loadTestNodeStatus(t *testing.T, nodeID string, class nodeClass) (*dm.NodeS var stats dm.TransportNodeStatus err = json.Unmarshal(testFile, &stats) require.NoError(t, err) - return &stats.NodeStatus, nil + return &stats.NodeStatus, err default: var stats dm.NodeStatus err = json.Unmarshal(testFile, &stats) require.NoError(t, err) - return &stats, nil + return &stats, err } } @@ -144,7 +180,7 @@ func loadTestNodeInterfaces(t *testing.T, nodeID string, class nodeClass) ([]dm. var interfaces dm.NodeNetworkInterfacePropertiesListResult err = json.Unmarshal(testFile, &interfaces) require.NoError(t, err) - return interfaces.Results, nil + return interfaces.Results, err } func loadInterfaceStats(t *testing.T, nodeID, interfaceID string, class nodeClass) (*dm.NetworkInterfaceStats, error) { @@ -160,7 +196,7 @@ func loadInterfaceStats(t *testing.T, nodeID, interfaceID string, class nodeClas var stats dm.NetworkInterfaceStats err = json.Unmarshal(testFile, &stats) require.NoError(t, err) - return &stats, nil + return &stats, err } func loadTestClusterNodes() ([]dm.ClusterNode, error) { From 5855ee3e0910f10daab5e49682e8327e6cc65ecd Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 17:17:36 -0400 Subject: [PATCH 12/48] add Readme --- receiver/nsxreceiver/README.md | 101 ++++++++++++++++++ receiver/nsxreceiver/testdata/config.yaml | 20 ++++ .../testdata/metrics/cluster_nodes.json | 2 +- .../testdata/metrics/expected_metrics.json | 2 +- .../status.json | 2 +- .../interfaces/eth0/stats.json | 2 +- .../interfaces/index.json | 2 +- .../interfaces/lo/stats.json | 2 +- .../status.json | 2 +- .../interfaces/index.json | 2 +- .../interfaces/vmk10/stats.json | 2 +- .../interfaces/vmnic0/stats.json | 2 +- .../status.json | 2 +- .../interfaces/index.json | 2 +- .../interfaces/vmk10/stats.json | 2 +- .../interfaces/vmnic0/stats.json | 2 +- .../status.json | 2 +- .../testdata/metrics/transport_nodes.json | 2 +- 18 files changed, 137 insertions(+), 16 deletions(-) create mode 100644 receiver/nsxreceiver/README.md create mode 100644 receiver/nsxreceiver/testdata/config.yaml diff --git a/receiver/nsxreceiver/README.md b/receiver/nsxreceiver/README.md new file mode 100644 index 000000000000..1a8ab65dc555 --- /dev/null +++ b/receiver/nsxreceiver/README.md @@ -0,0 +1,101 @@ +# MongoDB Receiver + +This receiver fetches metrics important to run virtual networking using NSX-T. The receiver is planned to ingest metrics via the [NSX Rest API](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_api.pdf). As for logs, it wraps the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) which can be used to ingest NSX forwarded logs. + +Supported pipeline types: `metrics` and `logs` + +> :construction: This receiver is in **BETA**. Configuration fields and metric data model are subject to change. + +## Purpose + +The purpose of this receiver is to allow users to monitor metrics from NSX-T environments. + +## Prerequisites + +Needs a “Network Admin” user for NSX Manager Resources in the vSphere Client (can be created via Web UI or CLI) + +The collector must be able to reach the NSX Manager with port 443 open. + +This receiver supports NSX-T Datacenter versions: + +- 3.2.0 +- 3.1.2 + +## Metrics Configuration + +Under the `metrics` key of the NSX configuration are these parameters: + +- `settings` (default: see DefaultMetricsSettings [here])(./internal/metadata/generated_metrics_v2.go): Allows enabling and disabling specific metrics from being collected in this receiver. + +- `endpoint`: Endpoint of the NSX Manager. Must be formatted as `{scheme}://{host}:{port}`. Schems supported are `http` and `https` + +- `username`: Username of the `Network Admin` user + +- `password`: Password of the `Network Admin` user + +- `collection_interval`: (default = `1m`): This receiver collects metrics on an interval. This value must be a string readable by Golang's [time.ParseDuration](https://pkg.go.dev/time#ParseDuration). Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. + +- `timeout`: (default = `1m`) The timeout of running commands against the NSX REST API. + +### Example Configuration + +```yaml +receivers: + nsx: + metrics: + endpoint: https://nsx-manager + username: admin + password: password + timeout: 60s + settings: + nsx.node.cpu.utilization: + enabled: false + logs: + listen_address: 0.0.0.0:5120 + +exporters: + file: + path: "./content.json" + +service: + pipelines: + metrics: + receivers: [nsx] + exporters: [file] + logs: + receivers: [nsx] + exporters: [file] +``` + +The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). + +## Metrics + +Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) + +## Logging Configuration + +Logging is ingested via syslog forwarding from the vCenter. This [document](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/com.vmware.nsx.logging.doc/GUID-EA70974C-07F8-469D-8A9D-0ED54F0C8F34.html) from VMware outlines how to configure syslog forwarding from your NSX Data Center. + +### Logging Prerequisites + +This component wraps the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) as the engine for ingesting these forwarded syslogs. Currently this receiver only supports these protocols: + +- udp +- tcp +- tls + +So please be sure to pick the same format on both configuration of the collector and the forwarder. + +Almost all configuration options are identical as the [syslogreceiver configuration options](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver#configuration). + +### Example Logging Configuration + +```yaml +receivers: + nsx: + logging: + udp: + listen_address: 0.0.0.0:5142 + protocol: rfc5424 +``` diff --git a/receiver/nsxreceiver/testdata/config.yaml b/receiver/nsxreceiver/testdata/config.yaml new file mode 100644 index 000000000000..a270ff8efc0b --- /dev/null +++ b/receiver/nsxreceiver/testdata/config.yaml @@ -0,0 +1,20 @@ +### Metrics +receivers: + nsx: + metrics: + collection_interval: 1m + endpoint: https://nsx-manager-endpoint + username: admin + password: password123 + tls: + insecure: true + +exporters: + file: + path: "./content.json" + +service: + pipelines: + metrics: + receivers: [nsx] + exporters: [file] diff --git a/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json b/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json index b6e461f2c958..a02cdda5ef81 100644 --- a/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json +++ b/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json @@ -54,4 +54,4 @@ } ], "result_count": 2 -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxreceiver/testdata/metrics/expected_metrics.json index 95d62f5a259c..d7447a64ae06 100644 --- a/receiver/nsxreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxreceiver/testdata/metrics/expected_metrics.json @@ -2589,4 +2589,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json index 7c9503e90d2a..f6a4a0513f5c 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json @@ -6,4 +6,4 @@ }, "control_cluster_status": "CONNECTED" } -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json index ad654703a5e7..91055d3c797f 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json @@ -12,4 +12,4 @@ "tx_errors": 0, "tx_packets": 12313320048, "source": "cached" -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json index 769bb158c412..097a0ec84c77 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json @@ -34,4 +34,4 @@ } ], "result_count": 2 -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json index 0aec74cb97b7..7819fa58444c 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json @@ -12,4 +12,4 @@ "tx_errors": 0, "tx_packets": 12313320048, "source": "cached" -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json index de25c08dd83c..b9f6561c47ad 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json @@ -128,4 +128,4 @@ "system_time": 1651589654000, "uptime": 10887499000 } -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json index 8764d0ffb16d..1f677ff392dc 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json @@ -27,4 +27,4 @@ } ], "result_count": 2 -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json index faf97ca83161..306a1158057e 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json @@ -10,4 +10,4 @@ "tx_errors": 0, "tx_packets": 0, "source": "cached" -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json index 544e4b613765..e6774685be58 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json @@ -10,4 +10,4 @@ "tx_errors": 0, "tx_packets": 0, "source": "cached" -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json index cfc94086f8a1..6143a99b2437 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json @@ -146,4 +146,4 @@ "uptime": 7285177000 } } -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json index 8764d0ffb16d..1f677ff392dc 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json @@ -27,4 +27,4 @@ } ], "result_count": 2 -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json index faf97ca83161..306a1158057e 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json @@ -10,4 +10,4 @@ "tx_errors": 0, "tx_packets": 0, "source": "cached" -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json index 544e4b613765..e6774685be58 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json @@ -10,4 +10,4 @@ "tx_errors": 0, "tx_packets": 0, "source": "cached" -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json index 37bf0271266b..00475ab631cb 100644 --- a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json +++ b/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json @@ -146,4 +146,4 @@ "uptime": 7288252000 } } -} \ No newline at end of file +} diff --git a/receiver/nsxreceiver/testdata/metrics/transport_nodes.json b/receiver/nsxreceiver/testdata/metrics/transport_nodes.json index 1ab69cc56b66..b68aa642eeef 100644 --- a/receiver/nsxreceiver/testdata/metrics/transport_nodes.json +++ b/receiver/nsxreceiver/testdata/metrics/transport_nodes.json @@ -68,4 +68,4 @@ "result_count": 2, "sort_by": "display_name", "sort_ascending": true -} \ No newline at end of file +} From 39be4c822cf87cc06a58410f8d22a23b319e203f Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 17:17:56 -0400 Subject: [PATCH 13/48] fix typo --- receiver/nsxreceiver/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/nsxreceiver/README.md b/receiver/nsxreceiver/README.md index 1a8ab65dc555..cf27aa1d0459 100644 --- a/receiver/nsxreceiver/README.md +++ b/receiver/nsxreceiver/README.md @@ -75,7 +75,7 @@ Details about the metrics produced by this receiver can be found in [metadata.ya ## Logging Configuration -Logging is ingested via syslog forwarding from the vCenter. This [document](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/com.vmware.nsx.logging.doc/GUID-EA70974C-07F8-469D-8A9D-0ED54F0C8F34.html) from VMware outlines how to configure syslog forwarding from your NSX Data Center. +Logging is ingested via syslog forwarding from the NSX. This [document](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/com.vmware.nsx.logging.doc/GUID-EA70974C-07F8-469D-8A9D-0ED54F0C8F34.html) from VMware outlines how to configure syslog forwarding from your NSX Data Center. ### Logging Prerequisites From e923ecdc38381dc3c5d0049c4373bad617a64938 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 3 May 2022 17:18:32 -0400 Subject: [PATCH 14/48] update readme again --- receiver/nsxreceiver/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/nsxreceiver/README.md b/receiver/nsxreceiver/README.md index cf27aa1d0459..673adb2efa78 100644 --- a/receiver/nsxreceiver/README.md +++ b/receiver/nsxreceiver/README.md @@ -1,6 +1,6 @@ # MongoDB Receiver -This receiver fetches metrics important to run virtual networking using NSX-T. The receiver is planned to ingest metrics via the [NSX Rest API](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_api.pdf). As for logs, it wraps the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) which can be used to ingest NSX forwarded logs. +This receiver fetches metrics important to run virtual networking using NSX-T. The receiver ingests metrics via the [NSX Rest API](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_api.pdf). As for logs, it wraps the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) which can be used to ingest NSX forwarded logs. Supported pipeline types: `metrics` and `logs` From 06e2594d7f1e88f757df0da56a11b2e571d80e75 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 10:06:22 -0400 Subject: [PATCH 15/48] rename file --- receiver/nsxreceiver/mock_client_test.go | 164 ----------------------- 1 file changed, 164 deletions(-) delete mode 100644 receiver/nsxreceiver/mock_client_test.go diff --git a/receiver/nsxreceiver/mock_client_test.go b/receiver/nsxreceiver/mock_client_test.go deleted file mode 100644 index 6abf7b6a23e3..000000000000 --- a/receiver/nsxreceiver/mock_client_test.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package nsxreceiver - -import ( - context "context" - testing "testing" - - mock "github.com/stretchr/testify/mock" - - model "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" -) - -const ( - transportNode1 = "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827" - transportNode2 = "f5045ed2-43ab-4a35-a2c5-d20c30a32292" - transportNodeNic1 = "vmk10" - transportNodeNic2 = "vmnic0" - managerNode1 = "b7a79908-9808-4c9e-bb49-b70008993fcb" - managerNodeNic1 = "eth0" - managerNodeNic2 = "lo" -) - -// MockClient is an autogenerated mock type for the MockClient type -type MockClient struct { - mock.Mock -} - -// ClusterNodes provides a mock function with given fields: ctx -func (_m *MockClient) ClusterNodes(ctx context.Context) ([]model.ClusterNode, error) { - ret := _m.Called(ctx) - - var r0 []model.ClusterNode - if rf, ok := ret.Get(0).(func(context.Context) []model.ClusterNode); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]model.ClusterNode) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// InterfaceStatus provides a mock function with given fields: ctx, nodeID, interfaceID, class -func (_m *MockClient) InterfaceStatus(ctx context.Context, nodeID string, interfaceID string, class nodeClass) (*model.NetworkInterfaceStats, error) { - ret := _m.Called(ctx, nodeID, interfaceID, class) - - var r0 *model.NetworkInterfaceStats - if rf, ok := ret.Get(0).(func(context.Context, string, string, nodeClass) *model.NetworkInterfaceStats); ok { - r0 = rf(ctx, nodeID, interfaceID, class) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NetworkInterfaceStats) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, string, string, nodeClass) error); ok { - r1 = rf(ctx, nodeID, interfaceID, class) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Interfaces provides a mock function with given fields: ctx, nodeID, class -func (_m *MockClient) Interfaces(ctx context.Context, nodeID string, class nodeClass) ([]model.NetworkInterface, error) { - ret := _m.Called(ctx, nodeID, class) - - var r0 []model.NetworkInterface - if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) []model.NetworkInterface); ok { - r0 = rf(ctx, nodeID, class) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]model.NetworkInterface) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, string, nodeClass) error); ok { - r1 = rf(ctx, nodeID, class) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NodeStatus provides a mock function with given fields: ctx, nodeID, class -func (_m *MockClient) NodeStatus(ctx context.Context, nodeID string, class nodeClass) (*model.NodeStatus, error) { - ret := _m.Called(ctx, nodeID, class) - - var r0 *model.NodeStatus - if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) *model.NodeStatus); ok { - r0 = rf(ctx, nodeID, class) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NodeStatus) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, string, nodeClass) error); ok { - r1 = rf(ctx, nodeID, class) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TransportNodes provides a mock function with given fields: ctx -func (_m *MockClient) TransportNodes(ctx context.Context) ([]model.TransportNode, error) { - ret := _m.Called(ctx) - - var r0 []model.TransportNode - if rf, ok := ret.Get(0).(func(context.Context) []model.TransportNode); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]model.TransportNode) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewMockClient creates a new instance of MockClient. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockClient(t testing.TB) *MockClient { - mock := &MockClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} From 14b7aecb160b845ca05ea5669849a2be9c08ad09 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 10:06:32 -0400 Subject: [PATCH 16/48] finish rename --- receiver/nsxreceiver/client_mock_test.go | 164 +++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 receiver/nsxreceiver/client_mock_test.go diff --git a/receiver/nsxreceiver/client_mock_test.go b/receiver/nsxreceiver/client_mock_test.go new file mode 100644 index 000000000000..6abf7b6a23e3 --- /dev/null +++ b/receiver/nsxreceiver/client_mock_test.go @@ -0,0 +1,164 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package nsxreceiver + +import ( + context "context" + testing "testing" + + mock "github.com/stretchr/testify/mock" + + model "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" +) + +const ( + transportNode1 = "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827" + transportNode2 = "f5045ed2-43ab-4a35-a2c5-d20c30a32292" + transportNodeNic1 = "vmk10" + transportNodeNic2 = "vmnic0" + managerNode1 = "b7a79908-9808-4c9e-bb49-b70008993fcb" + managerNodeNic1 = "eth0" + managerNodeNic2 = "lo" +) + +// MockClient is an autogenerated mock type for the MockClient type +type MockClient struct { + mock.Mock +} + +// ClusterNodes provides a mock function with given fields: ctx +func (_m *MockClient) ClusterNodes(ctx context.Context) ([]model.ClusterNode, error) { + ret := _m.Called(ctx) + + var r0 []model.ClusterNode + if rf, ok := ret.Get(0).(func(context.Context) []model.ClusterNode); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.ClusterNode) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// InterfaceStatus provides a mock function with given fields: ctx, nodeID, interfaceID, class +func (_m *MockClient) InterfaceStatus(ctx context.Context, nodeID string, interfaceID string, class nodeClass) (*model.NetworkInterfaceStats, error) { + ret := _m.Called(ctx, nodeID, interfaceID, class) + + var r0 *model.NetworkInterfaceStats + if rf, ok := ret.Get(0).(func(context.Context, string, string, nodeClass) *model.NetworkInterfaceStats); ok { + r0 = rf(ctx, nodeID, interfaceID, class) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NetworkInterfaceStats) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string, string, nodeClass) error); ok { + r1 = rf(ctx, nodeID, interfaceID, class) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Interfaces provides a mock function with given fields: ctx, nodeID, class +func (_m *MockClient) Interfaces(ctx context.Context, nodeID string, class nodeClass) ([]model.NetworkInterface, error) { + ret := _m.Called(ctx, nodeID, class) + + var r0 []model.NetworkInterface + if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) []model.NetworkInterface); ok { + r0 = rf(ctx, nodeID, class) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.NetworkInterface) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string, nodeClass) error); ok { + r1 = rf(ctx, nodeID, class) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NodeStatus provides a mock function with given fields: ctx, nodeID, class +func (_m *MockClient) NodeStatus(ctx context.Context, nodeID string, class nodeClass) (*model.NodeStatus, error) { + ret := _m.Called(ctx, nodeID, class) + + var r0 *model.NodeStatus + if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) *model.NodeStatus); ok { + r0 = rf(ctx, nodeID, class) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NodeStatus) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string, nodeClass) error); ok { + r1 = rf(ctx, nodeID, class) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TransportNodes provides a mock function with given fields: ctx +func (_m *MockClient) TransportNodes(ctx context.Context) ([]model.TransportNode, error) { + ret := _m.Called(ctx) + + var r0 []model.TransportNode + if rf, ok := ret.Get(0).(func(context.Context) []model.TransportNode); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.TransportNode) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewMockClient creates a new instance of MockClient. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockClient(t testing.TB) *MockClient { + mock := &MockClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} From 67b0b50a1bde632c59049b2c15adbec3080375bf Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 11:21:57 -0400 Subject: [PATCH 17/48] gotidy --- receiver/nsxreceiver/go.mod | 3 - receiver/nsxreceiver/go.sum | 252 ------------------------------------ 2 files changed, 255 deletions(-) diff --git a/receiver/nsxreceiver/go.mod b/receiver/nsxreceiver/go.mod index df58365b0262..2cd0056430f0 100644 --- a/receiver/nsxreceiver/go.mod +++ b/receiver/nsxreceiver/go.mod @@ -8,7 +8,6 @@ require ( ) require ( - github.com/antihax/optional v1.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/knadh/koanf v1.4.1 // indirect @@ -23,8 +22,6 @@ require ( go.opentelemetry.io/otel/trace v1.6.3 // indirect go.uber.org/atomic v1.9.0 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect - google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/receiver/nsxreceiver/go.sum b/receiver/nsxreceiver/go.sum index c77b4fdd88cb..901f30bdf7a4 100644 --- a/receiver/nsxreceiver/go.sum +++ b/receiver/nsxreceiver/go.sum @@ -1,42 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antonmedv/expr v1.9.0 h1:j4HI3NHEdgDnN9p6oI6Ndr0G5QryMY0FNxT4ONrFDGU= github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= @@ -58,9 +25,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -89,9 +53,6 @@ github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWp github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= @@ -102,23 +63,13 @@ github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr6 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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= @@ -133,15 +84,11 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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.4.1/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.1/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.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -149,19 +96,7 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -185,7 +120,6 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 h1:s9ZL6ZhFF8y6ebnm1FLvobkzoIu5xwDQUcRPk/IEhpM= github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6/go.mod h1:aXdIdfn2OcGnMhOTojXmwZqXKgC3MU5riiNvzwwG9OY= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -196,8 +130,6 @@ github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2E github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= 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/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 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.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= @@ -260,7 +192,6 @@ github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8d github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -276,7 +207,6 @@ github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -284,17 +214,10 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f h1:NbC9yOr5At92seXK+kOr2TzU3mIWzcJOVzZasGSuwoU= github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f/go.mod h1:VEqcmf4Sp7gPB7z05QGyKVmn6xWppr7Nz8cVNvyC80o= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.49.1-0.20220425174313-0674425b8ef2 h1:Ss1+RRJedpuBQ71wrqBxUUv/qiNlOWN1omK0xR0BpKc= @@ -329,39 +252,14 @@ go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 h1:FR+oGxGfbQu1d+jglI3rCkjAjUnhRSZcUxr+DqlDLNo= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -371,143 +269,59 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r 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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a h1:qfl7ob3DIEs3Ml9oLuPwY2N04gymzAW04WsUQHIClgM= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7 h1:8IVLkfbr2cLhv0a/vKq4UFUcJym8RmDoDboxCFWEjYE= golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -517,77 +331,21 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1N golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= @@ -602,7 +360,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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= @@ -613,7 +370,6 @@ gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUy gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -624,12 +380,4 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 4245ab941ce70fe9ead629a25f659321080cb2ea Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 12:52:59 -0400 Subject: [PATCH 18/48] remove logging component --- receiver/nsxreceiver/README.md | 30 ++--- receiver/nsxreceiver/client.go | 6 +- receiver/nsxreceiver/client_test.go | 108 ++++++---------- receiver/nsxreceiver/config.go | 52 ++------ receiver/nsxreceiver/config_test.go | 52 ++++---- receiver/nsxreceiver/factory.go | 61 +-------- receiver/nsxreceiver/factory_test.go | 24 +--- receiver/nsxreceiver/logs.go | 61 --------- receiver/nsxreceiver/receiver.go | 68 ---------- receiver/nsxreceiver/receiver_test.go | 171 -------------------------- receiver/nsxreceiver/scraper.go | 2 +- receiver/nsxreceiver/scraper_test.go | 22 ++-- 12 files changed, 106 insertions(+), 551 deletions(-) delete mode 100644 receiver/nsxreceiver/logs.go delete mode 100644 receiver/nsxreceiver/receiver.go delete mode 100644 receiver/nsxreceiver/receiver_test.go diff --git a/receiver/nsxreceiver/README.md b/receiver/nsxreceiver/README.md index 673adb2efa78..4f6d71310407 100644 --- a/receiver/nsxreceiver/README.md +++ b/receiver/nsxreceiver/README.md @@ -42,16 +42,13 @@ Under the `metrics` key of the NSX configuration are these parameters: ```yaml receivers: nsx: - metrics: - endpoint: https://nsx-manager - username: admin - password: password - timeout: 60s - settings: - nsx.node.cpu.utilization: - enabled: false - logs: - listen_address: 0.0.0.0:5120 + endpoint: https://nsx-manager + username: admin + password: password + timeout: 60s + settings: + nsx.node.cpu.utilization: + enabled: false exporters: file: @@ -79,7 +76,7 @@ Logging is ingested via syslog forwarding from the NSX. This [document](https:// ### Logging Prerequisites -This component wraps the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) as the engine for ingesting these forwarded syslogs. Currently this receiver only supports these protocols: +This technology should use the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) as the engine for ingesting these forwarded syslogs. Currently this receiver only supports these protocols: - udp - tcp @@ -87,15 +84,14 @@ This component wraps the [syslogreceiver](https://github.com/open-telemetry/open So please be sure to pick the same format on both configuration of the collector and the forwarder. -Almost all configuration options are identical as the [syslogreceiver configuration options](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver#configuration). +All configuration options can be found here the [syslogreceiver configuration options](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver#configuration). ### Example Logging Configuration ```yaml receivers: - nsx: - logging: - udp: - listen_address: 0.0.0.0:5142 - protocol: rfc5424 + syslog: + udp: + listen_address: 0.0.0.0:5142 + protocol: rfc5424 ``` diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go index 78fa0c774384..5ba4c08cd3d5 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxreceiver/client.go @@ -52,12 +52,12 @@ var ( ) func newClient(c *Config, settings component.TelemetrySettings, host component.Host, logger *zap.Logger) (*nsxClient, error) { - client, err := c.MetricsConfig.HTTPClientSettings.ToClient(host.GetExtensions(), settings) + client, err := c.HTTPClientSettings.ToClient(host.GetExtensions(), settings) if err != nil { return nil, err } - endpoint, err := url.Parse(c.MetricsConfig.Endpoint) + endpoint, err := url.Parse(c.Endpoint) if err != nil { return nil, err } @@ -182,7 +182,7 @@ func (c *nsxClient) doRequest(ctx context.Context, path string, options ...reque if err != nil { return nil, err } - req.SetBasicAuth(c.config.MetricsConfig.Username, c.config.MetricsConfig.Password) + req.SetBasicAuth(c.config.Username, c.config.Password) for _, op := range options { req = op(req) diff --git a/receiver/nsxreceiver/client_test.go b/receiver/nsxreceiver/client_test.go index 651c4e30de31..6ce421ce67d1 100644 --- a/receiver/nsxreceiver/client_test.go +++ b/receiver/nsxreceiver/client_test.go @@ -38,10 +38,8 @@ const ( func TestNewClientFailureToParse(t *testing.T) { _, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "http://\x00", - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://\x00", }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.Error(t, err) @@ -50,10 +48,8 @@ func TestNewClientFailureToParse(t *testing.T) { func TestTransportNodes(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -65,10 +61,8 @@ func TestTransportNodes(t *testing.T) { func TestClusterNodes(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -80,10 +74,8 @@ func TestClusterNodes(t *testing.T) { func TestClusterNodeInterface(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -95,10 +87,8 @@ func TestClusterNodeInterface(t *testing.T) { func TestTransportNodeInterface(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -110,10 +100,8 @@ func TestTransportNodeInterface(t *testing.T) { func TestTransportNodeStatus(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -125,10 +113,8 @@ func TestTransportNodeStatus(t *testing.T) { func TestClusterNodeStatus(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -140,10 +126,8 @@ func TestClusterNodeStatus(t *testing.T) { func TestTransportNodeInterfaceStatus(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -155,10 +139,8 @@ func TestTransportNodeInterfaceStatus(t *testing.T) { func TestManagerNodeInterfaceStatus(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -170,10 +152,8 @@ func TestManagerNodeInterfaceStatus(t *testing.T) { func TestDoRequestBadUrl(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -185,11 +165,9 @@ func TestDoRequestBadUrl(t *testing.T) { func TestPermissionDenied_ClusterNodes(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - Password: badPassword, - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -201,11 +179,9 @@ func TestPermissionDenied_ClusterNodes(t *testing.T) { func TestPermissionDenied_Interfaces(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - Password: badPassword, - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -217,11 +193,9 @@ func TestPermissionDenied_Interfaces(t *testing.T) { func TestPermissionDenied_InterfaceStatus(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - Password: badPassword, - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -233,11 +207,9 @@ func TestPermissionDenied_InterfaceStatus(t *testing.T) { func TestPermissionDenied_NodeStatus(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - Password: badPassword, - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -249,11 +221,9 @@ func TestPermissionDenied_NodeStatus(t *testing.T) { func TestPermissionDenied_TransportNodes(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - Password: badPassword, - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + Password: badPassword, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) @@ -265,11 +235,9 @@ func TestPermissionDenied_TransportNodes(t *testing.T) { func TestInternalServerError(t *testing.T) { nsxMock := mockServer(t) client, err := newClient(&Config{ - MetricsConfig: &MetricsConfig{ - Username: user500, - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: nsxMock.URL, - }, + Username: user500, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: nsxMock.URL, }, }, componenttest.NewNopTelemetrySettings(), componenttest.NewNopHost(), zap.NewNop()) require.NoError(t, err) diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index 0ad2065ada98..165bf96f82be 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -25,50 +25,28 @@ import ( "go.uber.org/multierr" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver" ) // Config is the configuration for the NSX receiver type Config struct { - config.ReceiverSettings `mapstructure:",squash"` - MetricsConfig *MetricsConfig `mapstructure:"metrics"` - LoggingConfig *LoggingConfig `mapstructure:"logs"` -} - -// MetricsConfig is the metrics configuration portion of the nsxreceiver -type MetricsConfig struct { + config.ReceiverSettings `mapstructure:",squash"` scraperhelper.ScraperControllerSettings `mapstructure:",squash"` confighttp.HTTPClientSettings `mapstructure:",squash"` - Settings metadata.MetricsSettings `mapstructure:"settings"` + Metrics metadata.MetricsSettings `mapstructure:"metrics"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` } -// LoggingConfig is the configuration of a syslog receiver -type LoggingConfig struct { - *syslogreceiver.SysLogConfig `mapstructure:",squash"` -} - // Validate returns if the NSX configuration is valid func (c *Config) Validate() error { - return multierr.Combine( - c.validateMetrics(), - c.validateLogs(), - ) -} - -func (c *Config) validateMetrics() error { - mc := c.MetricsConfig - // do not require the configuration validation to specify metrics if not needed - // creating a default config by default creates a non-nil metrics config - if mc == nil || mc.Endpoint == "" { - return nil + var err error + if c.Endpoint == "" { + err = multierr.Append(err, errors.New("no manager endpoint was specified")) } - var err error - res, err := url.Parse(mc.Endpoint) + res, err := url.Parse(c.Endpoint) if err != nil { - err = multierr.Append(err, fmt.Errorf("unable to parse url %s: %w", c.MetricsConfig.Endpoint, err)) + err = multierr.Append(err, fmt.Errorf("unable to parse url %s: %w", c.Endpoint, err)) return err } @@ -76,24 +54,12 @@ func (c *Config) validateMetrics() error { err = multierr.Append(err, errors.New("url scheme must be http or https")) } - if mc.Username == "" { + if c.Username == "" { err = multierr.Append(err, errors.New("username not provided and is required")) } - if mc.Password == "" { + if c.Password == "" { err = multierr.Append(err, errors.New("password not provided and is required")) } return err } - -func (c *Config) validateLogs() error { - if c.LoggingConfig != nil { - return c.LoggingConfig.Validate() - } - return nil -} - -// ID returns the underlying MetricsConfig's ID -func (c *Config) ID() config.ComponentID { - return c.MetricsConfig.ID() -} diff --git a/receiver/nsxreceiver/config_test.go b/receiver/nsxreceiver/config_test.go index 9ba7cf5b41b1..b67b39c69854 100644 --- a/receiver/nsxreceiver/config_test.go +++ b/receiver/nsxreceiver/config_test.go @@ -22,11 +22,6 @@ import ( "go.opentelemetry.io/collector/config/confighttp" ) -func TestID(t *testing.T) { - config := createDefaultConfig() - require.NotEmpty(t, config.ID()) -} - func TestMetricValidation(t *testing.T) { defaultConfig := createDefaultConfig().(*Config) cases := []struct { @@ -35,16 +30,15 @@ func TestMetricValidation(t *testing.T) { expectedError error }{ { - desc: "default config", - cfg: defaultConfig, + desc: "default config", + cfg: defaultConfig, + expectedError: errors.New("url scheme must be http or https"), }, { desc: "not valid scheme", cfg: &Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "wss://not-supported-websockets", - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "wss://not-supported-websockets", }, }, expectedError: errors.New("url scheme must be http or https"), @@ -52,10 +46,8 @@ func TestMetricValidation(t *testing.T) { { desc: "unparseable url", cfg: &Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "\x00", - }, + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "\x00", }, }, expectedError: errors.New("parse"), @@ -63,11 +55,9 @@ func TestMetricValidation(t *testing.T) { { desc: "username not provided", cfg: &Config{ - MetricsConfig: &MetricsConfig{ - Password: "password", - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "http://localhost", - }, + Password: "password", + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://localhost", }, }, expectedError: errors.New("username not provided"), @@ -75,22 +65,22 @@ func TestMetricValidation(t *testing.T) { { desc: "password not provided", cfg: &Config{ - MetricsConfig: &MetricsConfig{ - Username: "otelu", - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "http://localhost", - }, + Username: "otelu", + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://localhost", }, }, expectedError: errors.New("password not provided"), }, } for _, tc := range cases { - err := tc.cfg.Validate() - if tc.expectedError != nil { - require.ErrorContains(t, err, tc.expectedError.Error()) - } else { - require.NoError(t, err) - } + t.Run(tc.desc, func(t *testing.T) { + err := tc.cfg.Validate() + if tc.expectedError != nil { + require.ErrorContains(t, err, tc.expectedError.Error()) + } else { + require.NoError(t, err) + } + }) } } diff --git a/receiver/nsxreceiver/factory.go b/receiver/nsxreceiver/factory.go index b8126e548ba9..330be50f1059 100644 --- a/receiver/nsxreceiver/factory.go +++ b/receiver/nsxreceiver/factory.go @@ -24,64 +24,33 @@ import ( "go.opentelemetry.io/collector/receiver/scraperhelper" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver" ) const typeStr = "nsx" var errConfigNotNSX = errors.New("config was not a NSX receiver config") -type nsxReceiverFactory struct { - receivers map[*Config]*nsxReceiver -} - // NewFactory creates a new receiver factory func NewFactory() component.ReceiverFactory { - f := &nsxReceiverFactory{ - receivers: make(map[*Config]*nsxReceiver, 1), - } return component.NewReceiverFactory( typeStr, createDefaultConfig, - component.WithMetricsReceiver(f.createMetricsReceiver), - component.WithLogsReceiver(f.createLogsReceiver), + component.WithMetricsReceiver(createMetricsReceiver), ) } func createDefaultConfig() config.Receiver { - syslogConfig := syslogreceiver.NewFactory().CreateDefaultConfig() - sConf := syslogConfig.(*syslogreceiver.SysLogConfig) return &Config{ - MetricsConfig: &MetricsConfig{ - ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(typeStr), - Settings: metadata.DefaultMetricsSettings(), - }, - LoggingConfig: &LoggingConfig{ - SysLogConfig: sConf, - }, - } -} - -func (f *nsxReceiverFactory) ensureReceiver(params component.ReceiverCreateSettings, config config.Receiver) *nsxReceiver { - receiver := f.receivers[config.(*Config)] - if receiver != nil { - return receiver - } - rconfig := config.(*Config) - receiver = &nsxReceiver{ - logger: params.Logger, - config: rconfig, + ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(typeStr), + Metrics: metadata.DefaultMetricsSettings(), } - f.receivers[config.(*Config)] = receiver - return receiver } -func (f *nsxReceiverFactory) createMetricsReceiver(ctx context.Context, params component.ReceiverCreateSettings, rConf config.Receiver, consumer consumer.Metrics) (component.MetricsReceiver, error) { +func createMetricsReceiver(ctx context.Context, params component.ReceiverCreateSettings, rConf config.Receiver, consumer consumer.Metrics) (component.MetricsReceiver, error) { cfg, ok := rConf.(*Config) if !ok { return nil, errConfigNotNSX } - r := f.ensureReceiver(params, cfg) s := newScraper(cfg, params.TelemetrySettings) scraper, err := scraperhelper.NewScraper( @@ -93,28 +62,10 @@ func (f *nsxReceiverFactory) createMetricsReceiver(ctx context.Context, params c return nil, err } - scraperController, err := scraperhelper.NewScraperControllerReceiver( - &cfg.MetricsConfig.ScraperControllerSettings, + return scraperhelper.NewScraperControllerReceiver( + &cfg.ScraperControllerSettings, params, consumer, scraperhelper.AddScraper(scraper), ) - - r.scraper = scraperController - return r, err -} - -func (f *nsxReceiverFactory) createLogsReceiver( - c context.Context, - params component.ReceiverCreateSettings, - rConf config.Receiver, - consumer consumer.Logs, -) (component.LogsReceiver, error) { - cfg, ok := rConf.(*Config) - if !ok { - return nil, errConfigNotNSX - } - rcvr := f.ensureReceiver(params, cfg) - rcvr.logsReceiver = newLogsReceiver(cfg, params, consumer) - return rcvr, nil } diff --git a/receiver/nsxreceiver/factory_test.go b/receiver/nsxreceiver/factory_test.go index 0d4475902bcb..2e3c4b1fcd52 100644 --- a/receiver/nsxreceiver/factory_test.go +++ b/receiver/nsxreceiver/factory_test.go @@ -33,10 +33,12 @@ func TestType(t *testing.T) { require.EqualValues(t, "nsx", ft) } -func TestValidConfig(t *testing.T) { +func TestDefaultConfig(t *testing.T) { factory := NewFactory() err := factory.CreateDefaultConfig().Validate() - require.NoError(t, err) + // default does not supply username/password or endpoint + require.ErrorContains(t, err, "username not provided") + require.ErrorContains(t, err, "password not provided") } func TestCreateMetricsReceiver(t *testing.T) { @@ -45,10 +47,8 @@ func TestCreateMetricsReceiver(t *testing.T) { context.Background(), componenttest.NewNopReceiverCreateSettings(), &Config{ - MetricsConfig: &MetricsConfig{ - ScraperControllerSettings: scraperhelper.ScraperControllerSettings{ - CollectionInterval: 10 * time.Second, - }, + ScraperControllerSettings: scraperhelper.ScraperControllerSettings{ + CollectionInterval: 10 * time.Second, }, }, consumertest.NewNop(), @@ -67,15 +67,3 @@ func TestCreateMetricsReceiverNotNSX(t *testing.T) { require.Error(t, err) require.ErrorContains(t, err, errConfigNotNSX.Error()) } - -func TestCreateLogsReceiverNotNSX(t *testing.T) { - factory := NewFactory() - _, err := factory.CreateLogsReceiver( - context.Background(), - componenttest.NewNopReceiverCreateSettings(), - &syslogreceiver.SysLogConfig{}, - consumertest.NewNop(), - ) - require.Error(t, err) - require.ErrorContains(t, err, errConfigNotNSX.Error()) -} diff --git a/receiver/nsxreceiver/logs.go b/receiver/nsxreceiver/logs.go deleted file mode 100644 index 1151e16ae147..000000000000 --- a/receiver/nsxreceiver/logs.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package nsxreceiver - -import ( - "context" - "fmt" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" -) - -var _ component.Receiver = (*nsxLogsReceiver)(nil) - -type nsxLogsReceiver struct { - cfg *Config - params component.ReceiverCreateSettings - consumer consumer.Logs - syslogReceiver component.LogsReceiver -} - -func newLogsReceiver(c *Config, params component.ReceiverCreateSettings, consumer consumer.Logs) *nsxLogsReceiver { - return &nsxLogsReceiver{ - cfg: c, - params: params, - consumer: consumer, - } -} - -func (lr *nsxLogsReceiver) Start(ctx context.Context, h component.Host) error { - f := h.GetFactory(component.KindReceiver, "syslog") - rf, ok := f.(component.ReceiverFactory) - if !ok { - return fmt.Errorf("unable to wrap the syslog receiver that the %s component wraps", typeStr) - } - syslog, err := rf.CreateLogsReceiver(ctx, lr.params, lr.cfg.LoggingConfig.SysLogConfig, lr.consumer) - if err != nil { - return fmt.Errorf("unable to start the wrapped syslogreceiver: %w", err) - } - lr.syslogReceiver = syslog - return lr.syslogReceiver.Start(ctx, h) -} - -func (lr *nsxLogsReceiver) Shutdown(ctx context.Context) error { - if lr.syslogReceiver != nil { - return lr.syslogReceiver.Shutdown(ctx) - } - return nil -} diff --git a/receiver/nsxreceiver/receiver.go b/receiver/nsxreceiver/receiver.go deleted file mode 100644 index 4a95162b959b..000000000000 --- a/receiver/nsxreceiver/receiver.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package nsxreceiver - -import ( - "context" - "fmt" - - "go.opentelemetry.io/collector/component" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -var _ component.Receiver = (*nsxReceiver)(nil) - -type nsxReceiver struct { - config *Config - logger *zap.Logger - scraper component.Receiver - logsReceiver component.Receiver -} - -func (n *nsxReceiver) Start(ctx context.Context, host component.Host) error { - var err error - if n.scraper != nil && n.config.MetricsConfig.Endpoint != "" { - if scraperErr := n.scraper.Start(ctx, host); scraperErr != nil { - // Start should not stop the collector if the metrics client connection attempt does not succeed, - // so we log on start when we cannot connect - n.logger.Error(fmt.Sprintf("unable to initially start connecting to the NSX API: %s", scraperErr.Error())) - } - } - - if n.logsReceiver != nil { - // if syslogreceiver is not bundled and logging is in the pipeline for NSX, we probably want to not start the collector - if startErr := n.logsReceiver.Start(ctx, host); startErr != nil { - err = multierr.Append(err, startErr) - } - } - return err -} - -// Shutdown calls appropriate shutdowns for the NSX receiver -func (n *nsxReceiver) Shutdown(ctx context.Context) error { - var err error - if n.scraper != nil { - if scraperErr := n.scraper.Shutdown(ctx); scraperErr != nil { - err = multierr.Append(err, scraperErr) - } - } - if n.logsReceiver != nil { - if logsErr := n.logsReceiver.Shutdown(ctx); logsErr != nil { - err = multierr.Append(err, logsErr) - } - } - return err -} diff --git a/receiver/nsxreceiver/receiver_test.go b/receiver/nsxreceiver/receiver_test.go deleted file mode 100644 index 659e1be18d71..000000000000 --- a/receiver/nsxreceiver/receiver_test.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package nsxreceiver - -import ( - "context" - "errors" - "testing" - - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config/confighttp" - "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/receiver/scraperhelper" -) - -type receiverOps func(t *testing.T, rcvr *nsxReceiver) - -func TestStart(t *testing.T) { - defaultConfig := createDefaultConfig().(*Config) - cases := []struct { - desc string - config *Config - ops []receiverOps - expectedError error - }{ - { - desc: "default", - config: defaultConfig, - }, - { - desc: "metrics config", - config: &Config{ - MetricsConfig: &MetricsConfig{ - ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(defaultConfig.ID().Type()), - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "https://localhost/", - }, - }, - }, - ops: []receiverOps{metricFactoryCreation}, - }, - { - desc: "metrics config failure via control character", - config: &Config{ - MetricsConfig: &MetricsConfig{ - ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(defaultConfig.ID().Type()), - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: string([]byte{0x7f}), - }, - }, - }, - ops: []receiverOps{metricFactoryCreation}, - }, - { - desc: "metrics config failure via control character, should not fail ", - config: &Config{ - MetricsConfig: &MetricsConfig{ - ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(defaultConfig.ID().Type()), - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: string([]byte{0x7f}), - }, - }, - }, - ops: []receiverOps{metricFactoryCreation}, - }, - { - desc: "syslogreceiver not packaged", - config: &Config{ - MetricsConfig: defaultConfig.MetricsConfig, - LoggingConfig: defaultConfig.LoggingConfig, - }, - ops: []receiverOps{loggingFactoryCreation}, - expectedError: errors.New("unable to wrap the syslog receiver"), - }, - } - - for _, tc := range cases { - t.Run(tc.desc, func(t *testing.T) { - rcvr := &nsxReceiver{ - config: tc.config, - } - - for _, op := range tc.ops { - op(t, rcvr) - } - - err := rcvr.Start(context.Background(), componenttest.NewNopHost()) - if tc.expectedError != nil { - require.ErrorContains(t, err, tc.expectedError.Error()) - } else { - require.NoError(t, err) - } - }) - } -} - -var metricFactoryCreation = func(t *testing.T, rcvr *nsxReceiver) { - factory := &nsxReceiverFactory{ - receivers: map[*Config]*nsxReceiver{}, - } - sink := &consumertest.MetricsSink{} - mr, err := factory.createMetricsReceiver(context.Background(), componenttest.NewNopReceiverCreateSettings(), rcvr.config, sink) - require.NoError(t, err) - rcvr.scraper = mr -} - -var loggingFactoryCreation = func(t *testing.T, rcvr *nsxReceiver) { - factory := &nsxReceiverFactory{ - receivers: map[*Config]*nsxReceiver{}, - } - sink := &consumertest.LogsSink{} - lr, err := factory.createLogsReceiver(context.Background(), componenttest.NewNopReceiverCreateSettings(), rcvr.config, sink) - require.NoError(t, err) - rcvr.logsReceiver = lr -} - -func TestShutdown(t *testing.T) { - defaultConfig := createDefaultConfig().(*Config) - cases := []struct { - desc string - config *Config - ops []receiverOps - expectedError error - }{ - { - desc: "default", - config: defaultConfig, - }, - { - desc: "with metrics receiver", - config: defaultConfig, - ops: []receiverOps{metricFactoryCreation}, - }, - { - desc: "with logging receiver", - config: defaultConfig, - ops: []receiverOps{loggingFactoryCreation}, - }, - } - - for _, tc := range cases { - t.Run(tc.desc, func(t *testing.T) { - rcvr := &nsxReceiver{ - config: tc.config, - } - for _, op := range tc.ops { - op(t, rcvr) - } - _ = rcvr.Start(context.Background(), componenttest.NewNopHost()) - err := rcvr.Shutdown(context.Background()) - if tc.expectedError != nil { - require.ErrorContains(t, err, tc.expectedError.Error()) - } else { - require.NoError(t, err) - } - }) - } -} diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index 017f027d0bae..c688276c624e 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -43,7 +43,7 @@ func newScraper(cfg *Config, settings component.TelemetrySettings) *scraper { return &scraper{ config: cfg, settings: settings, - mb: metadata.NewMetricsBuilder(cfg.MetricsConfig.Settings), + mb: metadata.NewMetricsBuilder(cfg.Metrics), logger: settings.Logger, } } diff --git a/receiver/nsxreceiver/scraper_test.go b/receiver/nsxreceiver/scraper_test.go index 3e353e18ae9d..6afe018da385 100644 --- a/receiver/nsxreceiver/scraper_test.go +++ b/receiver/nsxreceiver/scraper_test.go @@ -58,7 +58,7 @@ func TestScrape(t *testing.T) { scraper := newScraper( &Config{ - MetricsConfig: &MetricsConfig{Settings: metadata.DefaultMetricsSettings()}, + Metrics: metadata.DefaultMetricsSettings(), }, componenttest.NewNopTelemetrySettings(), ) @@ -77,12 +77,10 @@ func TestScrape(t *testing.T) { func TestScrapeBadConfig(t *testing.T) { scraper := newScraper( &Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "http://\x00", - }, - Settings: metadata.DefaultMetricsSettings(), + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://\x00", }, + Metrics: metadata.DefaultMetricsSettings(), }, componenttest.NewNopTelemetrySettings(), ) @@ -98,7 +96,7 @@ func TestScrapeTransportNodeErrors(t *testing.T) { mockClient.On("TransportNodes", mock.Anything).Return(nil, errUnauthorized) scraper := newScraper( &Config{ - MetricsConfig: &MetricsConfig{Settings: metadata.DefaultMetricsSettings()}, + Metrics: metadata.DefaultMetricsSettings(), }, componenttest.NewNopTelemetrySettings(), ) @@ -116,7 +114,7 @@ func TestScrapeClusterNodeErrors(t *testing.T) { mockClient.On("TransportNodes", mock.Anything).Return(loadTestTransportNodes()) scraper := newScraper( &Config{ - MetricsConfig: &MetricsConfig{Settings: metadata.DefaultMetricsSettings()}, + Metrics: metadata.DefaultMetricsSettings(), }, componenttest.NewNopTelemetrySettings(), ) @@ -130,12 +128,10 @@ func TestScrapeClusterNodeErrors(t *testing.T) { func TestScraperRecordNoStat(t *testing.T) { scraper := newScraper( &Config{ - MetricsConfig: &MetricsConfig{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "http://localhost", - }, - Settings: metadata.DefaultMetricsSettings(), + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "http://localhost", }, + Metrics: metadata.DefaultMetricsSettings(), }, componenttest.NewNopTelemetrySettings(), ) From 9eea7f305539982ccb1969a559823a366698b8b1 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 13:01:05 -0400 Subject: [PATCH 19/48] add more test coverage --- receiver/nsxreceiver/scraper.go | 4 +++- receiver/nsxreceiver/scraper_test.go | 30 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index c688276c624e..22aa6fd346b4 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -16,6 +16,7 @@ package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector import ( "context" + "fmt" "math" "sync" "time" @@ -51,8 +52,9 @@ func newScraper(cfg *Config, settings component.TelemetrySettings) *scraper { func (s *scraper) start(ctx context.Context, host component.Host) error { s.host = host err := s.ensureClient() + // allow reconnectivity if err != nil { - return err + return fmt.Errorf("unable to ensure client connectivity: %s", err) } return nil } diff --git a/receiver/nsxreceiver/scraper_test.go b/receiver/nsxreceiver/scraper_test.go index 6afe018da385..ea958c122e7b 100644 --- a/receiver/nsxreceiver/scraper_test.go +++ b/receiver/nsxreceiver/scraper_test.go @@ -125,6 +125,36 @@ func TestScrapeClusterNodeErrors(t *testing.T) { require.ErrorContains(t, err, errUnauthorized.Error()) } +func TestStartClientAlreadySet(t *testing.T) { + mockClient := mockServer(t) + scraper := newScraper( + &Config{ + Metrics: metadata.DefaultMetricsSettings(), + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: mockClient.URL, + }, + }, + componenttest.NewNopTelemetrySettings(), + ) + _ = scraper.start(context.Background(), componenttest.NewNopHost()) + require.NotNil(t, scraper.client) +} + +func TestStartBadUrl(t *testing.T) { + scraper := newScraper( + &Config{ + Metrics: metadata.DefaultMetricsSettings(), + HTTPClientSettings: confighttp.HTTPClientSettings{ + Endpoint: "\x00", + }, + }, + componenttest.NewNopTelemetrySettings(), + ) + + _ = scraper.start(context.Background(), componenttest.NewNopHost()) + require.Nil(t, scraper.client) +} + func TestScraperRecordNoStat(t *testing.T) { scraper := newScraper( &Config{ From 80804d40077cc64cfe7d6fbc838cbb2c98bd374b Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 13:45:49 -0400 Subject: [PATCH 20/48] update changelog --- CHANGELOG.md | 1 + receiver/nsxreceiver/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e1b95d64a56..63ffbb2edc93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - `schemaprocessor`: Starting the initial work to allow from translating from semantic convention to another (#8371) - `saphanareceiver`: Added implementation of SAP HANA Metric Receiver (#8827) +- `nsxreceiver`: Added implementation of SAP HANA Metric Receiver (#9568) ### 💡 Enhancements 💡 diff --git a/receiver/nsxreceiver/README.md b/receiver/nsxreceiver/README.md index 4f6d71310407..62ce0ef8672c 100644 --- a/receiver/nsxreceiver/README.md +++ b/receiver/nsxreceiver/README.md @@ -12,7 +12,7 @@ The purpose of this receiver is to allow users to monitor metrics from NSX-T env ## Prerequisites -Needs a “Network Admin” user for NSX Manager Resources in the vSphere Client (can be created via Web UI or CLI) +Needs at least an “Auditor” user for NSX Manager Resources in the vSphere Client (can be created via Web UI or CLI) The collector must be able to reach the NSX Manager with port 443 open. From d57a98a65d9e362bb07a6278067470a484a4f046 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 14:07:20 -0400 Subject: [PATCH 21/48] add to receivers_test --- cmd/otelcontribcol/content.json | 0 internal/components/receivers_test.go | 3 +++ receiver/nsxreceiver/config.go | 2 -- receiver/nsxreceiver/factory.go | 8 ++++++-- 4 files changed, 9 insertions(+), 4 deletions(-) delete mode 100644 cmd/otelcontribcol/content.json diff --git a/cmd/otelcontribcol/content.json b/cmd/otelcontribcol/content.json deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/internal/components/receivers_test.go b/internal/components/receivers_test.go index 82a9aeb346a0..d464567a49f8 100644 --- a/internal/components/receivers_test.go +++ b/internal/components/receivers_test.go @@ -165,6 +165,9 @@ func TestDefaultReceivers(t *testing.T) { { receiver: "nginx", }, + { + receiver: "nsx", + }, { receiver: "opencensus", skipLifecyle: true, // TODO: Usage of CMux doesn't allow proper shutdown. diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index 165bf96f82be..adf78935b178 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -19,7 +19,6 @@ import ( "fmt" "net/url" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/receiver/scraperhelper" "go.uber.org/multierr" @@ -29,7 +28,6 @@ import ( // Config is the configuration for the NSX receiver type Config struct { - config.ReceiverSettings `mapstructure:",squash"` scraperhelper.ScraperControllerSettings `mapstructure:",squash"` confighttp.HTTPClientSettings `mapstructure:",squash"` Metrics metadata.MetricsSettings `mapstructure:"metrics"` diff --git a/receiver/nsxreceiver/factory.go b/receiver/nsxreceiver/factory.go index 330be50f1059..95a37b5b7b39 100644 --- a/receiver/nsxreceiver/factory.go +++ b/receiver/nsxreceiver/factory.go @@ -17,6 +17,7 @@ package nsxreceiver import ( "context" "errors" + "time" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" @@ -41,8 +42,11 @@ func NewFactory() component.ReceiverFactory { func createDefaultConfig() config.Receiver { return &Config{ - ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(typeStr), - Metrics: metadata.DefaultMetricsSettings(), + ScraperControllerSettings: scraperhelper.ScraperControllerSettings{ + ReceiverSettings: config.NewReceiverSettings(config.NewComponentID(typeStr)), + CollectionInterval: time.Minute, + }, + Metrics: metadata.DefaultMetricsSettings(), } } From 1f0c246b66d7b8c8e643e0d227644a51e0600cc6 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 14:22:35 -0400 Subject: [PATCH 22/48] fix semconv replace (no longer needed) --- receiver/nsxreceiver/go.mod | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/receiver/nsxreceiver/go.mod b/receiver/nsxreceiver/go.mod index d97b2d524431..b656d6162302 100644 --- a/receiver/nsxreceiver/go.mod +++ b/receiver/nsxreceiver/go.mod @@ -31,7 +31,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/klauspost/compress v1.15.1 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.0.0-00010101000000-000000000000 github.com/rs/cors v1.8.2 // indirect github.com/stretchr/testify v1.7.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 // indirect @@ -52,6 +51,7 @@ require ( github.com/observiq/ctimefmt v1.0.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-collector-contrib/internal/stanza v0.50.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-log-collection v0.29.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.3.0 // indirect @@ -65,5 +65,3 @@ require ( replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest => ../../internal/scrapertest replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver => ../syslogreceiver - -replace go.opentelemetry.io/collector/semconv => go.opentelemetry.io/collector/semconv v0.0.0-20220422001137-87ab5de64ce4 From 4e7c5b3f3f068bcd7df2ad6dc23cba8e56a9fde3 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 14:39:05 -0400 Subject: [PATCH 23/48] add to codeowners and fix import check --- .github/CODEOWNERS | 1 + receiver/nsxreceiver/client.go | 2 +- receiver/nsxreceiver/client_mock_test.go | 2 +- receiver/nsxreceiver/client_test.go | 2 +- receiver/nsxreceiver/config.go | 2 +- receiver/nsxreceiver/config_test.go | 2 +- receiver/nsxreceiver/doc.go | 2 +- receiver/nsxreceiver/factory.go | 2 +- receiver/nsxreceiver/factory_test.go | 2 +- receiver/nsxreceiver/internal/model/node.go | 47 --------------------- receiver/nsxreceiver/scraper_test.go | 2 +- receiver/nsxreceiver/testdata/config.yaml | 13 +++--- 12 files changed, 16 insertions(+), 63 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 18c345c5a952..79b499ceeb59 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -140,6 +140,7 @@ receiver/mongodbreceiver/ @open-telemetry/collector-c receiver/mongodbatlasreceiver/ @open-telemetry/collector-contrib-approvers @zenmoto receiver/mysqlreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski receiver/nginxreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski +receiver/nsxreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @schmikei receiver/postgresqlreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski receiver/prometheusexecreceiver/ @open-telemetry/collector-contrib-approvers @dmitryax receiver/prometheusreceiver/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @dashpole diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxreceiver/client.go index 5ba4c08cd3d5..46f6c96493a4 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxreceiver/client.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "context" diff --git a/receiver/nsxreceiver/client_mock_test.go b/receiver/nsxreceiver/client_mock_test.go index 6abf7b6a23e3..d8f52329c72e 100644 --- a/receiver/nsxreceiver/client_mock_test.go +++ b/receiver/nsxreceiver/client_mock_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( context "context" diff --git a/receiver/nsxreceiver/client_test.go b/receiver/nsxreceiver/client_test.go index 6ce421ce67d1..0ddf37e9b2ff 100644 --- a/receiver/nsxreceiver/client_test.go +++ b/receiver/nsxreceiver/client_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "context" diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index adf78935b178..79a0019ffe15 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "errors" diff --git a/receiver/nsxreceiver/config_test.go b/receiver/nsxreceiver/config_test.go index b67b39c69854..3f57c3739e56 100644 --- a/receiver/nsxreceiver/config_test.go +++ b/receiver/nsxreceiver/config_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "errors" diff --git a/receiver/nsxreceiver/doc.go b/receiver/nsxreceiver/doc.go index 3448ca9dc4d3..240d02acf25a 100644 --- a/receiver/nsxreceiver/doc.go +++ b/receiver/nsxreceiver/doc.go @@ -14,4 +14,4 @@ //go:generate mdatagen --experimental-gen metadata.yaml -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" diff --git a/receiver/nsxreceiver/factory.go b/receiver/nsxreceiver/factory.go index 95a37b5b7b39..623a923de698 100644 --- a/receiver/nsxreceiver/factory.go +++ b/receiver/nsxreceiver/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "context" diff --git a/receiver/nsxreceiver/factory_test.go b/receiver/nsxreceiver/factory_test.go index 2e3c4b1fcd52..d1626eb062b5 100644 --- a/receiver/nsxreceiver/factory_test.go +++ b/receiver/nsxreceiver/factory_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "context" diff --git a/receiver/nsxreceiver/internal/model/node.go b/receiver/nsxreceiver/internal/model/node.go index fc266df92587..ad04de76ed87 100644 --- a/receiver/nsxreceiver/internal/model/node.go +++ b/receiver/nsxreceiver/internal/model/node.go @@ -111,50 +111,3 @@ type NodeStatus struct { type TransportNodeStatus struct { NodeStatus NodeStatus `mapstructure:"node_status" json:"node_status"` } - -// SystemStatus is the system status portion of a node's status response -type SystemStatus struct { - CPUCores int `json:"cpu_cores"` - DpdkCPUCores int `json:"dpdk_cpu_cores"` - NonDpdkCPUCores int `json:"non_dpdk_cpu_cores"` - DiskSpaceTotal int `json:"disk_space_total"` - DiskSpaceUsed int `json:"disk_space_used"` - FileSystems []FileSystemsUsage `json:"file_systems"` - LoadAverage []float64 `json:"load_average"` - CPUUsage NodeSystemCPUUsage `json:"cpu_usage"` - EdgeMemUsage MemSystemUsage `json:"edge_mem_usage"` - MemCache int `json:"mem_cache"` - MemTotal int `json:"mem_total"` - MemUsed int `json:"mem_used"` - Source string `json:"source"` - SwapTotal int `json:"swap_total"` - SwapUsed int `json:"swap_used"` - SystemTime int64 `json:"system_time"` - Uptime int64 `json:"uptime"` -} - -// NodeSystemCPUUsage is a report of the CPU usage of the node -type NodeSystemCPUUsage struct { - HighestCPUCoreUsageDpdk float64 `json:"highest_cpu_core_usage_dpdk"` - AvgCPUCoreUsageDpdk float64 `json:"avg_cpu_core_usage_dpdk"` - HighestCPUCoreUsageNonDpdk float64 `json:"highest_cpu_core_usage_non_dpdk"` - AvgCPUCoreUsageNonDpdk float64 `json:"avg_cpu_core_usage_non_dpdk"` -} - -// FileSystemsUsage is a report of the storage used by the node -type FileSystemsUsage struct { - // Name of the filesystem - FileSystem string `json:"file_system"` - Mount string `json:"mount"` - Total int `json:"total"` - Type string `json:"type"` - Used int `json:"used"` -} - -// MemSystemUsage is a report of how the node is using its memory -type MemSystemUsage struct { - SystemMemUsage float64 `json:"system_mem_usage"` - SwapUsage float64 `json:"swap_usage"` - CacheUsage float64 `json:"cache_usage"` - DatapathTotalUsage float64 `json:"datapath_total_usage"` -} diff --git a/receiver/nsxreceiver/scraper_test.go b/receiver/nsxreceiver/scraper_test.go index ea958c122e7b..ffd8fa4535fa 100644 --- a/receiver/nsxreceiver/scraper_test.go +++ b/receiver/nsxreceiver/scraper_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver +package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "context" diff --git a/receiver/nsxreceiver/testdata/config.yaml b/receiver/nsxreceiver/testdata/config.yaml index a270ff8efc0b..398d50b5fd57 100644 --- a/receiver/nsxreceiver/testdata/config.yaml +++ b/receiver/nsxreceiver/testdata/config.yaml @@ -1,13 +1,12 @@ ### Metrics receivers: nsx: - metrics: - collection_interval: 1m - endpoint: https://nsx-manager-endpoint - username: admin - password: password123 - tls: - insecure: true + collection_interval: 1m + endpoint: https://nsx-manager-endpoint + username: admin + password: password123 + tls: + insecure: true exporters: file: From 509c430bc26188caa612660e5d3111cfbb29fc6d Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 14:45:33 -0400 Subject: [PATCH 24/48] make goporto --- receiver/nsxreceiver/internal/model/interface.go | 2 +- receiver/nsxreceiver/internal/model/node.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/receiver/nsxreceiver/internal/model/interface.go b/receiver/nsxreceiver/internal/model/interface.go index 51c15f8645ad..8baab56ce0a8 100644 --- a/receiver/nsxreceiver/internal/model/interface.go +++ b/receiver/nsxreceiver/internal/model/interface.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" +package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" import "github.com/vmware/go-vmware-nsxt/manager" // NodeNetworkInterfacePropertiesListResult wraps the results of a node's network interface diff --git a/receiver/nsxreceiver/internal/model/node.go b/receiver/nsxreceiver/internal/model/node.go index ad04de76ed87..9b6a33bc562d 100644 --- a/receiver/nsxreceiver/internal/model/node.go +++ b/receiver/nsxreceiver/internal/model/node.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxhreceiver/internal/model" +package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" // ClusterNodeList is a result struct from type ClusterNodeList struct { From f656b458205e7ad9ddf48c4cc3c3d4eec7ad750a Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 14:54:54 -0400 Subject: [PATCH 25/48] use newer mdatagen --- .../internal/metadata/generated_metrics_v2.go | 123 +++++++++++++----- receiver/nsxreceiver/scraper.go | 20 +-- 2 files changed, 98 insertions(+), 45 deletions(-) diff --git a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go index 9f9eac3dbcc3..f8bceb5ed519 100644 --- a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go @@ -55,6 +55,88 @@ func DefaultMetricsSettings() MetricsSettings { } } +// AttributeCPUProcessClass specifies the a value cpu.process.class attribute. +type AttributeCPUProcessClass int + +const ( + _ AttributeCPUProcessClass = iota + AttributeCPUProcessClassDatapath + AttributeCPUProcessClassServices +) + +// String returns the string representation of the AttributeCPUProcessClass. +func (av AttributeCPUProcessClass) String() string { + switch av { + case AttributeCPUProcessClassDatapath: + return "datapath" + case AttributeCPUProcessClassServices: + return "services" + } + return "" +} + +// MapAttributeCPUProcessClass is a helper map of string to AttributeCPUProcessClass attribute value. +var MapAttributeCPUProcessClass = map[string]AttributeCPUProcessClass{ + "datapath": AttributeCPUProcessClassDatapath, + "services": AttributeCPUProcessClassServices, +} + +// AttributeDirection specifies the a value direction attribute. +type AttributeDirection int + +const ( + _ AttributeDirection = iota + AttributeDirectionReceived + AttributeDirectionTransmitted +) + +// String returns the string representation of the AttributeDirection. +func (av AttributeDirection) String() string { + switch av { + case AttributeDirectionReceived: + return "received" + case AttributeDirectionTransmitted: + return "transmitted" + } + return "" +} + +// MapAttributeDirection is a helper map of string to AttributeDirection attribute value. +var MapAttributeDirection = map[string]AttributeDirection{ + "received": AttributeDirectionReceived, + "transmitted": AttributeDirectionTransmitted, +} + +// AttributePacketType specifies the a value packet.type attribute. +type AttributePacketType int + +const ( + _ AttributePacketType = iota + AttributePacketTypeDropped + AttributePacketTypeErrored + AttributePacketTypeSuccess +) + +// String returns the string representation of the AttributePacketType. +func (av AttributePacketType) String() string { + switch av { + case AttributePacketTypeDropped: + return "dropped" + case AttributePacketTypeErrored: + return "errored" + case AttributePacketTypeSuccess: + return "success" + } + return "" +} + +// MapAttributePacketType is a helper map of string to AttributePacketType attribute value. +var MapAttributePacketType = map[string]AttributePacketType{ + "dropped": AttributePacketTypeDropped, + "errored": AttributePacketTypeErrored, + "success": AttributePacketTypeSuccess, +} + type metricNsxInterfacePacketCount struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. @@ -595,13 +677,13 @@ func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics { } // RecordNsxInterfacePacketCountDataPoint adds a data point to nsx.interface.packet.count metric. -func (mb *MetricsBuilder) RecordNsxInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue string, packetTypeAttributeValue string) { - mb.metricNsxInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue, packetTypeAttributeValue) +func (mb *MetricsBuilder) RecordNsxInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection, packetTypeAttributeValue AttributePacketType) { + mb.metricNsxInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String(), packetTypeAttributeValue.String()) } // RecordNsxInterfaceThroughputDataPoint adds a data point to nsx.interface.throughput metric. -func (mb *MetricsBuilder) RecordNsxInterfaceThroughputDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue string) { - mb.metricNsxInterfaceThroughput.recordDataPoint(mb.startTime, ts, val, directionAttributeValue) +func (mb *MetricsBuilder) RecordNsxInterfaceThroughputDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection) { + mb.metricNsxInterfaceThroughput.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String()) } // RecordNsxNodeCacheMemoryUsageDataPoint adds a data point to nsx.node.cache.memory.usage metric. @@ -610,8 +692,8 @@ func (mb *MetricsBuilder) RecordNsxNodeCacheMemoryUsageDataPoint(ts pcommon.Time } // RecordNsxNodeCPUUtilizationDataPoint adds a data point to nsx.node.cpu.utilization metric. -func (mb *MetricsBuilder) RecordNsxNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { - mb.metricNsxNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue) +func (mb *MetricsBuilder) RecordNsxNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue AttributeCPUProcessClass) { + mb.metricNsxNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue.String()) } // RecordNsxNodeDiskUsageDataPoint adds a data point to nsx.node.disk.usage metric. @@ -665,32 +747,3 @@ var Attributes = struct { // A is an alias for Attributes. var A = Attributes - -// AttributeCPUProcessClass are the possible values that the attribute "cpu.process.class" can have. -var AttributeCPUProcessClass = struct { - Datapath string - Services string -}{ - "datapath", - "services", -} - -// AttributeDirection are the possible values that the attribute "direction" can have. -var AttributeDirection = struct { - Received string - Transmitted string -}{ - "received", - "transmitted", -} - -// AttributePacketType are the possible values that the attribute "packet.type" can have. -var AttributePacketType = struct { - Dropped string - Errored string - Success string -}{ - "dropped", - "errored", - "success", -} diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxreceiver/scraper.go index 22aa6fd346b4..05a55f3550bb 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxreceiver/scraper.go @@ -202,18 +202,18 @@ func (s *scraper) process( } func (s *scraper) recordNodeInterface(colTime pdata.Timestamp, nodeProps dm.NodeProperties, i interfaceInformation) { - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirection.Received, metadata.AttributePacketType.Dropped) - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirection.Received, metadata.AttributePacketType.Errored) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeDropped) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeErrored) successRxPackets := i.stats.RxPackets - i.stats.RxDropped - i.stats.RxErrors - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successRxPackets, metadata.AttributeDirection.Received, metadata.AttributePacketType.Success) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successRxPackets, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeSuccess) - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxDropped, metadata.AttributeDirection.Transmitted, metadata.AttributePacketType.Dropped) - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxErrors, metadata.AttributeDirection.Transmitted, metadata.AttributePacketType.Errored) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxDropped, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeDropped) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxErrors, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeErrored) successTxPackets := i.stats.TxPackets - i.stats.TxDropped - i.stats.TxErrors - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successTxPackets, metadata.AttributeDirection.Transmitted, metadata.AttributePacketType.Success) + s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successTxPackets, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeSuccess) - s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.RxBytes, metadata.AttributeDirection.Received) - s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.TxBytes, metadata.AttributeDirection.Transmitted) + s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.RxBytes, metadata.AttributeDirectionReceived) + s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.TxBytes, metadata.AttributeDirectionTransmitted) s.mb.EmitForResource( metadata.WithNsxInterfaceID(i.iFace.InterfaceId), @@ -230,8 +230,8 @@ func (s *scraper) recordNode( } ss := info.stats.SystemStatus - s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClass.Datapath) - s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClass.Services) + s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClassDatapath) + s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClassServices) s.mb.RecordNsxNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) if ss.EdgeMemUsage != nil { From 899aeef75391a05d506c6c342cc623ed33dfe32a Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 15:59:00 -0400 Subject: [PATCH 26/48] fix ineffectual assignment --- receiver/nsxreceiver/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxreceiver/config.go index 79a0019ffe15..0c9fe0561760 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxreceiver/config.go @@ -40,6 +40,7 @@ func (c *Config) Validate() error { var err error if c.Endpoint == "" { err = multierr.Append(err, errors.New("no manager endpoint was specified")) + return err } res, err := url.Parse(c.Endpoint) From 8738253d9c34e00fbe55c76a8d2eb55cbe754779 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 16:00:56 -0400 Subject: [PATCH 27/48] add to versions.yaml --- versions.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/versions.yaml b/versions.yaml index c7c76acf3190..d2327d221cdc 100644 --- a/versions.yaml +++ b/versions.yaml @@ -165,6 +165,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver + - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver From 63209b38b2c3f433e650d4d23f65fc7de734ba5d Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 16:20:17 -0400 Subject: [PATCH 28/48] some minor README updates and factory test update --- receiver/nsxreceiver/README.md | 6 +++--- receiver/nsxreceiver/factory_test.go | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/receiver/nsxreceiver/README.md b/receiver/nsxreceiver/README.md index 62ce0ef8672c..1df015869739 100644 --- a/receiver/nsxreceiver/README.md +++ b/receiver/nsxreceiver/README.md @@ -1,8 +1,8 @@ -# MongoDB Receiver +# NSX-T Receiver -This receiver fetches metrics important to run virtual networking using NSX-T. The receiver ingests metrics via the [NSX Rest API](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_api.pdf). As for logs, it wraps the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) which can be used to ingest NSX forwarded logs. +This receiver fetches metrics important to run virtual networking using NSX-T. The receiver ingests metrics via the [NSX Rest API](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_api.pdf). As for logs, it is encouraged to use the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) which can be used to ingest NSX forwarded logs. Please see [Logging-Configuration](#logging-configuration) for more information. -Supported pipeline types: `metrics` and `logs` +Supported pipeline types: `metrics` > :construction: This receiver is in **BETA**. Configuration fields and metric data model are subject to change. diff --git a/receiver/nsxreceiver/factory_test.go b/receiver/nsxreceiver/factory_test.go index d1626eb062b5..46176f93097f 100644 --- a/receiver/nsxreceiver/factory_test.go +++ b/receiver/nsxreceiver/factory_test.go @@ -36,9 +36,8 @@ func TestType(t *testing.T) { func TestDefaultConfig(t *testing.T) { factory := NewFactory() err := factory.CreateDefaultConfig().Validate() - // default does not supply username/password or endpoint - require.ErrorContains(t, err, "username not provided") - require.ErrorContains(t, err, "password not provided") + // default does not endpoint + require.ErrorContains(t, err, "no manager endpoint was specified") } func TestCreateMetricsReceiver(t *testing.T) { From 0113ceddb229952702a2ea60bcf3f95f2e9f3149 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 4 May 2022 16:23:08 -0400 Subject: [PATCH 29/48] another test fix --- receiver/nsxreceiver/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/nsxreceiver/config_test.go b/receiver/nsxreceiver/config_test.go index 3f57c3739e56..555c078f714f 100644 --- a/receiver/nsxreceiver/config_test.go +++ b/receiver/nsxreceiver/config_test.go @@ -32,7 +32,7 @@ func TestMetricValidation(t *testing.T) { { desc: "default config", cfg: defaultConfig, - expectedError: errors.New("url scheme must be http or https"), + expectedError: errors.New("no manager endpoint was specified"), }, { desc: "not valid scheme", From d02419c4dadcd7e47f08103dafa3aa61a05a4984 Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 10:35:04 -0400 Subject: [PATCH 30/48] move folder to nsxtreceiver --- receiver/nsxreceiver/README.md | 97 ------------------- .../{nsxreceiver => nsxtreceiver}/Makefile | 0 receiver/nsxtreceiver/README.md | 66 +++++++++++++ .../{nsxreceiver => nsxtreceiver}/client.go | 5 +- .../client_mock_test.go | 5 +- .../client_test.go | 3 +- .../{nsxreceiver => nsxtreceiver}/config.go | 5 +- .../config_test.go | 2 +- receiver/{nsxreceiver => nsxtreceiver}/doc.go | 2 +- .../documentation.md | 0 .../{nsxreceiver => nsxtreceiver}/factory.go | 4 +- .../factory_test.go | 2 +- receiver/{nsxreceiver => nsxtreceiver}/go.mod | 2 +- receiver/{nsxreceiver => nsxtreceiver}/go.sum | 0 .../internal/metadata/generated_metrics_v2.go | 0 .../internal/model/interface.go | 0 .../internal/model/node.go | 0 .../metadata.yaml | 0 .../{nsxreceiver => nsxtreceiver}/scraper.go | 6 +- .../scraper_test.go | 6 +- .../testdata/config.yaml | 2 +- .../testdata/metrics/cluster_nodes.json | 0 .../testdata/metrics/expected_metrics.json | 0 .../status.json | 0 .../interfaces/eth0/stats.json | 0 .../interfaces/index.json | 0 .../interfaces/lo/stats.json | 0 .../status.json | 0 .../interfaces/index.json | 0 .../interfaces/vmk10/stats.json | 0 .../interfaces/vmnic0/stats.json | 0 .../status.json | 0 .../interfaces/index.json | 0 .../interfaces/vmk10/stats.json | 0 .../interfaces/vmnic0/stats.json | 0 .../status.json | 0 .../testdata/metrics/transport_nodes.json | 0 37 files changed, 86 insertions(+), 121 deletions(-) delete mode 100644 receiver/nsxreceiver/README.md rename receiver/{nsxreceiver => nsxtreceiver}/Makefile (100%) create mode 100644 receiver/nsxtreceiver/README.md rename receiver/{nsxreceiver => nsxtreceiver}/client.go (97%) rename receiver/{nsxreceiver => nsxtreceiver}/client_mock_test.go (96%) rename receiver/{nsxreceiver => nsxtreceiver}/client_test.go (99%) rename receiver/{nsxreceiver => nsxtreceiver}/config.go (93%) rename receiver/{nsxreceiver => nsxtreceiver}/config_test.go (95%) rename receiver/{nsxreceiver => nsxtreceiver}/doc.go (85%) rename receiver/{nsxreceiver => nsxtreceiver}/documentation.md (100%) rename receiver/{nsxreceiver => nsxtreceiver}/factory.go (93%) rename receiver/{nsxreceiver => nsxtreceiver}/factory_test.go (94%) rename receiver/{nsxreceiver => nsxtreceiver}/go.mod (99%) rename receiver/{nsxreceiver => nsxtreceiver}/go.sum (100%) rename receiver/{nsxreceiver => nsxtreceiver}/internal/metadata/generated_metrics_v2.go (100%) rename receiver/{nsxreceiver => nsxtreceiver}/internal/model/interface.go (100%) rename receiver/{nsxreceiver => nsxtreceiver}/internal/model/node.go (100%) rename receiver/{nsxreceiver => nsxtreceiver}/metadata.yaml (100%) rename receiver/{nsxreceiver => nsxtreceiver}/scraper.go (97%) rename receiver/{nsxreceiver => nsxtreceiver}/scraper_test.go (97%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/config.yaml (97%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/cluster_nodes.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/expected_metrics.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json (100%) rename receiver/{nsxreceiver => nsxtreceiver}/testdata/metrics/transport_nodes.json (100%) diff --git a/receiver/nsxreceiver/README.md b/receiver/nsxreceiver/README.md deleted file mode 100644 index 1df015869739..000000000000 --- a/receiver/nsxreceiver/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# NSX-T Receiver - -This receiver fetches metrics important to run virtual networking using NSX-T. The receiver ingests metrics via the [NSX Rest API](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_api.pdf). As for logs, it is encouraged to use the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) which can be used to ingest NSX forwarded logs. Please see [Logging-Configuration](#logging-configuration) for more information. - -Supported pipeline types: `metrics` - -> :construction: This receiver is in **BETA**. Configuration fields and metric data model are subject to change. - -## Purpose - -The purpose of this receiver is to allow users to monitor metrics from NSX-T environments. - -## Prerequisites - -Needs at least an “Auditor” user for NSX Manager Resources in the vSphere Client (can be created via Web UI or CLI) - -The collector must be able to reach the NSX Manager with port 443 open. - -This receiver supports NSX-T Datacenter versions: - -- 3.2.0 -- 3.1.2 - -## Metrics Configuration - -Under the `metrics` key of the NSX configuration are these parameters: - -- `settings` (default: see DefaultMetricsSettings [here])(./internal/metadata/generated_metrics_v2.go): Allows enabling and disabling specific metrics from being collected in this receiver. - -- `endpoint`: Endpoint of the NSX Manager. Must be formatted as `{scheme}://{host}:{port}`. Schems supported are `http` and `https` - -- `username`: Username of the `Network Admin` user - -- `password`: Password of the `Network Admin` user - -- `collection_interval`: (default = `1m`): This receiver collects metrics on an interval. This value must be a string readable by Golang's [time.ParseDuration](https://pkg.go.dev/time#ParseDuration). Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. - -- `timeout`: (default = `1m`) The timeout of running commands against the NSX REST API. - -### Example Configuration - -```yaml -receivers: - nsx: - endpoint: https://nsx-manager - username: admin - password: password - timeout: 60s - settings: - nsx.node.cpu.utilization: - enabled: false - -exporters: - file: - path: "./content.json" - -service: - pipelines: - metrics: - receivers: [nsx] - exporters: [file] - logs: - receivers: [nsx] - exporters: [file] -``` - -The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). - -## Metrics - -Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) - -## Logging Configuration - -Logging is ingested via syslog forwarding from the NSX. This [document](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/com.vmware.nsx.logging.doc/GUID-EA70974C-07F8-469D-8A9D-0ED54F0C8F34.html) from VMware outlines how to configure syslog forwarding from your NSX Data Center. - -### Logging Prerequisites - -This technology should use the [syslogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver) as the engine for ingesting these forwarded syslogs. Currently this receiver only supports these protocols: - -- udp -- tcp -- tls - -So please be sure to pick the same format on both configuration of the collector and the forwarder. - -All configuration options can be found here the [syslogreceiver configuration options](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver#configuration). - -### Example Logging Configuration - -```yaml -receivers: - syslog: - udp: - listen_address: 0.0.0.0:5142 - protocol: rfc5424 -``` diff --git a/receiver/nsxreceiver/Makefile b/receiver/nsxtreceiver/Makefile similarity index 100% rename from receiver/nsxreceiver/Makefile rename to receiver/nsxtreceiver/Makefile diff --git a/receiver/nsxtreceiver/README.md b/receiver/nsxtreceiver/README.md new file mode 100644 index 000000000000..cb5c9ece76d3 --- /dev/null +++ b/receiver/nsxtreceiver/README.md @@ -0,0 +1,66 @@ +# NSX-T Receiver + +This receiver fetches metrics important to run virtual networking using NSX-T. The receiver ingests metrics via the [NSX Rest API](https://docs.vmware.com/en/VMware-NSX-Data-Center-for-vSphere/6.4/nsx_64_api.pdf). + +Supported pipeline types: `metrics` + +> :construction: This receiver is in **BETA**. Configuration fields and metric data model are subject to change. + +## Purpose + +The purpose of this receiver is to allow users to monitor metrics from NSX-T environments. + +## Prerequisites + +Needs at least an “Auditor” user for NSX Manager Resources in the vSphere Client (can be created via Web UI or CLI) + +The collector must be able to reach the NSX Manager with port 443 open. + +This receiver supports NSX-T Datacenter versions: + +- 3.2.0 +- 3.1.2 + +## Configuration + +- `endpoint`: Endpoint of the NSX Manager. Must be formatted as `{scheme}://{host}:{port}`. Schems supported are `http` and `https` + +- `username`: Username of the `Auditor` user + +- `password`: Password of the `Auditor` user + +- `collection_interval`: (default = `1m`): This receiver collects metrics on an interval. This value must be a string readable by Golang's [time.ParseDuration](https://pkg.go.dev/time#ParseDuration). Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. + +- `timeout`: (default = `1m`) The timeout of running commands against the NSX REST API. + +- `metrics` (default: see DefaultMetricsSettings [here])(./internal/metadata/generated_metrics_v2.go): Allows enabling and disabling specific metrics from being collected in this receiver. + +### Example Configuration + +```yaml +receivers: + nsxt: + endpoint: https://nsx-manager + username: admin + password: password + timeout: 60s + settings: + nsx.node.cpu.utilization: + enabled: false + +exporters: + file: + path: "./content.json" + +service: + pipelines: + metrics: + receivers: [nsxt] + exporters: [file] +``` + +The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). + +## Metrics + +Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) diff --git a/receiver/nsxreceiver/client.go b/receiver/nsxtreceiver/client.go similarity index 97% rename from receiver/nsxreceiver/client.go rename to receiver/nsxtreceiver/client.go index 46f6c96493a4..22cf5d99fb08 100644 --- a/receiver/nsxreceiver/client.go +++ b/receiver/nsxtreceiver/client.go @@ -12,8 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" - +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "context" "encoding/json" @@ -26,7 +25,7 @@ import ( "go.opentelemetry.io/collector/component" "go.uber.org/zap" - dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" + dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/model" ) var _ (Client) = &nsxClient{} diff --git a/receiver/nsxreceiver/client_mock_test.go b/receiver/nsxtreceiver/client_mock_test.go similarity index 96% rename from receiver/nsxreceiver/client_mock_test.go rename to receiver/nsxtreceiver/client_mock_test.go index d8f52329c72e..2285d4bc960d 100644 --- a/receiver/nsxreceiver/client_mock_test.go +++ b/receiver/nsxtreceiver/client_mock_test.go @@ -12,15 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" - +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( context "context" testing "testing" mock "github.com/stretchr/testify/mock" - model "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" + model "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/model" ) const ( diff --git a/receiver/nsxreceiver/client_test.go b/receiver/nsxtreceiver/client_test.go similarity index 99% rename from receiver/nsxreceiver/client_test.go rename to receiver/nsxtreceiver/client_test.go index 0ddf37e9b2ff..fec3d0404517 100644 --- a/receiver/nsxreceiver/client_test.go +++ b/receiver/nsxtreceiver/client_test.go @@ -12,8 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" - +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "context" "fmt" diff --git a/receiver/nsxreceiver/config.go b/receiver/nsxtreceiver/config.go similarity index 93% rename from receiver/nsxreceiver/config.go rename to receiver/nsxtreceiver/config.go index 0c9fe0561760..374121e80d5c 100644 --- a/receiver/nsxreceiver/config.go +++ b/receiver/nsxtreceiver/config.go @@ -12,8 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" - +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "errors" "fmt" @@ -23,7 +22,7 @@ import ( "go.opentelemetry.io/collector/receiver/scraperhelper" "go.uber.org/multierr" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/metadata" ) // Config is the configuration for the NSX receiver diff --git a/receiver/nsxreceiver/config_test.go b/receiver/nsxtreceiver/config_test.go similarity index 95% rename from receiver/nsxreceiver/config_test.go rename to receiver/nsxtreceiver/config_test.go index 555c078f714f..192004f2af5f 100644 --- a/receiver/nsxreceiver/config_test.go +++ b/receiver/nsxtreceiver/config_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "errors" diff --git a/receiver/nsxreceiver/doc.go b/receiver/nsxtreceiver/doc.go similarity index 85% rename from receiver/nsxreceiver/doc.go rename to receiver/nsxtreceiver/doc.go index 240d02acf25a..04901836f9c5 100644 --- a/receiver/nsxreceiver/doc.go +++ b/receiver/nsxtreceiver/doc.go @@ -14,4 +14,4 @@ //go:generate mdatagen --experimental-gen metadata.yaml -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" diff --git a/receiver/nsxreceiver/documentation.md b/receiver/nsxtreceiver/documentation.md similarity index 100% rename from receiver/nsxreceiver/documentation.md rename to receiver/nsxtreceiver/documentation.md diff --git a/receiver/nsxreceiver/factory.go b/receiver/nsxtreceiver/factory.go similarity index 93% rename from receiver/nsxreceiver/factory.go rename to receiver/nsxtreceiver/factory.go index 623a923de698..44bfa5ba6af8 100644 --- a/receiver/nsxreceiver/factory.go +++ b/receiver/nsxtreceiver/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" import ( "context" @@ -24,7 +24,7 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver/scraperhelper" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/metadata" ) const typeStr = "nsx" diff --git a/receiver/nsxreceiver/factory_test.go b/receiver/nsxtreceiver/factory_test.go similarity index 94% rename from receiver/nsxreceiver/factory_test.go rename to receiver/nsxtreceiver/factory_test.go index 46176f93097f..7744608f6263 100644 --- a/receiver/nsxreceiver/factory_test.go +++ b/receiver/nsxtreceiver/factory_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "context" diff --git a/receiver/nsxreceiver/go.mod b/receiver/nsxtreceiver/go.mod similarity index 99% rename from receiver/nsxreceiver/go.mod rename to receiver/nsxtreceiver/go.mod index b656d6162302..a4f1501485c1 100644 --- a/receiver/nsxreceiver/go.mod +++ b/receiver/nsxtreceiver/go.mod @@ -1,4 +1,4 @@ -module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver +module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver go 1.17 diff --git a/receiver/nsxreceiver/go.sum b/receiver/nsxtreceiver/go.sum similarity index 100% rename from receiver/nsxreceiver/go.sum rename to receiver/nsxtreceiver/go.sum diff --git a/receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go similarity index 100% rename from receiver/nsxreceiver/internal/metadata/generated_metrics_v2.go rename to receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go diff --git a/receiver/nsxreceiver/internal/model/interface.go b/receiver/nsxtreceiver/internal/model/interface.go similarity index 100% rename from receiver/nsxreceiver/internal/model/interface.go rename to receiver/nsxtreceiver/internal/model/interface.go diff --git a/receiver/nsxreceiver/internal/model/node.go b/receiver/nsxtreceiver/internal/model/node.go similarity index 100% rename from receiver/nsxreceiver/internal/model/node.go rename to receiver/nsxtreceiver/internal/model/node.go diff --git a/receiver/nsxreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml similarity index 100% rename from receiver/nsxreceiver/metadata.yaml rename to receiver/nsxtreceiver/metadata.yaml diff --git a/receiver/nsxreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go similarity index 97% rename from receiver/nsxreceiver/scraper.go rename to receiver/nsxtreceiver/scraper.go index 05a55f3550bb..df4f8816bbfc 100644 --- a/receiver/nsxreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "context" @@ -27,8 +27,8 @@ import ( "go.opentelemetry.io/collector/receiver/scrapererror" "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" - dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/metadata" + dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/model" ) type scraper struct { diff --git a/receiver/nsxreceiver/scraper_test.go b/receiver/nsxtreceiver/scraper_test.go similarity index 97% rename from receiver/nsxreceiver/scraper_test.go rename to receiver/nsxtreceiver/scraper_test.go index ffd8fa4535fa..9edb1174637a 100644 --- a/receiver/nsxreceiver/scraper_test.go +++ b/receiver/nsxtreceiver/scraper_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "context" @@ -30,8 +30,8 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/scrapertest/golden" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata" - dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/metadata" + dm "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/model" ) func TestScrape(t *testing.T) { diff --git a/receiver/nsxreceiver/testdata/config.yaml b/receiver/nsxtreceiver/testdata/config.yaml similarity index 97% rename from receiver/nsxreceiver/testdata/config.yaml rename to receiver/nsxtreceiver/testdata/config.yaml index 398d50b5fd57..58807548597d 100644 --- a/receiver/nsxreceiver/testdata/config.yaml +++ b/receiver/nsxtreceiver/testdata/config.yaml @@ -1,6 +1,6 @@ ### Metrics receivers: - nsx: + nsxt: collection_interval: 1m endpoint: https://nsx-manager-endpoint username: admin diff --git a/receiver/nsxreceiver/testdata/metrics/cluster_nodes.json b/receiver/nsxtreceiver/testdata/metrics/cluster_nodes.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/cluster_nodes.json rename to receiver/nsxtreceiver/testdata/metrics/cluster_nodes.json diff --git a/receiver/nsxreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/expected_metrics.json rename to receiver/nsxtreceiver/testdata/metrics/expected_metrics.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json b/receiver/nsxtreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/cluster/8aaacaaa-c51d-44f9-8051-f615458eebe2/status.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json b/receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/eth0/stats.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json b/receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/index.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json b/receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/interfaces/lo/stats.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json b/receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/cluster/b7a79908-9808-4c9e-bb49-b70008993fcb/status.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/index.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmk10/stats.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/interfaces/vmnic0/stats.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827/status.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/index.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmk10/stats.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/interfaces/vmnic0/stats.json diff --git a/receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json rename to receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json diff --git a/receiver/nsxreceiver/testdata/metrics/transport_nodes.json b/receiver/nsxtreceiver/testdata/metrics/transport_nodes.json similarity index 100% rename from receiver/nsxreceiver/testdata/metrics/transport_nodes.json rename to receiver/nsxtreceiver/testdata/metrics/transport_nodes.json From f38f25689180a7377d87a762aae131bc86ec8f11 Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 10:37:16 -0400 Subject: [PATCH 31/48] fix go.mod --- receiver/nsxtreceiver/go.mod | 2 +- receiver/nsxtreceiver/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/receiver/nsxtreceiver/go.mod b/receiver/nsxtreceiver/go.mod index a4f1501485c1..4dc961caa7cd 100644 --- a/receiver/nsxtreceiver/go.mod +++ b/receiver/nsxtreceiver/go.mod @@ -16,7 +16,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f go.opencensus.io v0.23.0 // indirect - go.opentelemetry.io/collector/model v0.49.0 + go.opentelemetry.io/collector/model v0.50.0 go.opentelemetry.io/otel v1.7.0 // indirect go.opentelemetry.io/otel/metric v0.30.0 // indirect go.opentelemetry.io/otel/trace v1.7.0 // indirect diff --git a/receiver/nsxtreceiver/go.sum b/receiver/nsxtreceiver/go.sum index cd5f318ceaa5..7005b06a91b1 100644 --- a/receiver/nsxtreceiver/go.sum +++ b/receiver/nsxtreceiver/go.sum @@ -222,8 +222,8 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.50.1-0.20220429151328-041f39835df7 h1:EdzWPAR5/XWh6FjjCaqPBmbB62HIpeataITjfXQKS6U= go.opentelemetry.io/collector v0.50.1-0.20220429151328-041f39835df7/go.mod h1:Qer3GgFX3WkQFz/dRm7pHCITu8Yp6RxWg4Oh4mOmdPc= -go.opentelemetry.io/collector/model v0.49.0 h1:mbUSNgpaBE3GWmzGsRb5t0xILpXIVYv7scPTTfoMt6c= -go.opentelemetry.io/collector/model v0.49.0/go.mod h1:nOYQv9KoFPs6ihJwOi24qB209EOhS9HkwhGj54YiEAw= +go.opentelemetry.io/collector/model v0.50.0 h1:1wt8pQ4O6GaUeYEaR+dh3zHmYsFicduF2bbPGMZeSKk= +go.opentelemetry.io/collector/model v0.50.0/go.mod h1:vKpC0JMtrL7g9tUHmzcQqd8rEbnahKVdTWZSVO7x3Ms= go.opentelemetry.io/collector/pdata v0.50.1-0.20220429151328-041f39835df7 h1:CVS7mnrDVyeW+9tZ8ficfHGpYAbySGZoZFyuWZmqIzE= go.opentelemetry.io/collector/pdata v0.50.1-0.20220429151328-041f39835df7/go.mod h1:jrnUDnlHCTSKf9H7LYTmldQUmNQmPvilNNG/cKlv8Lc= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE= From 49f4fc192a10e00b1bea866ff96b05bb99070176 Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 10:46:50 -0400 Subject: [PATCH 32/48] finish rename --- .github/CODEOWNERS | 2 +- cmd/configschema/go.mod | 4 ++-- go.mod | 4 ++-- internal/components/components.go | 4 ++-- receiver/nsxtreceiver/documentation.md | 2 +- receiver/nsxtreceiver/factory.go | 2 +- .../internal/metadata/generated_metrics_v2.go | 4 ++-- .../nsxtreceiver/internal/model/interface.go | 2 +- receiver/nsxtreceiver/internal/model/node.go | 2 +- receiver/nsxtreceiver/metadata.yaml | 2 +- .../testdata/metrics/expected_metrics.json | 18 +++++++++--------- versions.yaml | 2 +- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9da9d7c31b71..31e7414fec47 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -141,7 +141,7 @@ receiver/mongodbreceiver/ @open-telemetry/collector-c receiver/mongodbatlasreceiver/ @open-telemetry/collector-contrib-approvers @zenmoto receiver/mysqlreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski receiver/nginxreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski -receiver/nsxreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @schmikei +receiver/nsxtreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @schmikei receiver/postgresqlreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski receiver/prometheusexecreceiver/ @open-telemetry/collector-contrib-approvers @dmitryax receiver/prometheusreceiver/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @dashpole diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index 313519d8172f..9ae608d938b1 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -356,7 +356,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver v0.50.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver v0.50.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver v0.50.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver v0.50.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver v0.50.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.50.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver v0.50.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver v0.50.0 // indirect @@ -783,7 +783,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysql replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver => ../../receiver/nginxreceiver -replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver => ../../receiver/nsxreceiver +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver => ../../receiver/nsxtreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver => ../../receiver/opencensusreceiver diff --git a/go.mod b/go.mod index 9f6f8e731fc9..776590275ea7 100644 --- a/go.mod +++ b/go.mod @@ -109,7 +109,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver v0.50.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver v0.50.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver v0.50.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver v0.50.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver v0.50.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.50.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver v0.50.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver v0.50.0 @@ -788,7 +788,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysql replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver => ./receiver/nginxreceiver -replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver => ./receiver/nsxreceiver +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver => ./receiver/nsxtreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver => ./receiver/opencensusreceiver diff --git a/internal/components/components.go b/internal/components/components.go index d059aa36faa9..a8b4d21d34e2 100644 --- a/internal/components/components.go +++ b/internal/components/components.go @@ -129,7 +129,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver" @@ -216,7 +216,7 @@ func Components() (component.Factories, error) { mongodbatlasreceiver.NewFactory(), mongodbreceiver.NewFactory(), mysqlreceiver.NewFactory(), - nsxreceiver.NewFactory(), + nsxtreceiver.NewFactory(), nginxreceiver.NewFactory(), opencensusreceiver.NewFactory(), otlpreceiver.NewFactory(), diff --git a/receiver/nsxtreceiver/documentation.md b/receiver/nsxtreceiver/documentation.md index 72e548f57282..db464ab08312 100644 --- a/receiver/nsxtreceiver/documentation.md +++ b/receiver/nsxtreceiver/documentation.md @@ -1,6 +1,6 @@ [comment]: <> (Code generated by mdatagen. DO NOT EDIT.) -# nsxreceiver +# nsxtreceiver ## Metrics diff --git a/receiver/nsxtreceiver/factory.go b/receiver/nsxtreceiver/factory.go index 44bfa5ba6af8..7e07efbd0730 100644 --- a/receiver/nsxtreceiver/factory.go +++ b/receiver/nsxtreceiver/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver" +package nsxtreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver" import ( "context" diff --git a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go index f8bceb5ed519..e32498323df7 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go @@ -14,7 +14,7 @@ type MetricSettings struct { Enabled bool `mapstructure:"enabled"` } -// MetricsSettings provides settings for nsxreceiver metrics. +// MetricsSettings provides settings for nsxtreceiver metrics. type MetricsSettings struct { NsxInterfacePacketCount MetricSettings `mapstructure:"nsx.interface.packet.count"` NsxInterfaceThroughput MetricSettings `mapstructure:"nsx.interface.throughput"` @@ -650,7 +650,7 @@ func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption) { op(rm.Resource()) } ils := rm.ScopeMetrics().AppendEmpty() - ils.Scope().SetName("otelcol/nsxreceiver") + ils.Scope().SetName("otelcol/nsxtreceiver") ils.Metrics().EnsureCapacity(mb.metricsCapacity) mb.metricNsxInterfacePacketCount.emit(ils.Metrics()) mb.metricNsxInterfaceThroughput.emit(ils.Metrics()) diff --git a/receiver/nsxtreceiver/internal/model/interface.go b/receiver/nsxtreceiver/internal/model/interface.go index 8baab56ce0a8..4e1ee46727f9 100644 --- a/receiver/nsxtreceiver/internal/model/interface.go +++ b/receiver/nsxtreceiver/internal/model/interface.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" +package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/model" import "github.com/vmware/go-vmware-nsxt/manager" // NodeNetworkInterfacePropertiesListResult wraps the results of a node's network interface diff --git a/receiver/nsxtreceiver/internal/model/node.go b/receiver/nsxtreceiver/internal/model/node.go index 9b6a33bc562d..ccae2f59185d 100644 --- a/receiver/nsxtreceiver/internal/model/node.go +++ b/receiver/nsxtreceiver/internal/model/node.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model" +package model // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/model" // ClusterNodeList is a result struct from type ClusterNodeList struct { diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index 71ffc6f8e0f3..e0f50a4216bc 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -1,4 +1,4 @@ -name: nsxreceiver +name: nsxtreceiver resource_attributes: nsx.node.name: diff --git a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json index d7447a64ae06..5b2279f65e33 100644 --- a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json @@ -20,7 +20,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -209,7 +209,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -404,7 +404,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -879,7 +879,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -1068,7 +1068,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -1263,7 +1263,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -1738,7 +1738,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -1927,7 +1927,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { @@ -2122,7 +2122,7 @@ "scopeMetrics": [ { "scope": { - "name": "otelcol/nsxreceiver" + "name": "otelcol/nsxtreceiver" }, "metrics": [ { diff --git a/versions.yaml b/versions.yaml index aa4f433e9207..9df83a3869fa 100644 --- a/versions.yaml +++ b/versions.yaml @@ -166,7 +166,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver - - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver + - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver From b789e456ed5647ef436349a47d271e5f471a85a7 Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 11:31:48 -0400 Subject: [PATCH 33/48] don't use requestOptions until necessary --- receiver/nsxtreceiver/client.go | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/receiver/nsxtreceiver/client.go b/receiver/nsxtreceiver/client.go index 22cf5d99fb08..c4c0127da0f5 100644 --- a/receiver/nsxtreceiver/client.go +++ b/receiver/nsxtreceiver/client.go @@ -73,7 +73,6 @@ func (c *nsxClient) TransportNodes(ctx context.Context) ([]dm.TransportNode, err body, err := c.doRequest( ctx, "/api/v1/transport-nodes", - withDefaultHeaders(), ) if err != nil { return nil, err @@ -87,7 +86,6 @@ func (c *nsxClient) ClusterNodes(ctx context.Context) ([]dm.ClusterNode, error) body, err := c.doRequest( ctx, "/api/v1/cluster/nodes", - withDefaultHeaders(), ) if err != nil { return nil, fmt.Errorf("unable to get cluster nodes: %w", err) @@ -102,7 +100,6 @@ func (c *nsxClient) NodeStatus(ctx context.Context, nodeID string, class nodeCla body, err := c.doRequest( ctx, c.nodeStatusEndpoint(class, nodeID), - withDefaultHeaders(), ) if err != nil { return nil, fmt.Errorf("unable to get a node's status from the REST API: %w", err) @@ -129,7 +126,6 @@ func (c *nsxClient) Interfaces( body, err := c.doRequest( ctx, c.interfacesEndpoint(class, nodeID), - withDefaultHeaders(), ) if err != nil { return nil, err @@ -148,7 +144,6 @@ func (c *nsxClient) InterfaceStatus( body, err := c.doRequest( ctx, c.interfaceStatusEndpoint(class, nodeID, interfaceID), - withDefaultHeaders(), ) if err != nil { @@ -159,19 +154,7 @@ func (c *nsxClient) InterfaceStatus( return &interfaceStats, err } -type requestOption func(req *http.Request) *http.Request - -func withDefaultHeaders() requestOption { - return func(req *http.Request) *http.Request { - h := req.Header - h.Add("User-Agent", "opentelemetry-collector") - h.Add("Accept", "application/json") - h.Add("Connection", "keep-alive") - return req - } -} - -func (c *nsxClient) doRequest(ctx context.Context, path string, options ...requestOption) ([]byte, error) { +func (c *nsxClient) doRequest(ctx context.Context, path string) ([]byte, error) { endpoint, err := c.endpoint.Parse(path) if err != nil { return nil, err @@ -182,10 +165,10 @@ func (c *nsxClient) doRequest(ctx context.Context, path string, options ...reque return nil, err } req.SetBasicAuth(c.config.Username, c.config.Password) - - for _, op := range options { - req = op(req) - } + h := req.Header + h.Add("User-Agent", "opentelemetry-collector") + h.Add("Accept", "application/json") + h.Add("Connection", "keep-alive") resp, err := c.client.Do(req) if err != nil { From 13a01502b851f57022ced2a95272faf5c33ac55a Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 12:06:39 -0400 Subject: [PATCH 34/48] fix receiver type change: nsx -> nsxt --- internal/components/receivers_test.go | 2 +- receiver/nsxtreceiver/factory.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/components/receivers_test.go b/internal/components/receivers_test.go index 6bd2d6340f35..2175ecacc34b 100644 --- a/internal/components/receivers_test.go +++ b/internal/components/receivers_test.go @@ -178,7 +178,7 @@ func TestDefaultReceivers(t *testing.T) { receiver: "nginx", }, { - receiver: "nsx", + receiver: "nsxt", }, { receiver: "opencensus", diff --git a/receiver/nsxtreceiver/factory.go b/receiver/nsxtreceiver/factory.go index 7e07efbd0730..1ff75234a1b4 100644 --- a/receiver/nsxtreceiver/factory.go +++ b/receiver/nsxtreceiver/factory.go @@ -27,7 +27,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver/internal/metadata" ) -const typeStr = "nsx" +const typeStr = "nsxt" var errConfigNotNSX = errors.New("config was not a NSX receiver config") From 70d273c6dfaee66868492cda91cabf5095657507 Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 12:09:36 -0400 Subject: [PATCH 35/48] update factory_test.go --- receiver/nsxtreceiver/factory_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/nsxtreceiver/factory_test.go b/receiver/nsxtreceiver/factory_test.go index 7744608f6263..6671b6792716 100644 --- a/receiver/nsxtreceiver/factory_test.go +++ b/receiver/nsxtreceiver/factory_test.go @@ -30,7 +30,7 @@ import ( func TestType(t *testing.T) { factory := NewFactory() ft := factory.Type() - require.EqualValues(t, "nsx", ft) + require.EqualValues(t, typeStr, ft) } func TestDefaultConfig(t *testing.T) { From 091b363769a283e0187b8ea2e8221419d192e8e2 Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 13:23:55 -0400 Subject: [PATCH 36/48] remove disk attribute for node disk usage metrics --- receiver/nsxtreceiver/documentation.md | 15 +- .../internal/metadata/generated_metrics_v2.go | 173 +-- receiver/nsxtreceiver/metadata.yaml | 27 +- receiver/nsxtreceiver/scraper.go | 11 +- .../testdata/metrics/expected_metrics.json | 1329 ++--------------- 5 files changed, 242 insertions(+), 1313 deletions(-) diff --git a/receiver/nsxtreceiver/documentation.md b/receiver/nsxtreceiver/documentation.md index db464ab08312..e320adfeb8fc 100644 --- a/receiver/nsxtreceiver/documentation.md +++ b/receiver/nsxtreceiver/documentation.md @@ -12,9 +12,8 @@ These are the metrics available for this scraper. | **nsx.interface.throughput** | The number of Bytes flowing through the network interface. | By | Sum(Int) |
  • direction
| | **nsx.node.cache.memory.usage** | The memory usage of the node's cache | KBy | Sum(Int) |
| | **nsx.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • cpu.process.class
| -| **nsx.node.disk.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk
| -| **nsx.node.disk.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
  • disk
| -| **nsx.node.load_balancer.utilization** | The utilization of load balancers by the node | % | Gauge(Double) |
  • load_balancer
| +| **nsx.node.disk.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk_state
| +| **nsx.node.disk.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
| | **nsx.node.memory.usage** | The memory usage of the node | KBy | Sum(Int) |
| **Highlighted metrics** are emitted by default. Other metrics are optional and not emitted by default. @@ -39,8 +38,8 @@ metrics: | Name | Description | Values | | ---- | ----------- | ------ | -| cpu.process.class | The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes | datapath, services | -| direction (direction) | The direction of network flow | received, transmitted | -| disk (disk) | The name of the mounted storage | | -| load_balancer | The name of the load balancer being utilized | | -| packet.type (type) | The type of packet counter | dropped, errored, success | +| cpu.process.class | The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes. | datapath, services | +| direction (direction) | The direction of network flow. | received, transmitted | +| disk_state (state) | The state of storage space. | used, available | +| load_balancer | The name of the load balancer being utilized. | | +| packet.type (type) | The type of packet counter. | dropped, errored, success | diff --git a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go index e32498323df7..25a3925d20b7 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go @@ -16,14 +16,13 @@ type MetricSettings struct { // MetricsSettings provides settings for nsxtreceiver metrics. type MetricsSettings struct { - NsxInterfacePacketCount MetricSettings `mapstructure:"nsx.interface.packet.count"` - NsxInterfaceThroughput MetricSettings `mapstructure:"nsx.interface.throughput"` - NsxNodeCacheMemoryUsage MetricSettings `mapstructure:"nsx.node.cache.memory.usage"` - NsxNodeCPUUtilization MetricSettings `mapstructure:"nsx.node.cpu.utilization"` - NsxNodeDiskUsage MetricSettings `mapstructure:"nsx.node.disk.usage"` - NsxNodeDiskUtilization MetricSettings `mapstructure:"nsx.node.disk.utilization"` - NsxNodeLoadBalancerUtilization MetricSettings `mapstructure:"nsx.node.load_balancer.utilization"` - NsxNodeMemoryUsage MetricSettings `mapstructure:"nsx.node.memory.usage"` + NsxInterfacePacketCount MetricSettings `mapstructure:"nsx.interface.packet.count"` + NsxInterfaceThroughput MetricSettings `mapstructure:"nsx.interface.throughput"` + NsxNodeCacheMemoryUsage MetricSettings `mapstructure:"nsx.node.cache.memory.usage"` + NsxNodeCPUUtilization MetricSettings `mapstructure:"nsx.node.cpu.utilization"` + NsxNodeDiskUsage MetricSettings `mapstructure:"nsx.node.disk.usage"` + NsxNodeDiskUtilization MetricSettings `mapstructure:"nsx.node.disk.utilization"` + NsxNodeMemoryUsage MetricSettings `mapstructure:"nsx.node.memory.usage"` } func DefaultMetricsSettings() MetricsSettings { @@ -46,9 +45,6 @@ func DefaultMetricsSettings() MetricsSettings { NsxNodeDiskUtilization: MetricSettings{ Enabled: true, }, - NsxNodeLoadBalancerUtilization: MetricSettings{ - Enabled: true, - }, NsxNodeMemoryUsage: MetricSettings{ Enabled: true, }, @@ -107,6 +103,32 @@ var MapAttributeDirection = map[string]AttributeDirection{ "transmitted": AttributeDirectionTransmitted, } +// AttributeDiskState specifies the a value disk_state attribute. +type AttributeDiskState int + +const ( + _ AttributeDiskState = iota + AttributeDiskStateUsed + AttributeDiskStateAvailable +) + +// String returns the string representation of the AttributeDiskState. +func (av AttributeDiskState) String() string { + switch av { + case AttributeDiskStateUsed: + return "used" + case AttributeDiskStateAvailable: + return "available" + } + return "" +} + +// MapAttributeDiskState is a helper map of string to AttributeDiskState attribute value. +var MapAttributeDiskState = map[string]AttributeDiskState{ + "used": AttributeDiskStateUsed, + "available": AttributeDiskStateAvailable, +} + // AttributePacketType specifies the a value packet.type attribute. type AttributePacketType int @@ -363,7 +385,7 @@ func (m *metricNsxNodeDiskUsage) init() { m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskAttributeValue string) { +func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskStateAttributeValue string) { if !m.settings.Enabled { return } @@ -371,7 +393,7 @@ func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pco dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) - dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) + dp.Attributes().Insert(A.DiskState, pcommon.NewValueString(diskStateAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -411,10 +433,9 @@ func (m *metricNsxNodeDiskUtilization) init() { m.data.SetDescription("The percentage of storage space utilized.") m.data.SetUnit("%") m.data.SetDataType(pmetric.MetricDataTypeGauge) - m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, diskAttributeValue string) { +func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) { if !m.settings.Enabled { return } @@ -422,7 +443,6 @@ func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetDoubleVal(val) - dp.Attributes().Insert(A.Disk, pcommon.NewValueString(diskAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -450,57 +470,6 @@ func newMetricNsxNodeDiskUtilization(settings MetricSettings) metricNsxNodeDiskU return m } -type metricNsxNodeLoadBalancerUtilization struct { - data pmetric.Metric // data buffer for generated metric. - settings MetricSettings // metric settings provided by user. - capacity int // max observed number of data points added to the metric. -} - -// init fills nsx.node.load_balancer.utilization metric with initial data. -func (m *metricNsxNodeLoadBalancerUtilization) init() { - m.data.SetName("nsx.node.load_balancer.utilization") - m.data.SetDescription("The utilization of load balancers by the node") - m.data.SetUnit("%") - m.data.SetDataType(pmetric.MetricDataTypeGauge) - m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) -} - -func (m *metricNsxNodeLoadBalancerUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { - if !m.settings.Enabled { - return - } - dp := m.data.Gauge().DataPoints().AppendEmpty() - dp.SetStartTimestamp(start) - dp.SetTimestamp(ts) - dp.SetDoubleVal(val) - dp.Attributes().Insert(A.LoadBalancer, pcommon.NewValueString(loadBalancerAttributeValue)) -} - -// updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeLoadBalancerUtilization) updateCapacity() { - if m.data.Gauge().DataPoints().Len() > m.capacity { - m.capacity = m.data.Gauge().DataPoints().Len() - } -} - -// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeLoadBalancerUtilization) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { - m.updateCapacity() - m.data.MoveTo(metrics.AppendEmpty()) - m.init() - } -} - -func newMetricNsxNodeLoadBalancerUtilization(settings MetricSettings) metricNsxNodeLoadBalancerUtilization { - m := metricNsxNodeLoadBalancerUtilization{settings: settings} - if settings.Enabled { - m.data = pmetric.NewMetric() - m.init() - } - return m -} - type metricNsxNodeMemoryUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. @@ -555,18 +524,17 @@ func newMetricNsxNodeMemoryUsage(settings MetricSettings) metricNsxNodeMemoryUsa // MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations // required to produce metric representation defined in metadata and user settings. type MetricsBuilder struct { - startTime pcommon.Timestamp // start time that will be applied to all recorded data points. - metricsCapacity int // maximum observed number of metrics per resource. - resourceCapacity int // maximum observed number of resource attributes. - metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. - metricNsxInterfacePacketCount metricNsxInterfacePacketCount - metricNsxInterfaceThroughput metricNsxInterfaceThroughput - metricNsxNodeCacheMemoryUsage metricNsxNodeCacheMemoryUsage - metricNsxNodeCPUUtilization metricNsxNodeCPUUtilization - metricNsxNodeDiskUsage metricNsxNodeDiskUsage - metricNsxNodeDiskUtilization metricNsxNodeDiskUtilization - metricNsxNodeLoadBalancerUtilization metricNsxNodeLoadBalancerUtilization - metricNsxNodeMemoryUsage metricNsxNodeMemoryUsage + startTime pcommon.Timestamp // start time that will be applied to all recorded data points. + metricsCapacity int // maximum observed number of metrics per resource. + resourceCapacity int // maximum observed number of resource attributes. + metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. + metricNsxInterfacePacketCount metricNsxInterfacePacketCount + metricNsxInterfaceThroughput metricNsxInterfaceThroughput + metricNsxNodeCacheMemoryUsage metricNsxNodeCacheMemoryUsage + metricNsxNodeCPUUtilization metricNsxNodeCPUUtilization + metricNsxNodeDiskUsage metricNsxNodeDiskUsage + metricNsxNodeDiskUtilization metricNsxNodeDiskUtilization + metricNsxNodeMemoryUsage metricNsxNodeMemoryUsage } // metricBuilderOption applies changes to default metrics builder. @@ -581,16 +549,15 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ - startTime: pcommon.NewTimestampFromTime(time.Now()), - metricsBuffer: pmetric.NewMetrics(), - metricNsxInterfacePacketCount: newMetricNsxInterfacePacketCount(settings.NsxInterfacePacketCount), - metricNsxInterfaceThroughput: newMetricNsxInterfaceThroughput(settings.NsxInterfaceThroughput), - metricNsxNodeCacheMemoryUsage: newMetricNsxNodeCacheMemoryUsage(settings.NsxNodeCacheMemoryUsage), - metricNsxNodeCPUUtilization: newMetricNsxNodeCPUUtilization(settings.NsxNodeCPUUtilization), - metricNsxNodeDiskUsage: newMetricNsxNodeDiskUsage(settings.NsxNodeDiskUsage), - metricNsxNodeDiskUtilization: newMetricNsxNodeDiskUtilization(settings.NsxNodeDiskUtilization), - metricNsxNodeLoadBalancerUtilization: newMetricNsxNodeLoadBalancerUtilization(settings.NsxNodeLoadBalancerUtilization), - metricNsxNodeMemoryUsage: newMetricNsxNodeMemoryUsage(settings.NsxNodeMemoryUsage), + startTime: pcommon.NewTimestampFromTime(time.Now()), + metricsBuffer: pmetric.NewMetrics(), + metricNsxInterfacePacketCount: newMetricNsxInterfacePacketCount(settings.NsxInterfacePacketCount), + metricNsxInterfaceThroughput: newMetricNsxInterfaceThroughput(settings.NsxInterfaceThroughput), + metricNsxNodeCacheMemoryUsage: newMetricNsxNodeCacheMemoryUsage(settings.NsxNodeCacheMemoryUsage), + metricNsxNodeCPUUtilization: newMetricNsxNodeCPUUtilization(settings.NsxNodeCPUUtilization), + metricNsxNodeDiskUsage: newMetricNsxNodeDiskUsage(settings.NsxNodeDiskUsage), + metricNsxNodeDiskUtilization: newMetricNsxNodeDiskUtilization(settings.NsxNodeDiskUtilization), + metricNsxNodeMemoryUsage: newMetricNsxNodeMemoryUsage(settings.NsxNodeMemoryUsage), } for _, op := range options { op(mb) @@ -658,7 +625,6 @@ func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption) { mb.metricNsxNodeCPUUtilization.emit(ils.Metrics()) mb.metricNsxNodeDiskUsage.emit(ils.Metrics()) mb.metricNsxNodeDiskUtilization.emit(ils.Metrics()) - mb.metricNsxNodeLoadBalancerUtilization.emit(ils.Metrics()) mb.metricNsxNodeMemoryUsage.emit(ils.Metrics()) if ils.Metrics().Len() > 0 { mb.updateCapacity(rm) @@ -697,18 +663,13 @@ func (mb *MetricsBuilder) RecordNsxNodeCPUUtilizationDataPoint(ts pcommon.Timest } // RecordNsxNodeDiskUsageDataPoint adds a data point to nsx.node.disk.usage metric. -func (mb *MetricsBuilder) RecordNsxNodeDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskAttributeValue string) { - mb.metricNsxNodeDiskUsage.recordDataPoint(mb.startTime, ts, val, diskAttributeValue) +func (mb *MetricsBuilder) RecordNsxNodeDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState) { + mb.metricNsxNodeDiskUsage.recordDataPoint(mb.startTime, ts, val, diskStateAttributeValue.String()) } // RecordNsxNodeDiskUtilizationDataPoint adds a data point to nsx.node.disk.utilization metric. -func (mb *MetricsBuilder) RecordNsxNodeDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64, diskAttributeValue string) { - mb.metricNsxNodeDiskUtilization.recordDataPoint(mb.startTime, ts, val, diskAttributeValue) -} - -// RecordNsxNodeLoadBalancerUtilizationDataPoint adds a data point to nsx.node.load_balancer.utilization metric. -func (mb *MetricsBuilder) RecordNsxNodeLoadBalancerUtilizationDataPoint(ts pcommon.Timestamp, val float64, loadBalancerAttributeValue string) { - mb.metricNsxNodeLoadBalancerUtilization.recordDataPoint(mb.startTime, ts, val, loadBalancerAttributeValue) +func (mb *MetricsBuilder) RecordNsxNodeDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64) { + mb.metricNsxNodeDiskUtilization.recordDataPoint(mb.startTime, ts, val) } // RecordNsxNodeMemoryUsageDataPoint adds a data point to nsx.node.memory.usage metric. @@ -727,20 +688,20 @@ func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { // Attributes contains the possible metric attributes that can be used. var Attributes = struct { - // CPUProcessClass (The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes) + // CPUProcessClass (The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes.) CPUProcessClass string - // Direction (The direction of network flow) + // Direction (The direction of network flow.) Direction string - // Disk (The name of the mounted storage) - Disk string - // LoadBalancer (The name of the load balancer being utilized) + // DiskState (The state of storage space.) + DiskState string + // LoadBalancer (The name of the load balancer being utilized.) LoadBalancer string - // PacketType (The type of packet counter) + // PacketType (The type of packet counter.) PacketType string }{ "cpu.process.class", "direction", - "disk", + "state", "load_balancer", "type", } diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index e0f50a4216bc..a24654671d82 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -21,27 +21,30 @@ resource_attributes: attributes: direction: value: direction - description: The direction of network flow + description: The direction of network flow. enum: - received - transmitted - disk: - value: disk - description: The name of the mounted storage + disk_state: + value: state + description: The state of storage space. + enum: + - used + - available packet.type: value: type - description: The type of packet counter + description: The type of packet counter. enum: - dropped - errored - success cpu.process.class: - description: The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes + description: The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes. enum: - datapath - services load_balancer: - description: The name of the load balancer being utilized + description: The name of the load balancer being utilized. metrics: nsx.interface.throughput: @@ -75,7 +78,6 @@ metrics: gauge: value_type: double enabled: true - attributes: [disk] nsx.node.disk.usage: description: The amount of storage space used by the node. unit: By @@ -84,14 +86,7 @@ metrics: value_type: int aggregation: cumulative enabled: true - attributes: [disk] - nsx.node.load_balancer.utilization: - description: The utilization of load balancers by the node - unit: "%" - gauge: - value_type: double - enabled: true - attributes: [load_balancer] + attributes: [disk_state] nsx.node.memory.usage: description: The memory usage of the node unit: KBy diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index df4f8816bbfc..4309a3244d70 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -238,12 +238,11 @@ func (s *scraper) recordNode( s.mb.RecordNsxNodeCacheMemoryUsageDataPoint(colTime, int64(ss.EdgeMemUsage.CacheUsage)) } - for _, fs := range ss.FileSystems { - s.mb.RecordNsxNodeDiskUsageDataPoint(colTime, int64(fs.Used), fs.Mount) - // ensure the prevention of division by 0 using math.Max - diskUtilization := float64(fs.Used) / math.Max(float64(fs.Total), 1) * 100 - s.mb.RecordNsxNodeDiskUtilizationDataPoint(colTime, diskUtilization, fs.Mount) - } + s.mb.RecordNsxNodeDiskUsageDataPoint(colTime, int64(ss.DiskSpaceUsed), metadata.AttributeDiskStateUsed) + availableStorage := ss.DiskSpaceTotal - ss.DiskSpaceUsed + s.mb.RecordNsxNodeDiskUsageDataPoint(colTime, int64(availableStorage), metadata.AttributeDiskStateAvailable) + // ensure division by zero is safeguarded + s.mb.RecordNsxNodeDiskUtilizationDataPoint(colTime, float64(ss.DiskSpaceUsed)/float64(math.Max(float64(ss.DiskSpaceTotal), 1))) s.mb.EmitForResource( metadata.WithNsxNodeName(info.nodeProps.Name), diff --git a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json index 5b2279f65e33..e53701906867 100644 --- a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json @@ -44,8 +44,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -63,8 +63,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -82,8 +82,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "63594238" }, { @@ -101,8 +101,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -120,8 +120,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -139,8 +139,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -163,8 +163,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "4161088074" }, { @@ -176,8 +176,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -233,8 +233,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -252,8 +252,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -271,8 +271,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "63594238" }, { @@ -290,8 +290,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -309,8 +309,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -328,8 +328,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -352,8 +352,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "4161088074" }, { @@ -365,8 +365,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -414,8 +414,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "8" } ], @@ -437,8 +437,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 0.01 }, { @@ -450,8 +450,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 4.34 } ] @@ -466,184 +466,28 @@ { "attributes": [ { - "key": "disk", + "key": "state", "value": { - "stringValue": "/" + "stringValue": "used" } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "6344" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "1092" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/opt" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "704" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "868" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/tmp" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "16" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/iofilters" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "0" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/shm" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { "attributes": [ { - "key": "disk", + "key": "state", "value": { - "stringValue": "/var/run/crx" + "stringValue": "available" } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/vmware/configstore" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "272" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/configstore/backup" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "272" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/vsantraces" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "270116" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/hostd/stats" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "5456" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/nsx/nestdb/db" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "6344" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/nsx-idps/rules" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "7584" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" @@ -656,186 +500,9 @@ "gauge": { "dataPoints": [ { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 19.3603515625 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 3.80859375 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/opt" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 2.1484375 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 1.7659505208333333 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/tmp" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.006103515625 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/iofilters" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/shm" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/crx" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/vmware/configstore" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.830078125 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/configstore/backup" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.830078125 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/vsantraces" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 87.92838541666667 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/hostd/stats" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.25952873843156354 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/nsx/nestdb/db" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 1.21002197265625 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/nsx-idps/rules" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 11.572265625 } ] } @@ -847,8 +514,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "89169108" } ], @@ -903,8 +570,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -922,8 +589,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -941,8 +608,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "63594238" }, { @@ -960,8 +627,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -979,8 +646,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -998,8 +665,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -1022,8 +689,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "4161088074" }, { @@ -1035,8 +702,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -1092,8 +759,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1111,8 +778,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1130,8 +797,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "63594238" }, { @@ -1149,8 +816,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1168,8 +835,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1187,8 +854,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -1211,8 +878,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "4161088074" }, { @@ -1224,8 +891,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" } ], @@ -1273,8 +940,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "8" } ], @@ -1296,8 +963,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 0.01 }, { @@ -1309,8 +976,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 4.34 } ] @@ -1325,184 +992,28 @@ { "attributes": [ { - "key": "disk", - "value": { - "stringValue": "/" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "6344" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "1092" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/opt" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "704" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "868" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/tmp" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "24" - }, - { - "attributes": [ - { - "key": "disk", + "key": "state", "value": { - "stringValue": "/var/run/iofilters" + "stringValue": "used" } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { "attributes": [ { - "key": "disk", + "key": "state", "value": { - "stringValue": "/var/run/shm" + "stringValue": "available" } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/crx" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "0" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/vmware/configstore" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "276" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/configstore/backup" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "276" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/vsantraces" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "273024" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/hostd/stats" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "5904" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/nsx/nestdb/db" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "7652" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/nsx-idps/rules" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "7584" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" @@ -1515,186 +1026,9 @@ "gauge": { "dataPoints": [ { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 19.3603515625 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 3.80859375 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/opt" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 2.1484375 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 1.7659505208333333 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/tmp" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.0091552734375 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/iofilters" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/shm" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/run/crx" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/vmware/configstore" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.84228515625 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/configstore/backup" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.84228515625 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/vsantraces" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 88.875 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/hostd/stats" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.280839016074038 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/lib/vmware/nsx/nestdb/db" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 1.459503173828125 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/etc/nsx-idps/rules" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 11.572265625 } ] } @@ -1706,8 +1040,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "143728936" } ], @@ -1762,8 +1096,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "288" }, { @@ -1781,8 +1115,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1800,8 +1134,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "12483778397" }, { @@ -1819,8 +1153,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1838,8 +1172,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1857,8 +1191,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "12313320048" } ], @@ -1881,8 +1215,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "2837237037443" }, { @@ -1894,8 +1228,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "5877910030884" } ], @@ -1951,8 +1285,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "288" }, { @@ -1970,8 +1304,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -1989,8 +1323,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "12483778397" }, { @@ -2008,8 +1342,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -2027,8 +1361,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "0" }, { @@ -2046,8 +1380,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "12313320048" } ], @@ -2070,8 +1404,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "2837237037443" }, { @@ -2083,8 +1417,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "5877910030884" } ], @@ -2140,8 +1474,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 0 }, { @@ -2153,8 +1487,8 @@ } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asDouble": 0 } ] @@ -2169,197 +1503,28 @@ { "attributes": [ { - "key": "disk", - "value": { - "stringValue": "/dev" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "0" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/run" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "6612" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "7075020" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/dev/shm" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "6436" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/run/lock" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "0" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/sys/fs/cgroup" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "0" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/log" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "9788208" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/nonconfig" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "2280724" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/repository" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "5876104" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/tmp" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "15708" - }, - { - "attributes": [ - { - "key": "disk", + "key": "state", "value": { - "stringValue": "/var/dump" + "stringValue": "used" } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "902516" + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", + "asInt": "26168032" }, { "attributes": [ { - "key": "disk", + "key": "state", "value": { - "stringValue": "/config" + "stringValue": "available" } } ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "166988" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/boot" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "8424" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/image" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "54340" - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/run/user/1007" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asInt": "0" + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", + "asInt": "237014124" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" @@ -2372,199 +1537,9 @@ "gauge": { "dataPoints": [ { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/dev" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/run" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.26797134506052456 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 66.21743141110211 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/dev/shm" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.052167766869415225 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/run/lock" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/sys/fs/cgroup" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/log" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 34.81667425730868 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/nonconfig" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 2.2126377725298423 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/repository" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 18.184516721289395 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/tmp" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.4064022585492464 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/var/dump" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 9.30463398641599 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/config" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.5502299137810142 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/boot" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.8718114304165321 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/image" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0.12318272609130737 - }, - { - "attributes": [ - { - "key": "disk", - "value": { - "stringValue": "/run/user/1007" - } - } - ], - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", - "asDouble": 0 + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", + "asDouble": 0.09942935492936687 } ] } @@ -2576,8 +1551,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1651607561315379000", - "timeUnixNano": "1651607561316127000", + "startTimeUnixNano": "1652116984525125000", + "timeUnixNano": "1652116984539549000", "asInt": "19636300" } ], @@ -2589,4 +1564,4 @@ ] } ] -} +} \ No newline at end of file From 70c254c3e1517f590135f24a82dfe9a160ce827e Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 13:49:17 -0400 Subject: [PATCH 37/48] remove unnecessary conversion --- receiver/nsxtreceiver/scraper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index 4309a3244d70..5f2a3df28791 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -242,7 +242,7 @@ func (s *scraper) recordNode( availableStorage := ss.DiskSpaceTotal - ss.DiskSpaceUsed s.mb.RecordNsxNodeDiskUsageDataPoint(colTime, int64(availableStorage), metadata.AttributeDiskStateAvailable) // ensure division by zero is safeguarded - s.mb.RecordNsxNodeDiskUtilizationDataPoint(colTime, float64(ss.DiskSpaceUsed)/float64(math.Max(float64(ss.DiskSpaceTotal), 1))) + s.mb.RecordNsxNodeDiskUtilizationDataPoint(colTime, float64(ss.DiskSpaceUsed)/math.Max(float64(ss.DiskSpaceTotal), 1)) s.mb.EmitForResource( metadata.WithNsxNodeName(info.nodeProps.Name), From 1d80dde7e19cdb15016f95989b00fd8750a3907e Mon Sep 17 00:00:00 2001 From: schmikei Date: Mon, 9 May 2022 15:45:22 -0400 Subject: [PATCH 38/48] PR feedback --- receiver/nsxtreceiver/README.md | 2 +- receiver/nsxtreceiver/documentation.md | 22 +- .../internal/metadata/generated_metrics_v2.go | 274 ++++++------- receiver/nsxtreceiver/metadata.yaml | 22 +- receiver/nsxtreceiver/scraper.go | 79 ++-- receiver/nsxtreceiver/scraper_test.go | 15 - .../testdata/metrics/expected_metrics.json | 366 +++++++++--------- 7 files changed, 375 insertions(+), 405 deletions(-) diff --git a/receiver/nsxtreceiver/README.md b/receiver/nsxtreceiver/README.md index cb5c9ece76d3..43b479db63e9 100644 --- a/receiver/nsxtreceiver/README.md +++ b/receiver/nsxtreceiver/README.md @@ -4,7 +4,7 @@ This receiver fetches metrics important to run virtual networking using NSX-T. T Supported pipeline types: `metrics` -> :construction: This receiver is in **BETA**. Configuration fields and metric data model are subject to change. +> :construction: This receiver is in **ALPHA**. Configuration fields and metric data model are subject to change. ## Purpose diff --git a/receiver/nsxtreceiver/documentation.md b/receiver/nsxtreceiver/documentation.md index e320adfeb8fc..e6c2fc25f71f 100644 --- a/receiver/nsxtreceiver/documentation.md +++ b/receiver/nsxtreceiver/documentation.md @@ -8,13 +8,13 @@ These are the metrics available for this scraper. | Name | Description | Unit | Type | Attributes | | ---- | ----------- | ---- | ---- | ---------- | -| **nsx.interface.packet.count** | The number of packets flowing through the network interface on the node. | {packets} | Sum(Int) |
  • direction
  • packet.type
| -| **nsx.interface.throughput** | The number of Bytes flowing through the network interface. | By | Sum(Int) |
  • direction
| -| **nsx.node.cache.memory.usage** | The memory usage of the node's cache | KBy | Sum(Int) |
| -| **nsx.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • cpu.process.class
| -| **nsx.node.disk.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk_state
| -| **nsx.node.disk.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
| -| **nsx.node.memory.usage** | The memory usage of the node | KBy | Sum(Int) |
| +| **nsxt.interface.packet.count** | The number of packets flowing through the network interface on the node. | {packets} | Sum(Int) |
  • direction
  • packet.type
| +| **nsxt.interface.throughput** | The number of Bytes flowing through the network interface. | By | Sum(Int) |
  • direction
| +| **nsxt.node.cache.memory.usage** | The memory usage of the node's cache | KBy | Sum(Int) |
| +| **nsxt.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • cpu.process.class
| +| **nsxt.node.disk.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk_state
| +| **nsxt.node.disk.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
| +| **nsxt.node.memory.usage** | The memory usage of the node | KBy | Sum(Int) |
| **Highlighted metrics** are emitted by default. Other metrics are optional and not emitted by default. Any metric can be enabled or disabled with the following scraper configuration: @@ -29,10 +29,10 @@ metrics: | Name | Description | Type | | ---- | ----------- | ---- | -| nsx.interface.id | The name of the network interface. | String | -| nsx.node.id | The ID of the NSX Node. | String | -| nsx.node.name | The name of the NSX Node. | String | -| nsx.node.type | The type of NSX Node. | String | +| nsxt.interface.id | The name of the network interface. | String | +| nsxt.node.id | The ID of the NSX Node. | String | +| nsxt.node.name | The name of the NSX Node. | String | +| nsxt.node.type | The type of NSX Node. | String | ## Metric attributes diff --git a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go index 25a3925d20b7..8f09ab68d9e8 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go @@ -16,36 +16,36 @@ type MetricSettings struct { // MetricsSettings provides settings for nsxtreceiver metrics. type MetricsSettings struct { - NsxInterfacePacketCount MetricSettings `mapstructure:"nsx.interface.packet.count"` - NsxInterfaceThroughput MetricSettings `mapstructure:"nsx.interface.throughput"` - NsxNodeCacheMemoryUsage MetricSettings `mapstructure:"nsx.node.cache.memory.usage"` - NsxNodeCPUUtilization MetricSettings `mapstructure:"nsx.node.cpu.utilization"` - NsxNodeDiskUsage MetricSettings `mapstructure:"nsx.node.disk.usage"` - NsxNodeDiskUtilization MetricSettings `mapstructure:"nsx.node.disk.utilization"` - NsxNodeMemoryUsage MetricSettings `mapstructure:"nsx.node.memory.usage"` + NsxtInterfacePacketCount MetricSettings `mapstructure:"nsxt.interface.packet.count"` + NsxtInterfaceThroughput MetricSettings `mapstructure:"nsxt.interface.throughput"` + NsxtNodeCacheMemoryUsage MetricSettings `mapstructure:"nsxt.node.cache.memory.usage"` + NsxtNodeCPUUtilization MetricSettings `mapstructure:"nsxt.node.cpu.utilization"` + NsxtNodeDiskUsage MetricSettings `mapstructure:"nsxt.node.disk.usage"` + NsxtNodeDiskUtilization MetricSettings `mapstructure:"nsxt.node.disk.utilization"` + NsxtNodeMemoryUsage MetricSettings `mapstructure:"nsxt.node.memory.usage"` } func DefaultMetricsSettings() MetricsSettings { return MetricsSettings{ - NsxInterfacePacketCount: MetricSettings{ + NsxtInterfacePacketCount: MetricSettings{ Enabled: true, }, - NsxInterfaceThroughput: MetricSettings{ + NsxtInterfaceThroughput: MetricSettings{ Enabled: true, }, - NsxNodeCacheMemoryUsage: MetricSettings{ + NsxtNodeCacheMemoryUsage: MetricSettings{ Enabled: true, }, - NsxNodeCPUUtilization: MetricSettings{ + NsxtNodeCPUUtilization: MetricSettings{ Enabled: true, }, - NsxNodeDiskUsage: MetricSettings{ + NsxtNodeDiskUsage: MetricSettings{ Enabled: true, }, - NsxNodeDiskUtilization: MetricSettings{ + NsxtNodeDiskUtilization: MetricSettings{ Enabled: true, }, - NsxNodeMemoryUsage: MetricSettings{ + NsxtNodeMemoryUsage: MetricSettings{ Enabled: true, }, } @@ -159,15 +159,15 @@ var MapAttributePacketType = map[string]AttributePacketType{ "success": AttributePacketTypeSuccess, } -type metricNsxInterfacePacketCount struct { +type metricNsxtInterfacePacketCount struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.interface.packet.count metric with initial data. -func (m *metricNsxInterfacePacketCount) init() { - m.data.SetName("nsx.interface.packet.count") +// init fills nsxt.interface.packet.count metric with initial data. +func (m *metricNsxtInterfacePacketCount) init() { + m.data.SetName("nsxt.interface.packet.count") m.data.SetDescription("The number of packets flowing through the network interface on the node.") m.data.SetUnit("{packets}") m.data.SetDataType(pmetric.MetricDataTypeSum) @@ -176,7 +176,7 @@ func (m *metricNsxInterfacePacketCount) init() { m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxInterfacePacketCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string, packetTypeAttributeValue string) { +func (m *metricNsxtInterfacePacketCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string, packetTypeAttributeValue string) { if !m.settings.Enabled { return } @@ -189,14 +189,14 @@ func (m *metricNsxInterfacePacketCount) recordDataPoint(start pcommon.Timestamp, } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxInterfacePacketCount) updateCapacity() { +func (m *metricNsxtInterfacePacketCount) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxInterfacePacketCount) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtInterfacePacketCount) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -204,8 +204,8 @@ func (m *metricNsxInterfacePacketCount) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxInterfacePacketCount(settings MetricSettings) metricNsxInterfacePacketCount { - m := metricNsxInterfacePacketCount{settings: settings} +func newMetricNsxtInterfacePacketCount(settings MetricSettings) metricNsxtInterfacePacketCount { + m := metricNsxtInterfacePacketCount{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -213,15 +213,15 @@ func newMetricNsxInterfacePacketCount(settings MetricSettings) metricNsxInterfac return m } -type metricNsxInterfaceThroughput struct { +type metricNsxtInterfaceThroughput struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.interface.throughput metric with initial data. -func (m *metricNsxInterfaceThroughput) init() { - m.data.SetName("nsx.interface.throughput") +// init fills nsxt.interface.throughput metric with initial data. +func (m *metricNsxtInterfaceThroughput) init() { + m.data.SetName("nsxt.interface.throughput") m.data.SetDescription("The number of Bytes flowing through the network interface.") m.data.SetUnit("By") m.data.SetDataType(pmetric.MetricDataTypeSum) @@ -230,7 +230,7 @@ func (m *metricNsxInterfaceThroughput) init() { m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { +func (m *metricNsxtInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { if !m.settings.Enabled { return } @@ -242,14 +242,14 @@ func (m *metricNsxInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxInterfaceThroughput) updateCapacity() { +func (m *metricNsxtInterfaceThroughput) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxInterfaceThroughput) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtInterfaceThroughput) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -257,8 +257,8 @@ func (m *metricNsxInterfaceThroughput) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxInterfaceThroughput(settings MetricSettings) metricNsxInterfaceThroughput { - m := metricNsxInterfaceThroughput{settings: settings} +func newMetricNsxtInterfaceThroughput(settings MetricSettings) metricNsxtInterfaceThroughput { + m := metricNsxtInterfaceThroughput{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -266,15 +266,15 @@ func newMetricNsxInterfaceThroughput(settings MetricSettings) metricNsxInterface return m } -type metricNsxNodeCacheMemoryUsage struct { +type metricNsxtNodeCacheMemoryUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.cache.memory.usage metric with initial data. -func (m *metricNsxNodeCacheMemoryUsage) init() { - m.data.SetName("nsx.node.cache.memory.usage") +// init fills nsxt.node.cache.memory.usage metric with initial data. +func (m *metricNsxtNodeCacheMemoryUsage) init() { + m.data.SetName("nsxt.node.cache.memory.usage") m.data.SetDescription("The memory usage of the node's cache") m.data.SetUnit("KBy") m.data.SetDataType(pmetric.MetricDataTypeSum) @@ -282,7 +282,7 @@ func (m *metricNsxNodeCacheMemoryUsage) init() { m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) } -func (m *metricNsxNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { +func (m *metricNsxtNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { if !m.settings.Enabled { return } @@ -293,14 +293,14 @@ func (m *metricNsxNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeCacheMemoryUsage) updateCapacity() { +func (m *metricNsxtNodeCacheMemoryUsage) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -308,8 +308,8 @@ func (m *metricNsxNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxNodeCacheMemoryUsage(settings MetricSettings) metricNsxNodeCacheMemoryUsage { - m := metricNsxNodeCacheMemoryUsage{settings: settings} +func newMetricNsxtNodeCacheMemoryUsage(settings MetricSettings) metricNsxtNodeCacheMemoryUsage { + m := metricNsxtNodeCacheMemoryUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -317,22 +317,22 @@ func newMetricNsxNodeCacheMemoryUsage(settings MetricSettings) metricNsxNodeCach return m } -type metricNsxNodeCPUUtilization struct { +type metricNsxtNodeCPUUtilization struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.cpu.utilization metric with initial data. -func (m *metricNsxNodeCPUUtilization) init() { - m.data.SetName("nsx.node.cpu.utilization") +// init fills nsxt.node.cpu.utilization metric with initial data. +func (m *metricNsxtNodeCPUUtilization) init() { + m.data.SetName("nsxt.node.cpu.utilization") m.data.SetDescription("The average amount of CPU being used by the node.") m.data.SetUnit("%") m.data.SetDataType(pmetric.MetricDataTypeGauge) m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { +func (m *metricNsxtNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { if !m.settings.Enabled { return } @@ -344,14 +344,14 @@ func (m *metricNsxNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, t } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeCPUUtilization) updateCapacity() { +func (m *metricNsxtNodeCPUUtilization) updateCapacity() { if m.data.Gauge().DataPoints().Len() > m.capacity { m.capacity = m.data.Gauge().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -359,8 +359,8 @@ func (m *metricNsxNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxNodeCPUUtilization(settings MetricSettings) metricNsxNodeCPUUtilization { - m := metricNsxNodeCPUUtilization{settings: settings} +func newMetricNsxtNodeCPUUtilization(settings MetricSettings) metricNsxtNodeCPUUtilization { + m := metricNsxtNodeCPUUtilization{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -368,15 +368,15 @@ func newMetricNsxNodeCPUUtilization(settings MetricSettings) metricNsxNodeCPUUti return m } -type metricNsxNodeDiskUsage struct { +type metricNsxtNodeDiskUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.disk.usage metric with initial data. -func (m *metricNsxNodeDiskUsage) init() { - m.data.SetName("nsx.node.disk.usage") +// init fills nsxt.node.disk.usage metric with initial data. +func (m *metricNsxtNodeDiskUsage) init() { + m.data.SetName("nsxt.node.disk.usage") m.data.SetDescription("The amount of storage space used by the node.") m.data.SetUnit("By") m.data.SetDataType(pmetric.MetricDataTypeSum) @@ -385,7 +385,7 @@ func (m *metricNsxNodeDiskUsage) init() { m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskStateAttributeValue string) { +func (m *metricNsxtNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskStateAttributeValue string) { if !m.settings.Enabled { return } @@ -397,14 +397,14 @@ func (m *metricNsxNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pco } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeDiskUsage) updateCapacity() { +func (m *metricNsxtNodeDiskUsage) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeDiskUsage) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeDiskUsage) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -412,8 +412,8 @@ func (m *metricNsxNodeDiskUsage) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxNodeDiskUsage(settings MetricSettings) metricNsxNodeDiskUsage { - m := metricNsxNodeDiskUsage{settings: settings} +func newMetricNsxtNodeDiskUsage(settings MetricSettings) metricNsxtNodeDiskUsage { + m := metricNsxtNodeDiskUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -421,21 +421,21 @@ func newMetricNsxNodeDiskUsage(settings MetricSettings) metricNsxNodeDiskUsage { return m } -type metricNsxNodeDiskUtilization struct { +type metricNsxtNodeDiskUtilization struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.disk.utilization metric with initial data. -func (m *metricNsxNodeDiskUtilization) init() { - m.data.SetName("nsx.node.disk.utilization") +// init fills nsxt.node.disk.utilization metric with initial data. +func (m *metricNsxtNodeDiskUtilization) init() { + m.data.SetName("nsxt.node.disk.utilization") m.data.SetDescription("The percentage of storage space utilized.") m.data.SetUnit("%") m.data.SetDataType(pmetric.MetricDataTypeGauge) } -func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) { +func (m *metricNsxtNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) { if !m.settings.Enabled { return } @@ -446,14 +446,14 @@ func (m *metricNsxNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeDiskUtilization) updateCapacity() { +func (m *metricNsxtNodeDiskUtilization) updateCapacity() { if m.data.Gauge().DataPoints().Len() > m.capacity { m.capacity = m.data.Gauge().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeDiskUtilization) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeDiskUtilization) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -461,8 +461,8 @@ func (m *metricNsxNodeDiskUtilization) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxNodeDiskUtilization(settings MetricSettings) metricNsxNodeDiskUtilization { - m := metricNsxNodeDiskUtilization{settings: settings} +func newMetricNsxtNodeDiskUtilization(settings MetricSettings) metricNsxtNodeDiskUtilization { + m := metricNsxtNodeDiskUtilization{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -470,15 +470,15 @@ func newMetricNsxNodeDiskUtilization(settings MetricSettings) metricNsxNodeDiskU return m } -type metricNsxNodeMemoryUsage struct { +type metricNsxtNodeMemoryUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsx.node.memory.usage metric with initial data. -func (m *metricNsxNodeMemoryUsage) init() { - m.data.SetName("nsx.node.memory.usage") +// init fills nsxt.node.memory.usage metric with initial data. +func (m *metricNsxtNodeMemoryUsage) init() { + m.data.SetName("nsxt.node.memory.usage") m.data.SetDescription("The memory usage of the node") m.data.SetUnit("KBy") m.data.SetDataType(pmetric.MetricDataTypeSum) @@ -486,7 +486,7 @@ func (m *metricNsxNodeMemoryUsage) init() { m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) } -func (m *metricNsxNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { +func (m *metricNsxtNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { if !m.settings.Enabled { return } @@ -497,14 +497,14 @@ func (m *metricNsxNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts p } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxNodeMemoryUsage) updateCapacity() { +func (m *metricNsxtNodeMemoryUsage) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -512,8 +512,8 @@ func (m *metricNsxNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxNodeMemoryUsage(settings MetricSettings) metricNsxNodeMemoryUsage { - m := metricNsxNodeMemoryUsage{settings: settings} +func newMetricNsxtNodeMemoryUsage(settings MetricSettings) metricNsxtNodeMemoryUsage { + m := metricNsxtNodeMemoryUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -524,17 +524,17 @@ func newMetricNsxNodeMemoryUsage(settings MetricSettings) metricNsxNodeMemoryUsa // MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations // required to produce metric representation defined in metadata and user settings. type MetricsBuilder struct { - startTime pcommon.Timestamp // start time that will be applied to all recorded data points. - metricsCapacity int // maximum observed number of metrics per resource. - resourceCapacity int // maximum observed number of resource attributes. - metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. - metricNsxInterfacePacketCount metricNsxInterfacePacketCount - metricNsxInterfaceThroughput metricNsxInterfaceThroughput - metricNsxNodeCacheMemoryUsage metricNsxNodeCacheMemoryUsage - metricNsxNodeCPUUtilization metricNsxNodeCPUUtilization - metricNsxNodeDiskUsage metricNsxNodeDiskUsage - metricNsxNodeDiskUtilization metricNsxNodeDiskUtilization - metricNsxNodeMemoryUsage metricNsxNodeMemoryUsage + startTime pcommon.Timestamp // start time that will be applied to all recorded data points. + metricsCapacity int // maximum observed number of metrics per resource. + resourceCapacity int // maximum observed number of resource attributes. + metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. + metricNsxtInterfacePacketCount metricNsxtInterfacePacketCount + metricNsxtInterfaceThroughput metricNsxtInterfaceThroughput + metricNsxtNodeCacheMemoryUsage metricNsxtNodeCacheMemoryUsage + metricNsxtNodeCPUUtilization metricNsxtNodeCPUUtilization + metricNsxtNodeDiskUsage metricNsxtNodeDiskUsage + metricNsxtNodeDiskUtilization metricNsxtNodeDiskUtilization + metricNsxtNodeMemoryUsage metricNsxtNodeMemoryUsage } // metricBuilderOption applies changes to default metrics builder. @@ -549,15 +549,15 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ - startTime: pcommon.NewTimestampFromTime(time.Now()), - metricsBuffer: pmetric.NewMetrics(), - metricNsxInterfacePacketCount: newMetricNsxInterfacePacketCount(settings.NsxInterfacePacketCount), - metricNsxInterfaceThroughput: newMetricNsxInterfaceThroughput(settings.NsxInterfaceThroughput), - metricNsxNodeCacheMemoryUsage: newMetricNsxNodeCacheMemoryUsage(settings.NsxNodeCacheMemoryUsage), - metricNsxNodeCPUUtilization: newMetricNsxNodeCPUUtilization(settings.NsxNodeCPUUtilization), - metricNsxNodeDiskUsage: newMetricNsxNodeDiskUsage(settings.NsxNodeDiskUsage), - metricNsxNodeDiskUtilization: newMetricNsxNodeDiskUtilization(settings.NsxNodeDiskUtilization), - metricNsxNodeMemoryUsage: newMetricNsxNodeMemoryUsage(settings.NsxNodeMemoryUsage), + startTime: pcommon.NewTimestampFromTime(time.Now()), + metricsBuffer: pmetric.NewMetrics(), + metricNsxtInterfacePacketCount: newMetricNsxtInterfacePacketCount(settings.NsxtInterfacePacketCount), + metricNsxtInterfaceThroughput: newMetricNsxtInterfaceThroughput(settings.NsxtInterfaceThroughput), + metricNsxtNodeCacheMemoryUsage: newMetricNsxtNodeCacheMemoryUsage(settings.NsxtNodeCacheMemoryUsage), + metricNsxtNodeCPUUtilization: newMetricNsxtNodeCPUUtilization(settings.NsxtNodeCPUUtilization), + metricNsxtNodeDiskUsage: newMetricNsxtNodeDiskUsage(settings.NsxtNodeDiskUsage), + metricNsxtNodeDiskUtilization: newMetricNsxtNodeDiskUtilization(settings.NsxtNodeDiskUtilization), + metricNsxtNodeMemoryUsage: newMetricNsxtNodeMemoryUsage(settings.NsxtNodeMemoryUsage), } for _, op := range options { op(mb) @@ -578,31 +578,31 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { // ResourceOption applies changes to provided resource. type ResourceOption func(pcommon.Resource) -// WithNsxInterfaceID sets provided value as "nsx.interface.id" attribute for current resource. -func WithNsxInterfaceID(val string) ResourceOption { +// WithNsxtInterfaceID sets provided value as "nsxt.interface.id" attribute for current resource. +func WithNsxtInterfaceID(val string) ResourceOption { return func(r pcommon.Resource) { - r.Attributes().UpsertString("nsx.interface.id", val) + r.Attributes().UpsertString("nsxt.interface.id", val) } } -// WithNsxNodeID sets provided value as "nsx.node.id" attribute for current resource. -func WithNsxNodeID(val string) ResourceOption { +// WithNsxtNodeID sets provided value as "nsxt.node.id" attribute for current resource. +func WithNsxtNodeID(val string) ResourceOption { return func(r pcommon.Resource) { - r.Attributes().UpsertString("nsx.node.id", val) + r.Attributes().UpsertString("nsxt.node.id", val) } } -// WithNsxNodeName sets provided value as "nsx.node.name" attribute for current resource. -func WithNsxNodeName(val string) ResourceOption { +// WithNsxtNodeName sets provided value as "nsxt.node.name" attribute for current resource. +func WithNsxtNodeName(val string) ResourceOption { return func(r pcommon.Resource) { - r.Attributes().UpsertString("nsx.node.name", val) + r.Attributes().UpsertString("nsxt.node.name", val) } } -// WithNsxNodeType sets provided value as "nsx.node.type" attribute for current resource. -func WithNsxNodeType(val string) ResourceOption { +// WithNsxtNodeType sets provided value as "nsxt.node.type" attribute for current resource. +func WithNsxtNodeType(val string) ResourceOption { return func(r pcommon.Resource) { - r.Attributes().UpsertString("nsx.node.type", val) + r.Attributes().UpsertString("nsxt.node.type", val) } } @@ -619,13 +619,13 @@ func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption) { ils := rm.ScopeMetrics().AppendEmpty() ils.Scope().SetName("otelcol/nsxtreceiver") ils.Metrics().EnsureCapacity(mb.metricsCapacity) - mb.metricNsxInterfacePacketCount.emit(ils.Metrics()) - mb.metricNsxInterfaceThroughput.emit(ils.Metrics()) - mb.metricNsxNodeCacheMemoryUsage.emit(ils.Metrics()) - mb.metricNsxNodeCPUUtilization.emit(ils.Metrics()) - mb.metricNsxNodeDiskUsage.emit(ils.Metrics()) - mb.metricNsxNodeDiskUtilization.emit(ils.Metrics()) - mb.metricNsxNodeMemoryUsage.emit(ils.Metrics()) + mb.metricNsxtInterfacePacketCount.emit(ils.Metrics()) + mb.metricNsxtInterfaceThroughput.emit(ils.Metrics()) + mb.metricNsxtNodeCacheMemoryUsage.emit(ils.Metrics()) + mb.metricNsxtNodeCPUUtilization.emit(ils.Metrics()) + mb.metricNsxtNodeDiskUsage.emit(ils.Metrics()) + mb.metricNsxtNodeDiskUtilization.emit(ils.Metrics()) + mb.metricNsxtNodeMemoryUsage.emit(ils.Metrics()) if ils.Metrics().Len() > 0 { mb.updateCapacity(rm) rm.MoveTo(mb.metricsBuffer.ResourceMetrics().AppendEmpty()) @@ -642,39 +642,39 @@ func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics { return metrics } -// RecordNsxInterfacePacketCountDataPoint adds a data point to nsx.interface.packet.count metric. -func (mb *MetricsBuilder) RecordNsxInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection, packetTypeAttributeValue AttributePacketType) { - mb.metricNsxInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String(), packetTypeAttributeValue.String()) +// RecordNsxtInterfacePacketCountDataPoint adds a data point to nsxt.interface.packet.count metric. +func (mb *MetricsBuilder) RecordNsxtInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection, packetTypeAttributeValue AttributePacketType) { + mb.metricNsxtInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String(), packetTypeAttributeValue.String()) } -// RecordNsxInterfaceThroughputDataPoint adds a data point to nsx.interface.throughput metric. -func (mb *MetricsBuilder) RecordNsxInterfaceThroughputDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection) { - mb.metricNsxInterfaceThroughput.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String()) +// RecordNsxtInterfaceThroughputDataPoint adds a data point to nsxt.interface.throughput metric. +func (mb *MetricsBuilder) RecordNsxtInterfaceThroughputDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection) { + mb.metricNsxtInterfaceThroughput.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String()) } -// RecordNsxNodeCacheMemoryUsageDataPoint adds a data point to nsx.node.cache.memory.usage metric. -func (mb *MetricsBuilder) RecordNsxNodeCacheMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { - mb.metricNsxNodeCacheMemoryUsage.recordDataPoint(mb.startTime, ts, val) +// RecordNsxtNodeCacheMemoryUsageDataPoint adds a data point to nsxt.node.cache.memory.usage metric. +func (mb *MetricsBuilder) RecordNsxtNodeCacheMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNsxtNodeCacheMemoryUsage.recordDataPoint(mb.startTime, ts, val) } -// RecordNsxNodeCPUUtilizationDataPoint adds a data point to nsx.node.cpu.utilization metric. -func (mb *MetricsBuilder) RecordNsxNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue AttributeCPUProcessClass) { - mb.metricNsxNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue.String()) +// RecordNsxtNodeCPUUtilizationDataPoint adds a data point to nsxt.node.cpu.utilization metric. +func (mb *MetricsBuilder) RecordNsxtNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue AttributeCPUProcessClass) { + mb.metricNsxtNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue.String()) } -// RecordNsxNodeDiskUsageDataPoint adds a data point to nsx.node.disk.usage metric. -func (mb *MetricsBuilder) RecordNsxNodeDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState) { - mb.metricNsxNodeDiskUsage.recordDataPoint(mb.startTime, ts, val, diskStateAttributeValue.String()) +// RecordNsxtNodeDiskUsageDataPoint adds a data point to nsxt.node.disk.usage metric. +func (mb *MetricsBuilder) RecordNsxtNodeDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState) { + mb.metricNsxtNodeDiskUsage.recordDataPoint(mb.startTime, ts, val, diskStateAttributeValue.String()) } -// RecordNsxNodeDiskUtilizationDataPoint adds a data point to nsx.node.disk.utilization metric. -func (mb *MetricsBuilder) RecordNsxNodeDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64) { - mb.metricNsxNodeDiskUtilization.recordDataPoint(mb.startTime, ts, val) +// RecordNsxtNodeDiskUtilizationDataPoint adds a data point to nsxt.node.disk.utilization metric. +func (mb *MetricsBuilder) RecordNsxtNodeDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64) { + mb.metricNsxtNodeDiskUtilization.recordDataPoint(mb.startTime, ts, val) } -// RecordNsxNodeMemoryUsageDataPoint adds a data point to nsx.node.memory.usage metric. -func (mb *MetricsBuilder) RecordNsxNodeMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { - mb.metricNsxNodeMemoryUsage.recordDataPoint(mb.startTime, ts, val) +// RecordNsxtNodeMemoryUsageDataPoint adds a data point to nsxt.node.memory.usage metric. +func (mb *MetricsBuilder) RecordNsxtNodeMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNsxtNodeMemoryUsage.recordDataPoint(mb.startTime, ts, val) } // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index a24654671d82..90afa9cb3e16 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -1,20 +1,20 @@ name: nsxtreceiver resource_attributes: - nsx.node.name: + nsxt.node.name: description: The name of the NSX Node. type: string - nsx.node.id: + nsxt.node.id: description: The ID of the NSX Node. type: string - nsx.node.type: + nsxt.node.type: description: The type of NSX Node. type: string enum: - manager - host - edge - nsx.interface.id: + nsxt.interface.id: description: The name of the network interface. type: string @@ -47,7 +47,7 @@ attributes: description: The name of the load balancer being utilized. metrics: - nsx.interface.throughput: + nsxt.interface.throughput: description: The number of Bytes flowing through the network interface. unit: "By" sum: @@ -56,7 +56,7 @@ metrics: value_type: int enabled: true attributes: [direction] - nsx.interface.packet.count: + nsxt.interface.packet.count: description: The number of packets flowing through the network interface on the node. unit: "{packets}" sum: @@ -65,20 +65,20 @@ metrics: value_type: int enabled: true attributes: [direction, packet.type] - nsx.node.cpu.utilization: + nsxt.node.cpu.utilization: description: The average amount of CPU being used by the node. unit: "%" gauge: value_type: double enabled: true attributes: [cpu.process.class] - nsx.node.disk.utilization: + nsxt.node.disk.utilization: description: The percentage of storage space utilized. unit: "%" gauge: value_type: double enabled: true - nsx.node.disk.usage: + nsxt.node.disk.usage: description: The amount of storage space used by the node. unit: By sum: @@ -87,7 +87,7 @@ metrics: aggregation: cumulative enabled: true attributes: [disk_state] - nsx.node.memory.usage: + nsxt.node.memory.usage: description: The memory usage of the node unit: KBy sum: @@ -95,7 +95,7 @@ metrics: value_type: int aggregation: cumulative enabled: true - nsx.node.cache.memory.usage: + nsxt.node.cache.memory.usage: description: The memory usage of the node's cache unit: KBy sum: diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index 5f2a3df28791..01ab1c452f5f 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -51,11 +51,11 @@ func newScraper(cfg *Config, settings component.TelemetrySettings) *scraper { func (s *scraper) start(ctx context.Context, host component.Host) error { s.host = host - err := s.ensureClient() - // allow reconnectivity + client, err := newClient(s.config, s.settings, s.host, s.logger) if err != nil { - return fmt.Errorf("unable to ensure client connectivity: %s", err) + return fmt.Errorf("unable to construct http client: %w", err) } + s.client = client return nil } @@ -67,18 +67,14 @@ const ( ) func (s *scraper) scrape(ctx context.Context) (pdata.Metrics, error) { - errs := &scrapererror.ScrapeErrors{} - if err := s.ensureClient(); err != nil { - errs.Add(err) - return pmetric.NewMetrics(), errs.Combine() + r, err := s.retrieve(ctx) + if err != nil { + return pmetric.NewMetrics(), err } - r := s.retrieve(ctx, errs) - colTime := pdata.NewTimestampFromTime(time.Now()) s.process(r, colTime) - - return s.mb.Emit(), errs.Combine() + return s.mb.Emit(), nil } type nodeInfo struct { @@ -93,19 +89,20 @@ type interfaceInformation struct { stats *dm.NetworkInterfaceStats } -func (s *scraper) retrieve(ctx context.Context, errs *scrapererror.ScrapeErrors) []*nodeInfo { +func (s *scraper) retrieve(ctx context.Context) ([]*nodeInfo, error) { r := []*nodeInfo{} + errs := &scrapererror.ScrapeErrors{} tNodes, err := s.client.TransportNodes(ctx) if err != nil { errs.AddPartial(1, err) - return r + return r, errs.Combine() } cNodes, err := s.client.ClusterNodes(ctx) if err != nil { errs.AddPartial(1, err) - return r + return r, errs.Combine() } wg := &sync.WaitGroup{} @@ -141,7 +138,7 @@ func (s *scraper) retrieve(ctx context.Context, errs *scrapererror.ScrapeErrors) wg.Wait() - return r + return r, errs.Combine() } func (s *scraper) retrieveInterfaces( @@ -202,22 +199,22 @@ func (s *scraper) process( } func (s *scraper) recordNodeInterface(colTime pdata.Timestamp, nodeProps dm.NodeProperties, i interfaceInformation) { - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeDropped) - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeErrored) + s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeDropped) + s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeErrored) successRxPackets := i.stats.RxPackets - i.stats.RxDropped - i.stats.RxErrors - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successRxPackets, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeSuccess) + s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, successRxPackets, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeSuccess) - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxDropped, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeDropped) - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, i.stats.TxErrors, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeErrored) + s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.TxDropped, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeDropped) + s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.TxErrors, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeErrored) successTxPackets := i.stats.TxPackets - i.stats.TxDropped - i.stats.TxErrors - s.mb.RecordNsxInterfacePacketCountDataPoint(colTime, successTxPackets, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeSuccess) + s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, successTxPackets, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeSuccess) - s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.RxBytes, metadata.AttributeDirectionReceived) - s.mb.RecordNsxInterfaceThroughputDataPoint(colTime, i.stats.TxBytes, metadata.AttributeDirectionTransmitted) + s.mb.RecordNsxtInterfaceThroughputDataPoint(colTime, i.stats.RxBytes, metadata.AttributeDirectionReceived) + s.mb.RecordNsxtInterfaceThroughputDataPoint(colTime, i.stats.TxBytes, metadata.AttributeDirectionTransmitted) s.mb.EmitForResource( - metadata.WithNsxInterfaceID(i.iFace.InterfaceId), - metadata.WithNsxNodeName(nodeProps.Name), + metadata.WithNsxtInterfaceID(i.iFace.InterfaceId), + metadata.WithNsxtNodeName(nodeProps.Name), ) } @@ -230,39 +227,27 @@ func (s *scraper) recordNode( } ss := info.stats.SystemStatus - s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClassDatapath) - s.mb.RecordNsxNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClassServices) - s.mb.RecordNsxNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) + s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClassDatapath) + s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClassServices) + s.mb.RecordNsxtNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) if ss.EdgeMemUsage != nil { - s.mb.RecordNsxNodeCacheMemoryUsageDataPoint(colTime, int64(ss.EdgeMemUsage.CacheUsage)) + s.mb.RecordNsxtNodeCacheMemoryUsageDataPoint(colTime, int64(ss.EdgeMemUsage.CacheUsage)) } - s.mb.RecordNsxNodeDiskUsageDataPoint(colTime, int64(ss.DiskSpaceUsed), metadata.AttributeDiskStateUsed) + s.mb.RecordNsxtNodeDiskUsageDataPoint(colTime, int64(ss.DiskSpaceUsed), metadata.AttributeDiskStateUsed) availableStorage := ss.DiskSpaceTotal - ss.DiskSpaceUsed - s.mb.RecordNsxNodeDiskUsageDataPoint(colTime, int64(availableStorage), metadata.AttributeDiskStateAvailable) + s.mb.RecordNsxtNodeDiskUsageDataPoint(colTime, int64(availableStorage), metadata.AttributeDiskStateAvailable) // ensure division by zero is safeguarded - s.mb.RecordNsxNodeDiskUtilizationDataPoint(colTime, float64(ss.DiskSpaceUsed)/math.Max(float64(ss.DiskSpaceTotal), 1)) + s.mb.RecordNsxtNodeDiskUtilizationDataPoint(colTime, float64(ss.DiskSpaceUsed)/math.Max(float64(ss.DiskSpaceTotal), 1)) s.mb.EmitForResource( - metadata.WithNsxNodeName(info.nodeProps.Name), - metadata.WithNsxNodeID(info.nodeProps.ID), - metadata.WithNsxNodeType(info.nodeType), + metadata.WithNsxtNodeName(info.nodeProps.Name), + metadata.WithNsxtNodeID(info.nodeProps.ID), + metadata.WithNsxtNodeType(info.nodeType), ) } -func (s *scraper) ensureClient() error { - if s.client != nil { - return nil - } - client, err := newClient(s.config, s.settings, s.host, s.logger.Named("client")) - if err != nil { - return err - } - s.client = client - return nil -} - func clusterNodeType(node dm.ClusterNode) string { if node.ControllerRole != nil { return "controller" diff --git a/receiver/nsxtreceiver/scraper_test.go b/receiver/nsxtreceiver/scraper_test.go index 9edb1174637a..7bdf179d3592 100644 --- a/receiver/nsxtreceiver/scraper_test.go +++ b/receiver/nsxtreceiver/scraper_test.go @@ -74,21 +74,6 @@ func TestScrape(t *testing.T) { require.NoError(t, err) } -func TestScrapeBadConfig(t *testing.T) { - scraper := newScraper( - &Config{ - HTTPClientSettings: confighttp.HTTPClientSettings{ - Endpoint: "http://\x00", - }, - Metrics: metadata.DefaultMetricsSettings(), - }, - componenttest.NewNopTelemetrySettings(), - ) - scraper.host = componenttest.NewNopHost() - _, err := scraper.scrape(context.Background()) - require.Error(t, err) -} - func TestScrapeTransportNodeErrors(t *testing.T) { mockClient := NewMockClient(t) diff --git a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json index e53701906867..80a781a13d9f 100644 --- a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json @@ -4,13 +4,13 @@ "resource": { "attributes": [ { - "key": "nsx.interface.id", + "key": "nsxt.interface.id", "value": { "stringValue": "vmnic0" } }, { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" } @@ -24,7 +24,7 @@ }, "metrics": [ { - "name": "nsx.interface.packet.count", + "name": "nsxt.interface.packet.count", "description": "The number of packets flowing through the network interface on the node.", "unit": "{packets}", "sum": { @@ -44,8 +44,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -63,8 +63,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -82,8 +82,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "63594238" }, { @@ -101,8 +101,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -120,8 +120,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -139,8 +139,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -149,7 +149,7 @@ } }, { - "name": "nsx.interface.throughput", + "name": "nsxt.interface.throughput", "description": "The number of Bytes flowing through the network interface.", "unit": "By", "sum": { @@ -163,8 +163,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "4161088074" }, { @@ -176,8 +176,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -193,13 +193,13 @@ "resource": { "attributes": [ { - "key": "nsx.interface.id", + "key": "nsxt.interface.id", "value": { "stringValue": "vmk10" } }, { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" } @@ -213,7 +213,7 @@ }, "metrics": [ { - "name": "nsx.interface.packet.count", + "name": "nsxt.interface.packet.count", "description": "The number of packets flowing through the network interface on the node.", "unit": "{packets}", "sum": { @@ -233,8 +233,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -252,8 +252,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -271,8 +271,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "63594238" }, { @@ -290,8 +290,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -309,8 +309,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -328,8 +328,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -338,7 +338,7 @@ } }, { - "name": "nsx.interface.throughput", + "name": "nsxt.interface.throughput", "description": "The number of Bytes flowing through the network interface.", "unit": "By", "sum": { @@ -352,8 +352,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "4161088074" }, { @@ -365,8 +365,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -382,19 +382,19 @@ "resource": { "attributes": [ { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" } }, { - "key": "nsx.node.id", + "key": "nsxt.node.id", "value": { "stringValue": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827" } }, { - "key": "nsx.node.type", + "key": "nsxt.node.type", "value": { "stringValue": "transport" } @@ -408,14 +408,14 @@ }, "metrics": [ { - "name": "nsx.node.cache.memory.usage", + "name": "nsxt.node.cache.memory.usage", "description": "The memory usage of the node's cache", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "8" } ], @@ -423,7 +423,7 @@ } }, { - "name": "nsx.node.cpu.utilization", + "name": "nsxt.node.cpu.utilization", "description": "The average amount of CPU being used by the node.", "unit": "%", "gauge": { @@ -437,8 +437,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 0.01 }, { @@ -450,15 +450,15 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 4.34 } ] } }, { - "name": "nsx.node.disk.usage", + "name": "nsxt.node.disk.usage", "description": "The amount of storage space used by the node.", "unit": "By", "sum": { @@ -472,8 +472,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -485,8 +485,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -494,28 +494,28 @@ } }, { - "name": "nsx.node.disk.utilization", + "name": "nsxt.node.disk.utilization", "description": "The percentage of storage space utilized.", "unit": "%", "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 0 } ] } }, { - "name": "nsx.node.memory.usage", + "name": "nsxt.node.memory.usage", "description": "The memory usage of the node", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "89169108" } ], @@ -530,13 +530,13 @@ "resource": { "attributes": [ { - "key": "nsx.interface.id", + "key": "nsxt.interface.id", "value": { "stringValue": "vmnic0" } }, { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" } @@ -550,7 +550,7 @@ }, "metrics": [ { - "name": "nsx.interface.packet.count", + "name": "nsxt.interface.packet.count", "description": "The number of packets flowing through the network interface on the node.", "unit": "{packets}", "sum": { @@ -570,8 +570,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -589,8 +589,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -608,8 +608,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "63594238" }, { @@ -627,8 +627,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -646,8 +646,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -665,8 +665,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -675,7 +675,7 @@ } }, { - "name": "nsx.interface.throughput", + "name": "nsxt.interface.throughput", "description": "The number of Bytes flowing through the network interface.", "unit": "By", "sum": { @@ -689,8 +689,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "4161088074" }, { @@ -702,8 +702,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -719,13 +719,13 @@ "resource": { "attributes": [ { - "key": "nsx.interface.id", + "key": "nsxt.interface.id", "value": { "stringValue": "vmk10" } }, { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" } @@ -739,7 +739,7 @@ }, "metrics": [ { - "name": "nsx.interface.packet.count", + "name": "nsxt.interface.packet.count", "description": "The number of packets flowing through the network interface on the node.", "unit": "{packets}", "sum": { @@ -759,8 +759,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -778,8 +778,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -797,8 +797,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "63594238" }, { @@ -816,8 +816,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -835,8 +835,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -854,8 +854,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -864,7 +864,7 @@ } }, { - "name": "nsx.interface.throughput", + "name": "nsxt.interface.throughput", "description": "The number of Bytes flowing through the network interface.", "unit": "By", "sum": { @@ -878,8 +878,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "4161088074" }, { @@ -891,8 +891,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -908,19 +908,19 @@ "resource": { "attributes": [ { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" } }, { - "key": "nsx.node.id", + "key": "nsxt.node.id", "value": { "stringValue": "f5045ed2-43ab-4a35-a2c5-d20c30a32292" } }, { - "key": "nsx.node.type", + "key": "nsxt.node.type", "value": { "stringValue": "transport" } @@ -934,14 +934,14 @@ }, "metrics": [ { - "name": "nsx.node.cache.memory.usage", + "name": "nsxt.node.cache.memory.usage", "description": "The memory usage of the node's cache", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "8" } ], @@ -949,7 +949,7 @@ } }, { - "name": "nsx.node.cpu.utilization", + "name": "nsxt.node.cpu.utilization", "description": "The average amount of CPU being used by the node.", "unit": "%", "gauge": { @@ -963,8 +963,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 0.01 }, { @@ -976,15 +976,15 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 4.34 } ] } }, { - "name": "nsx.node.disk.usage", + "name": "nsxt.node.disk.usage", "description": "The amount of storage space used by the node.", "unit": "By", "sum": { @@ -998,8 +998,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -1011,8 +1011,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" } ], @@ -1020,28 +1020,28 @@ } }, { - "name": "nsx.node.disk.utilization", + "name": "nsxt.node.disk.utilization", "description": "The percentage of storage space utilized.", "unit": "%", "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 0 } ] } }, { - "name": "nsx.node.memory.usage", + "name": "nsxt.node.memory.usage", "description": "The memory usage of the node", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "143728936" } ], @@ -1056,13 +1056,13 @@ "resource": { "attributes": [ { - "key": "nsx.interface.id", + "key": "nsxt.interface.id", "value": { "stringValue": "lo" } }, { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "nsxmgr-03" } @@ -1076,7 +1076,7 @@ }, "metrics": [ { - "name": "nsx.interface.packet.count", + "name": "nsxt.interface.packet.count", "description": "The number of packets flowing through the network interface on the node.", "unit": "{packets}", "sum": { @@ -1096,8 +1096,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "288" }, { @@ -1115,8 +1115,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -1134,8 +1134,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "12483778397" }, { @@ -1153,8 +1153,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -1172,8 +1172,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -1191,8 +1191,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "12313320048" } ], @@ -1201,7 +1201,7 @@ } }, { - "name": "nsx.interface.throughput", + "name": "nsxt.interface.throughput", "description": "The number of Bytes flowing through the network interface.", "unit": "By", "sum": { @@ -1215,8 +1215,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "2837237037443" }, { @@ -1228,8 +1228,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "5877910030884" } ], @@ -1245,13 +1245,13 @@ "resource": { "attributes": [ { - "key": "nsx.interface.id", + "key": "nsxt.interface.id", "value": { "stringValue": "eth0" } }, { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "nsxmgr-03" } @@ -1265,7 +1265,7 @@ }, "metrics": [ { - "name": "nsx.interface.packet.count", + "name": "nsxt.interface.packet.count", "description": "The number of packets flowing through the network interface on the node.", "unit": "{packets}", "sum": { @@ -1285,8 +1285,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "288" }, { @@ -1304,8 +1304,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -1323,8 +1323,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "12483778397" }, { @@ -1342,8 +1342,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -1361,8 +1361,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "0" }, { @@ -1380,8 +1380,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "12313320048" } ], @@ -1390,7 +1390,7 @@ } }, { - "name": "nsx.interface.throughput", + "name": "nsxt.interface.throughput", "description": "The number of Bytes flowing through the network interface.", "unit": "By", "sum": { @@ -1404,8 +1404,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "2837237037443" }, { @@ -1417,8 +1417,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "5877910030884" } ], @@ -1434,19 +1434,19 @@ "resource": { "attributes": [ { - "key": "nsx.node.name", + "key": "nsxt.node.name", "value": { "stringValue": "nsxmgr-03" } }, { - "key": "nsx.node.id", + "key": "nsxt.node.id", "value": { "stringValue": "b7a79908-9808-4c9e-bb49-b70008993fcb" } }, { - "key": "nsx.node.type", + "key": "nsxt.node.type", "value": { "stringValue": "manager" } @@ -1460,7 +1460,7 @@ }, "metrics": [ { - "name": "nsx.node.cpu.utilization", + "name": "nsxt.node.cpu.utilization", "description": "The average amount of CPU being used by the node.", "unit": "%", "gauge": { @@ -1474,8 +1474,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 0 }, { @@ -1487,15 +1487,15 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 0 } ] } }, { - "name": "nsx.node.disk.usage", + "name": "nsxt.node.disk.usage", "description": "The amount of storage space used by the node.", "unit": "By", "sum": { @@ -1509,8 +1509,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "26168032" }, { @@ -1522,8 +1522,8 @@ } } ], - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "237014124" } ], @@ -1531,28 +1531,28 @@ } }, { - "name": "nsx.node.disk.utilization", + "name": "nsxt.node.disk.utilization", "description": "The percentage of storage space utilized.", "unit": "%", "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asDouble": 0.09942935492936687 } ] } }, { - "name": "nsx.node.memory.usage", + "name": "nsxt.node.memory.usage", "description": "The memory usage of the node", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652116984525125000", - "timeUnixNano": "1652116984539549000", + "startTimeUnixNano": "1652125160518076000", + "timeUnixNano": "1652125160526121000", "asInt": "19636300" } ], From aa8230eca3ce524793a63946ff5e098369835ace Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 10 May 2022 16:55:16 -0400 Subject: [PATCH 39/48] try to accomodate feedback on metric names --- receiver/nsxtreceiver/client_mock_test.go | 16 +- receiver/nsxtreceiver/documentation.md | 14 +- .../internal/metadata/generated_metrics_v2.go | 354 ++++---- receiver/nsxtreceiver/metadata.yaml | 20 +- receiver/nsxtreceiver/scraper.go | 26 +- .../testdata/metrics/expected_metrics.json | 758 +++++++++--------- 6 files changed, 594 insertions(+), 594 deletions(-) diff --git a/receiver/nsxtreceiver/client_mock_test.go b/receiver/nsxtreceiver/client_mock_test.go index 2285d4bc960d..2fdeb57aba86 100644 --- a/receiver/nsxtreceiver/client_mock_test.go +++ b/receiver/nsxtreceiver/client_mock_test.go @@ -38,8 +38,8 @@ type MockClient struct { } // ClusterNodes provides a mock function with given fields: ctx -func (_m *MockClient) ClusterNodes(ctx context.Context) ([]model.ClusterNode, error) { - ret := _m.Called(ctx) +func (m *MockClient) ClusterNodes(ctx context.Context) ([]model.ClusterNode, error) { + ret := m.Called(ctx) var r0 []model.ClusterNode if rf, ok := ret.Get(0).(func(context.Context) []model.ClusterNode); ok { @@ -61,8 +61,8 @@ func (_m *MockClient) ClusterNodes(ctx context.Context) ([]model.ClusterNode, er } // InterfaceStatus provides a mock function with given fields: ctx, nodeID, interfaceID, class -func (_m *MockClient) InterfaceStatus(ctx context.Context, nodeID string, interfaceID string, class nodeClass) (*model.NetworkInterfaceStats, error) { - ret := _m.Called(ctx, nodeID, interfaceID, class) +func (m *MockClient) InterfaceStatus(ctx context.Context, nodeID string, interfaceID string, class nodeClass) (*model.NetworkInterfaceStats, error) { + ret := m.Called(ctx, nodeID, interfaceID, class) var r0 *model.NetworkInterfaceStats if rf, ok := ret.Get(0).(func(context.Context, string, string, nodeClass) *model.NetworkInterfaceStats); ok { @@ -84,8 +84,8 @@ func (_m *MockClient) InterfaceStatus(ctx context.Context, nodeID string, interf } // Interfaces provides a mock function with given fields: ctx, nodeID, class -func (_m *MockClient) Interfaces(ctx context.Context, nodeID string, class nodeClass) ([]model.NetworkInterface, error) { - ret := _m.Called(ctx, nodeID, class) +func (m *MockClient) Interfaces(ctx context.Context, nodeID string, class nodeClass) ([]model.NetworkInterface, error) { + ret := m.Called(ctx, nodeID, class) var r0 []model.NetworkInterface if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) []model.NetworkInterface); ok { @@ -130,8 +130,8 @@ func (_m *MockClient) NodeStatus(ctx context.Context, nodeID string, class nodeC } // TransportNodes provides a mock function with given fields: ctx -func (_m *MockClient) TransportNodes(ctx context.Context) ([]model.TransportNode, error) { - ret := _m.Called(ctx) +func (m *MockClient) TransportNodes(ctx context.Context) ([]model.TransportNode, error) { + ret := m.Called(ctx) var r0 []model.TransportNode if rf, ok := ret.Get(0).(func(context.Context) []model.TransportNode); ok { diff --git a/receiver/nsxtreceiver/documentation.md b/receiver/nsxtreceiver/documentation.md index e6c2fc25f71f..221255576804 100644 --- a/receiver/nsxtreceiver/documentation.md +++ b/receiver/nsxtreceiver/documentation.md @@ -8,13 +8,13 @@ These are the metrics available for this scraper. | Name | Description | Unit | Type | Attributes | | ---- | ----------- | ---- | ---- | ---------- | -| **nsxt.interface.packet.count** | The number of packets flowing through the network interface on the node. | {packets} | Sum(Int) |
  • direction
  • packet.type
| -| **nsxt.interface.throughput** | The number of Bytes flowing through the network interface. | By | Sum(Int) |
  • direction
| -| **nsxt.node.cache.memory.usage** | The memory usage of the node's cache | KBy | Sum(Int) |
| | **nsxt.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • cpu.process.class
| -| **nsxt.node.disk.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk_state
| -| **nsxt.node.disk.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
| -| **nsxt.node.memory.usage** | The memory usage of the node | KBy | Sum(Int) |
| +| **nsxt.node.filesystem.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk_state
| +| **nsxt.node.filesystem.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
| +| **nsxt.node.memory.cache.usage** | The size of the node's memory cache. | KBy | Sum(Int) |
| +| **nsxt.node.memory.usage** | The memory usage of the node. | KBy | Sum(Int) |
| +| **nsxt.node.network.io** | The number of bytes which have flowed through the network interface. | By | Sum(Int) |
  • direction
| +| **nsxt.node.network.packet.count** | The number of packets which have flowed through the network interface on the node. | {packets} | Sum(Int) |
  • direction
  • packet.type
| **Highlighted metrics** are emitted by default. Other metrics are optional and not emitted by default. Any metric can be enabled or disabled with the following scraper configuration: @@ -29,7 +29,7 @@ metrics: | Name | Description | Type | | ---- | ----------- | ---- | -| nsxt.interface.id | The name of the network interface. | String | +| device.id | The name of the network interface. | String | | nsxt.node.id | The ID of the NSX Node. | String | | nsxt.node.name | The name of the NSX Node. | String | | nsxt.node.type | The type of NSX Node. | String | diff --git a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go index 8f09ab68d9e8..c7c88ea98429 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go @@ -16,36 +16,36 @@ type MetricSettings struct { // MetricsSettings provides settings for nsxtreceiver metrics. type MetricsSettings struct { - NsxtInterfacePacketCount MetricSettings `mapstructure:"nsxt.interface.packet.count"` - NsxtInterfaceThroughput MetricSettings `mapstructure:"nsxt.interface.throughput"` - NsxtNodeCacheMemoryUsage MetricSettings `mapstructure:"nsxt.node.cache.memory.usage"` - NsxtNodeCPUUtilization MetricSettings `mapstructure:"nsxt.node.cpu.utilization"` - NsxtNodeDiskUsage MetricSettings `mapstructure:"nsxt.node.disk.usage"` - NsxtNodeDiskUtilization MetricSettings `mapstructure:"nsxt.node.disk.utilization"` - NsxtNodeMemoryUsage MetricSettings `mapstructure:"nsxt.node.memory.usage"` + NsxtNodeCPUUtilization MetricSettings `mapstructure:"nsxt.node.cpu.utilization"` + NsxtNodeFilesystemUsage MetricSettings `mapstructure:"nsxt.node.filesystem.usage"` + NsxtNodeFilesystemUtilization MetricSettings `mapstructure:"nsxt.node.filesystem.utilization"` + NsxtNodeMemoryCacheUsage MetricSettings `mapstructure:"nsxt.node.memory.cache.usage"` + NsxtNodeMemoryUsage MetricSettings `mapstructure:"nsxt.node.memory.usage"` + NsxtNodeNetworkIo MetricSettings `mapstructure:"nsxt.node.network.io"` + NsxtNodeNetworkPacketCount MetricSettings `mapstructure:"nsxt.node.network.packet.count"` } func DefaultMetricsSettings() MetricsSettings { return MetricsSettings{ - NsxtInterfacePacketCount: MetricSettings{ + NsxtNodeCPUUtilization: MetricSettings{ Enabled: true, }, - NsxtInterfaceThroughput: MetricSettings{ + NsxtNodeFilesystemUsage: MetricSettings{ Enabled: true, }, - NsxtNodeCacheMemoryUsage: MetricSettings{ + NsxtNodeFilesystemUtilization: MetricSettings{ Enabled: true, }, - NsxtNodeCPUUtilization: MetricSettings{ + NsxtNodeMemoryCacheUsage: MetricSettings{ Enabled: true, }, - NsxtNodeDiskUsage: MetricSettings{ + NsxtNodeMemoryUsage: MetricSettings{ Enabled: true, }, - NsxtNodeDiskUtilization: MetricSettings{ + NsxtNodeNetworkIo: MetricSettings{ Enabled: true, }, - NsxtNodeMemoryUsage: MetricSettings{ + NsxtNodeNetworkPacketCount: MetricSettings{ Enabled: true, }, } @@ -159,53 +159,50 @@ var MapAttributePacketType = map[string]AttributePacketType{ "success": AttributePacketTypeSuccess, } -type metricNsxtInterfacePacketCount struct { +type metricNsxtNodeCPUUtilization struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsxt.interface.packet.count metric with initial data. -func (m *metricNsxtInterfacePacketCount) init() { - m.data.SetName("nsxt.interface.packet.count") - m.data.SetDescription("The number of packets flowing through the network interface on the node.") - m.data.SetUnit("{packets}") - m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(true) - m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) - m.data.Sum().DataPoints().EnsureCapacity(m.capacity) +// init fills nsxt.node.cpu.utilization metric with initial data. +func (m *metricNsxtNodeCPUUtilization) init() { + m.data.SetName("nsxt.node.cpu.utilization") + m.data.SetDescription("The average amount of CPU being used by the node.") + m.data.SetUnit("%") + m.data.SetDataType(pmetric.MetricDataTypeGauge) + m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxtInterfacePacketCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string, packetTypeAttributeValue string) { +func (m *metricNsxtNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { if !m.settings.Enabled { return } - dp := m.data.Sum().DataPoints().AppendEmpty() + dp := m.data.Gauge().DataPoints().AppendEmpty() dp.SetStartTimestamp(start) dp.SetTimestamp(ts) - dp.SetIntVal(val) - dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) - dp.Attributes().Insert(A.PacketType, pcommon.NewValueString(packetTypeAttributeValue)) + dp.SetDoubleVal(val) + dp.Attributes().Insert(A.CPUProcessClass, pcommon.NewValueString(cpuProcessClassAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxtInterfacePacketCount) updateCapacity() { - if m.data.Sum().DataPoints().Len() > m.capacity { - m.capacity = m.data.Sum().DataPoints().Len() +func (m *metricNsxtNodeCPUUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxtInterfacePacketCount) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { +func (m *metricNsxtNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) m.init() } } -func newMetricNsxtInterfacePacketCount(settings MetricSettings) metricNsxtInterfacePacketCount { - m := metricNsxtInterfacePacketCount{settings: settings} +func newMetricNsxtNodeCPUUtilization(settings MetricSettings) metricNsxtNodeCPUUtilization { + m := metricNsxtNodeCPUUtilization{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -213,24 +210,24 @@ func newMetricNsxtInterfacePacketCount(settings MetricSettings) metricNsxtInterf return m } -type metricNsxtInterfaceThroughput struct { +type metricNsxtNodeFilesystemUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsxt.interface.throughput metric with initial data. -func (m *metricNsxtInterfaceThroughput) init() { - m.data.SetName("nsxt.interface.throughput") - m.data.SetDescription("The number of Bytes flowing through the network interface.") +// init fills nsxt.node.filesystem.usage metric with initial data. +func (m *metricNsxtNodeFilesystemUsage) init() { + m.data.SetName("nsxt.node.filesystem.usage") + m.data.SetDescription("The amount of storage space used by the node.") m.data.SetUnit("By") m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(true) + m.data.Sum().SetIsMonotonic(false) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxtInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { +func (m *metricNsxtNodeFilesystemUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskStateAttributeValue string) { if !m.settings.Enabled { return } @@ -238,18 +235,18 @@ func (m *metricNsxtInterfaceThroughput) recordDataPoint(start pcommon.Timestamp, dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) - dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) + dp.Attributes().Insert(A.DiskState, pcommon.NewValueString(diskStateAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxtInterfaceThroughput) updateCapacity() { +func (m *metricNsxtNodeFilesystemUsage) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxtInterfaceThroughput) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeFilesystemUsage) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -257,8 +254,8 @@ func (m *metricNsxtInterfaceThroughput) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxtInterfaceThroughput(settings MetricSettings) metricNsxtInterfaceThroughput { - m := metricNsxtInterfaceThroughput{settings: settings} +func newMetricNsxtNodeFilesystemUsage(settings MetricSettings) metricNsxtNodeFilesystemUsage { + m := metricNsxtNodeFilesystemUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -266,50 +263,48 @@ func newMetricNsxtInterfaceThroughput(settings MetricSettings) metricNsxtInterfa return m } -type metricNsxtNodeCacheMemoryUsage struct { +type metricNsxtNodeFilesystemUtilization struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsxt.node.cache.memory.usage metric with initial data. -func (m *metricNsxtNodeCacheMemoryUsage) init() { - m.data.SetName("nsxt.node.cache.memory.usage") - m.data.SetDescription("The memory usage of the node's cache") - m.data.SetUnit("KBy") - m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(false) - m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) +// init fills nsxt.node.filesystem.utilization metric with initial data. +func (m *metricNsxtNodeFilesystemUtilization) init() { + m.data.SetName("nsxt.node.filesystem.utilization") + m.data.SetDescription("The percentage of storage space utilized.") + m.data.SetUnit("%") + m.data.SetDataType(pmetric.MetricDataTypeGauge) } -func (m *metricNsxtNodeCacheMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { +func (m *metricNsxtNodeFilesystemUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) { if !m.settings.Enabled { return } - dp := m.data.Sum().DataPoints().AppendEmpty() + dp := m.data.Gauge().DataPoints().AppendEmpty() dp.SetStartTimestamp(start) dp.SetTimestamp(ts) - dp.SetIntVal(val) + dp.SetDoubleVal(val) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxtNodeCacheMemoryUsage) updateCapacity() { - if m.data.Sum().DataPoints().Len() > m.capacity { - m.capacity = m.data.Sum().DataPoints().Len() +func (m *metricNsxtNodeFilesystemUtilization) updateCapacity() { + if m.data.Gauge().DataPoints().Len() > m.capacity { + m.capacity = m.data.Gauge().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxtNodeCacheMemoryUsage) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { +func (m *metricNsxtNodeFilesystemUtilization) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) m.init() } } -func newMetricNsxtNodeCacheMemoryUsage(settings MetricSettings) metricNsxtNodeCacheMemoryUsage { - m := metricNsxtNodeCacheMemoryUsage{settings: settings} +func newMetricNsxtNodeFilesystemUtilization(settings MetricSettings) metricNsxtNodeFilesystemUtilization { + m := metricNsxtNodeFilesystemUtilization{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -317,50 +312,50 @@ func newMetricNsxtNodeCacheMemoryUsage(settings MetricSettings) metricNsxtNodeCa return m } -type metricNsxtNodeCPUUtilization struct { +type metricNsxtNodeMemoryCacheUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsxt.node.cpu.utilization metric with initial data. -func (m *metricNsxtNodeCPUUtilization) init() { - m.data.SetName("nsxt.node.cpu.utilization") - m.data.SetDescription("The average amount of CPU being used by the node.") - m.data.SetUnit("%") - m.data.SetDataType(pmetric.MetricDataTypeGauge) - m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) +// init fills nsxt.node.memory.cache.usage metric with initial data. +func (m *metricNsxtNodeMemoryCacheUsage) init() { + m.data.SetName("nsxt.node.memory.cache.usage") + m.data.SetDescription("The size of the node's memory cache.") + m.data.SetUnit("KBy") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) } -func (m *metricNsxtNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { +func (m *metricNsxtNodeMemoryCacheUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { if !m.settings.Enabled { return } - dp := m.data.Gauge().DataPoints().AppendEmpty() + dp := m.data.Sum().DataPoints().AppendEmpty() dp.SetStartTimestamp(start) dp.SetTimestamp(ts) - dp.SetDoubleVal(val) - dp.Attributes().Insert(A.CPUProcessClass, pcommon.NewValueString(cpuProcessClassAttributeValue)) + dp.SetIntVal(val) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxtNodeCPUUtilization) updateCapacity() { - if m.data.Gauge().DataPoints().Len() > m.capacity { - m.capacity = m.data.Gauge().DataPoints().Len() +func (m *metricNsxtNodeMemoryCacheUsage) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxtNodeCPUUtilization) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { +func (m *metricNsxtNodeMemoryCacheUsage) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) m.init() } } -func newMetricNsxtNodeCPUUtilization(settings MetricSettings) metricNsxtNodeCPUUtilization { - m := metricNsxtNodeCPUUtilization{settings: settings} +func newMetricNsxtNodeMemoryCacheUsage(settings MetricSettings) metricNsxtNodeMemoryCacheUsage { + m := metricNsxtNodeMemoryCacheUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -368,24 +363,23 @@ func newMetricNsxtNodeCPUUtilization(settings MetricSettings) metricNsxtNodeCPUU return m } -type metricNsxtNodeDiskUsage struct { +type metricNsxtNodeMemoryUsage struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsxt.node.disk.usage metric with initial data. -func (m *metricNsxtNodeDiskUsage) init() { - m.data.SetName("nsxt.node.disk.usage") - m.data.SetDescription("The amount of storage space used by the node.") - m.data.SetUnit("By") +// init fills nsxt.node.memory.usage metric with initial data. +func (m *metricNsxtNodeMemoryUsage) init() { + m.data.SetName("nsxt.node.memory.usage") + m.data.SetDescription("The memory usage of the node.") + m.data.SetUnit("KBy") m.data.SetDataType(pmetric.MetricDataTypeSum) m.data.Sum().SetIsMonotonic(false) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) - m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxtNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, diskStateAttributeValue string) { +func (m *metricNsxtNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { if !m.settings.Enabled { return } @@ -393,18 +387,17 @@ func (m *metricNsxtNodeDiskUsage) recordDataPoint(start pcommon.Timestamp, ts pc dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) - dp.Attributes().Insert(A.DiskState, pcommon.NewValueString(diskStateAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxtNodeDiskUsage) updateCapacity() { +func (m *metricNsxtNodeMemoryUsage) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxtNodeDiskUsage) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -412,8 +405,8 @@ func (m *metricNsxtNodeDiskUsage) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxtNodeDiskUsage(settings MetricSettings) metricNsxtNodeDiskUsage { - m := metricNsxtNodeDiskUsage{settings: settings} +func newMetricNsxtNodeMemoryUsage(settings MetricSettings) metricNsxtNodeMemoryUsage { + m := metricNsxtNodeMemoryUsage{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -421,48 +414,52 @@ func newMetricNsxtNodeDiskUsage(settings MetricSettings) metricNsxtNodeDiskUsage return m } -type metricNsxtNodeDiskUtilization struct { +type metricNsxtNodeNetworkIo struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsxt.node.disk.utilization metric with initial data. -func (m *metricNsxtNodeDiskUtilization) init() { - m.data.SetName("nsxt.node.disk.utilization") - m.data.SetDescription("The percentage of storage space utilized.") - m.data.SetUnit("%") - m.data.SetDataType(pmetric.MetricDataTypeGauge) +// init fills nsxt.node.network.io metric with initial data. +func (m *metricNsxtNodeNetworkIo) init() { + m.data.SetName("nsxt.node.network.io") + m.data.SetDescription("The number of bytes which have flowed through the network interface.") + m.data.SetUnit("By") + m.data.SetDataType(pmetric.MetricDataTypeSum) + m.data.Sum().SetIsMonotonic(true) + m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxtNodeDiskUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64) { +func (m *metricNsxtNodeNetworkIo) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string) { if !m.settings.Enabled { return } - dp := m.data.Gauge().DataPoints().AppendEmpty() + dp := m.data.Sum().DataPoints().AppendEmpty() dp.SetStartTimestamp(start) dp.SetTimestamp(ts) - dp.SetDoubleVal(val) + dp.SetIntVal(val) + dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxtNodeDiskUtilization) updateCapacity() { - if m.data.Gauge().DataPoints().Len() > m.capacity { - m.capacity = m.data.Gauge().DataPoints().Len() +func (m *metricNsxtNodeNetworkIo) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxtNodeDiskUtilization) emit(metrics pmetric.MetricSlice) { - if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 { +func (m *metricNsxtNodeNetworkIo) emit(metrics pmetric.MetricSlice) { + if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) m.init() } } -func newMetricNsxtNodeDiskUtilization(settings MetricSettings) metricNsxtNodeDiskUtilization { - m := metricNsxtNodeDiskUtilization{settings: settings} +func newMetricNsxtNodeNetworkIo(settings MetricSettings) metricNsxtNodeNetworkIo { + m := metricNsxtNodeNetworkIo{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -470,23 +467,24 @@ func newMetricNsxtNodeDiskUtilization(settings MetricSettings) metricNsxtNodeDis return m } -type metricNsxtNodeMemoryUsage struct { +type metricNsxtNodeNetworkPacketCount struct { data pmetric.Metric // data buffer for generated metric. settings MetricSettings // metric settings provided by user. capacity int // max observed number of data points added to the metric. } -// init fills nsxt.node.memory.usage metric with initial data. -func (m *metricNsxtNodeMemoryUsage) init() { - m.data.SetName("nsxt.node.memory.usage") - m.data.SetDescription("The memory usage of the node") - m.data.SetUnit("KBy") +// init fills nsxt.node.network.packet.count metric with initial data. +func (m *metricNsxtNodeNetworkPacketCount) init() { + m.data.SetName("nsxt.node.network.packet.count") + m.data.SetDescription("The number of packets which have flowed through the network interface on the node.") + m.data.SetUnit("{packets}") m.data.SetDataType(pmetric.MetricDataTypeSum) - m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetIsMonotonic(true) m.data.Sum().SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative) + m.data.Sum().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxtNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { +func (m *metricNsxtNodeNetworkPacketCount) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, directionAttributeValue string, packetTypeAttributeValue string) { if !m.settings.Enabled { return } @@ -494,17 +492,19 @@ func (m *metricNsxtNodeMemoryUsage) recordDataPoint(start pcommon.Timestamp, ts dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) + dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) + dp.Attributes().Insert(A.PacketType, pcommon.NewValueString(packetTypeAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. -func (m *metricNsxtNodeMemoryUsage) updateCapacity() { +func (m *metricNsxtNodeNetworkPacketCount) updateCapacity() { if m.data.Sum().DataPoints().Len() > m.capacity { m.capacity = m.data.Sum().DataPoints().Len() } } // emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. -func (m *metricNsxtNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { +func (m *metricNsxtNodeNetworkPacketCount) emit(metrics pmetric.MetricSlice) { if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 { m.updateCapacity() m.data.MoveTo(metrics.AppendEmpty()) @@ -512,8 +512,8 @@ func (m *metricNsxtNodeMemoryUsage) emit(metrics pmetric.MetricSlice) { } } -func newMetricNsxtNodeMemoryUsage(settings MetricSettings) metricNsxtNodeMemoryUsage { - m := metricNsxtNodeMemoryUsage{settings: settings} +func newMetricNsxtNodeNetworkPacketCount(settings MetricSettings) metricNsxtNodeNetworkPacketCount { + m := metricNsxtNodeNetworkPacketCount{settings: settings} if settings.Enabled { m.data = pmetric.NewMetric() m.init() @@ -524,17 +524,17 @@ func newMetricNsxtNodeMemoryUsage(settings MetricSettings) metricNsxtNodeMemoryU // MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations // required to produce metric representation defined in metadata and user settings. type MetricsBuilder struct { - startTime pcommon.Timestamp // start time that will be applied to all recorded data points. - metricsCapacity int // maximum observed number of metrics per resource. - resourceCapacity int // maximum observed number of resource attributes. - metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. - metricNsxtInterfacePacketCount metricNsxtInterfacePacketCount - metricNsxtInterfaceThroughput metricNsxtInterfaceThroughput - metricNsxtNodeCacheMemoryUsage metricNsxtNodeCacheMemoryUsage - metricNsxtNodeCPUUtilization metricNsxtNodeCPUUtilization - metricNsxtNodeDiskUsage metricNsxtNodeDiskUsage - metricNsxtNodeDiskUtilization metricNsxtNodeDiskUtilization - metricNsxtNodeMemoryUsage metricNsxtNodeMemoryUsage + startTime pcommon.Timestamp // start time that will be applied to all recorded data points. + metricsCapacity int // maximum observed number of metrics per resource. + resourceCapacity int // maximum observed number of resource attributes. + metricsBuffer pmetric.Metrics // accumulates metrics data before emitting. + metricNsxtNodeCPUUtilization metricNsxtNodeCPUUtilization + metricNsxtNodeFilesystemUsage metricNsxtNodeFilesystemUsage + metricNsxtNodeFilesystemUtilization metricNsxtNodeFilesystemUtilization + metricNsxtNodeMemoryCacheUsage metricNsxtNodeMemoryCacheUsage + metricNsxtNodeMemoryUsage metricNsxtNodeMemoryUsage + metricNsxtNodeNetworkIo metricNsxtNodeNetworkIo + metricNsxtNodeNetworkPacketCount metricNsxtNodeNetworkPacketCount } // metricBuilderOption applies changes to default metrics builder. @@ -549,15 +549,15 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ - startTime: pcommon.NewTimestampFromTime(time.Now()), - metricsBuffer: pmetric.NewMetrics(), - metricNsxtInterfacePacketCount: newMetricNsxtInterfacePacketCount(settings.NsxtInterfacePacketCount), - metricNsxtInterfaceThroughput: newMetricNsxtInterfaceThroughput(settings.NsxtInterfaceThroughput), - metricNsxtNodeCacheMemoryUsage: newMetricNsxtNodeCacheMemoryUsage(settings.NsxtNodeCacheMemoryUsage), - metricNsxtNodeCPUUtilization: newMetricNsxtNodeCPUUtilization(settings.NsxtNodeCPUUtilization), - metricNsxtNodeDiskUsage: newMetricNsxtNodeDiskUsage(settings.NsxtNodeDiskUsage), - metricNsxtNodeDiskUtilization: newMetricNsxtNodeDiskUtilization(settings.NsxtNodeDiskUtilization), - metricNsxtNodeMemoryUsage: newMetricNsxtNodeMemoryUsage(settings.NsxtNodeMemoryUsage), + startTime: pcommon.NewTimestampFromTime(time.Now()), + metricsBuffer: pmetric.NewMetrics(), + metricNsxtNodeCPUUtilization: newMetricNsxtNodeCPUUtilization(settings.NsxtNodeCPUUtilization), + metricNsxtNodeFilesystemUsage: newMetricNsxtNodeFilesystemUsage(settings.NsxtNodeFilesystemUsage), + metricNsxtNodeFilesystemUtilization: newMetricNsxtNodeFilesystemUtilization(settings.NsxtNodeFilesystemUtilization), + metricNsxtNodeMemoryCacheUsage: newMetricNsxtNodeMemoryCacheUsage(settings.NsxtNodeMemoryCacheUsage), + metricNsxtNodeMemoryUsage: newMetricNsxtNodeMemoryUsage(settings.NsxtNodeMemoryUsage), + metricNsxtNodeNetworkIo: newMetricNsxtNodeNetworkIo(settings.NsxtNodeNetworkIo), + metricNsxtNodeNetworkPacketCount: newMetricNsxtNodeNetworkPacketCount(settings.NsxtNodeNetworkPacketCount), } for _, op := range options { op(mb) @@ -578,10 +578,10 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { // ResourceOption applies changes to provided resource. type ResourceOption func(pcommon.Resource) -// WithNsxtInterfaceID sets provided value as "nsxt.interface.id" attribute for current resource. -func WithNsxtInterfaceID(val string) ResourceOption { +// WithDeviceID sets provided value as "device.id" attribute for current resource. +func WithDeviceID(val string) ResourceOption { return func(r pcommon.Resource) { - r.Attributes().UpsertString("nsxt.interface.id", val) + r.Attributes().UpsertString("device.id", val) } } @@ -619,13 +619,13 @@ func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption) { ils := rm.ScopeMetrics().AppendEmpty() ils.Scope().SetName("otelcol/nsxtreceiver") ils.Metrics().EnsureCapacity(mb.metricsCapacity) - mb.metricNsxtInterfacePacketCount.emit(ils.Metrics()) - mb.metricNsxtInterfaceThroughput.emit(ils.Metrics()) - mb.metricNsxtNodeCacheMemoryUsage.emit(ils.Metrics()) mb.metricNsxtNodeCPUUtilization.emit(ils.Metrics()) - mb.metricNsxtNodeDiskUsage.emit(ils.Metrics()) - mb.metricNsxtNodeDiskUtilization.emit(ils.Metrics()) + mb.metricNsxtNodeFilesystemUsage.emit(ils.Metrics()) + mb.metricNsxtNodeFilesystemUtilization.emit(ils.Metrics()) + mb.metricNsxtNodeMemoryCacheUsage.emit(ils.Metrics()) mb.metricNsxtNodeMemoryUsage.emit(ils.Metrics()) + mb.metricNsxtNodeNetworkIo.emit(ils.Metrics()) + mb.metricNsxtNodeNetworkPacketCount.emit(ils.Metrics()) if ils.Metrics().Len() > 0 { mb.updateCapacity(rm) rm.MoveTo(mb.metricsBuffer.ResourceMetrics().AppendEmpty()) @@ -642,34 +642,24 @@ func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics { return metrics } -// RecordNsxtInterfacePacketCountDataPoint adds a data point to nsxt.interface.packet.count metric. -func (mb *MetricsBuilder) RecordNsxtInterfacePacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection, packetTypeAttributeValue AttributePacketType) { - mb.metricNsxtInterfacePacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String(), packetTypeAttributeValue.String()) -} - -// RecordNsxtInterfaceThroughputDataPoint adds a data point to nsxt.interface.throughput metric. -func (mb *MetricsBuilder) RecordNsxtInterfaceThroughputDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection) { - mb.metricNsxtInterfaceThroughput.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String()) -} - -// RecordNsxtNodeCacheMemoryUsageDataPoint adds a data point to nsxt.node.cache.memory.usage metric. -func (mb *MetricsBuilder) RecordNsxtNodeCacheMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) { - mb.metricNsxtNodeCacheMemoryUsage.recordDataPoint(mb.startTime, ts, val) -} - // RecordNsxtNodeCPUUtilizationDataPoint adds a data point to nsxt.node.cpu.utilization metric. func (mb *MetricsBuilder) RecordNsxtNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue AttributeCPUProcessClass) { mb.metricNsxtNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue.String()) } -// RecordNsxtNodeDiskUsageDataPoint adds a data point to nsxt.node.disk.usage metric. -func (mb *MetricsBuilder) RecordNsxtNodeDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState) { - mb.metricNsxtNodeDiskUsage.recordDataPoint(mb.startTime, ts, val, diskStateAttributeValue.String()) +// RecordNsxtNodeFilesystemUsageDataPoint adds a data point to nsxt.node.filesystem.usage metric. +func (mb *MetricsBuilder) RecordNsxtNodeFilesystemUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState) { + mb.metricNsxtNodeFilesystemUsage.recordDataPoint(mb.startTime, ts, val, diskStateAttributeValue.String()) +} + +// RecordNsxtNodeFilesystemUtilizationDataPoint adds a data point to nsxt.node.filesystem.utilization metric. +func (mb *MetricsBuilder) RecordNsxtNodeFilesystemUtilizationDataPoint(ts pcommon.Timestamp, val float64) { + mb.metricNsxtNodeFilesystemUtilization.recordDataPoint(mb.startTime, ts, val) } -// RecordNsxtNodeDiskUtilizationDataPoint adds a data point to nsxt.node.disk.utilization metric. -func (mb *MetricsBuilder) RecordNsxtNodeDiskUtilizationDataPoint(ts pcommon.Timestamp, val float64) { - mb.metricNsxtNodeDiskUtilization.recordDataPoint(mb.startTime, ts, val) +// RecordNsxtNodeMemoryCacheUsageDataPoint adds a data point to nsxt.node.memory.cache.usage metric. +func (mb *MetricsBuilder) RecordNsxtNodeMemoryCacheUsageDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricNsxtNodeMemoryCacheUsage.recordDataPoint(mb.startTime, ts, val) } // RecordNsxtNodeMemoryUsageDataPoint adds a data point to nsxt.node.memory.usage metric. @@ -677,6 +667,16 @@ func (mb *MetricsBuilder) RecordNsxtNodeMemoryUsageDataPoint(ts pcommon.Timestam mb.metricNsxtNodeMemoryUsage.recordDataPoint(mb.startTime, ts, val) } +// RecordNsxtNodeNetworkIoDataPoint adds a data point to nsxt.node.network.io metric. +func (mb *MetricsBuilder) RecordNsxtNodeNetworkIoDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection) { + mb.metricNsxtNodeNetworkIo.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String()) +} + +// RecordNsxtNodeNetworkPacketCountDataPoint adds a data point to nsxt.node.network.packet.count metric. +func (mb *MetricsBuilder) RecordNsxtNodeNetworkPacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection, packetTypeAttributeValue AttributePacketType) { + mb.metricNsxtNodeNetworkPacketCount.recordDataPoint(mb.startTime, ts, val, directionAttributeValue.String(), packetTypeAttributeValue.String()) +} + // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index 90afa9cb3e16..9e73f8da34da 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -14,7 +14,7 @@ resource_attributes: - manager - host - edge - nsxt.interface.id: + device.id: description: The name of the network interface. type: string @@ -47,8 +47,8 @@ attributes: description: The name of the load balancer being utilized. metrics: - nsxt.interface.throughput: - description: The number of Bytes flowing through the network interface. + nsxt.node.network.io: + description: The number of bytes which have flowed through the network interface. unit: "By" sum: monotonic: true @@ -56,8 +56,8 @@ metrics: value_type: int enabled: true attributes: [direction] - nsxt.interface.packet.count: - description: The number of packets flowing through the network interface on the node. + nsxt.node.network.packet.count: + description: The number of packets which have flowed through the network interface on the node. unit: "{packets}" sum: monotonic: true @@ -72,13 +72,13 @@ metrics: value_type: double enabled: true attributes: [cpu.process.class] - nsxt.node.disk.utilization: + nsxt.node.filesystem.utilization: description: The percentage of storage space utilized. unit: "%" gauge: value_type: double enabled: true - nsxt.node.disk.usage: + nsxt.node.filesystem.usage: description: The amount of storage space used by the node. unit: By sum: @@ -88,15 +88,15 @@ metrics: enabled: true attributes: [disk_state] nsxt.node.memory.usage: - description: The memory usage of the node + description: The memory usage of the node. unit: KBy sum: monotonic: false value_type: int aggregation: cumulative enabled: true - nsxt.node.cache.memory.usage: - description: The memory usage of the node's cache + nsxt.node.memory.cache.usage: + description: The size of the node's memory cache. unit: KBy sum: monotonic: false diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index 01ab1c452f5f..0a145e9c1f84 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -199,21 +199,21 @@ func (s *scraper) process( } func (s *scraper) recordNodeInterface(colTime pdata.Timestamp, nodeProps dm.NodeProperties, i interfaceInformation) { - s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeDropped) - s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeErrored) + s.mb.RecordNsxtNodeNetworkPacketCountDataPoint(colTime, i.stats.RxDropped, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeDropped) + s.mb.RecordNsxtNodeNetworkPacketCountDataPoint(colTime, i.stats.RxErrors, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeErrored) successRxPackets := i.stats.RxPackets - i.stats.RxDropped - i.stats.RxErrors - s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, successRxPackets, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeSuccess) + s.mb.RecordNsxtNodeNetworkPacketCountDataPoint(colTime, successRxPackets, metadata.AttributeDirectionReceived, metadata.AttributePacketTypeSuccess) - s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.TxDropped, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeDropped) - s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, i.stats.TxErrors, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeErrored) + s.mb.RecordNsxtNodeNetworkPacketCountDataPoint(colTime, i.stats.TxDropped, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeDropped) + s.mb.RecordNsxtNodeNetworkPacketCountDataPoint(colTime, i.stats.TxErrors, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeErrored) successTxPackets := i.stats.TxPackets - i.stats.TxDropped - i.stats.TxErrors - s.mb.RecordNsxtInterfacePacketCountDataPoint(colTime, successTxPackets, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeSuccess) + s.mb.RecordNsxtNodeNetworkPacketCountDataPoint(colTime, successTxPackets, metadata.AttributeDirectionTransmitted, metadata.AttributePacketTypeSuccess) - s.mb.RecordNsxtInterfaceThroughputDataPoint(colTime, i.stats.RxBytes, metadata.AttributeDirectionReceived) - s.mb.RecordNsxtInterfaceThroughputDataPoint(colTime, i.stats.TxBytes, metadata.AttributeDirectionTransmitted) + s.mb.RecordNsxtNodeNetworkIoDataPoint(colTime, i.stats.RxBytes, metadata.AttributeDirectionReceived) + s.mb.RecordNsxtNodeNetworkIoDataPoint(colTime, i.stats.TxBytes, metadata.AttributeDirectionTransmitted) s.mb.EmitForResource( - metadata.WithNsxtInterfaceID(i.iFace.InterfaceId), + metadata.WithDeviceID(i.iFace.InterfaceId), metadata.WithNsxtNodeName(nodeProps.Name), ) } @@ -232,14 +232,14 @@ func (s *scraper) recordNode( s.mb.RecordNsxtNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) if ss.EdgeMemUsage != nil { - s.mb.RecordNsxtNodeCacheMemoryUsageDataPoint(colTime, int64(ss.EdgeMemUsage.CacheUsage)) + s.mb.RecordNsxtNodeMemoryCacheUsageDataPoint(colTime, int64(ss.EdgeMemUsage.CacheUsage)) } - s.mb.RecordNsxtNodeDiskUsageDataPoint(colTime, int64(ss.DiskSpaceUsed), metadata.AttributeDiskStateUsed) + s.mb.RecordNsxtNodeFilesystemUsageDataPoint(colTime, int64(ss.DiskSpaceUsed), metadata.AttributeDiskStateUsed) availableStorage := ss.DiskSpaceTotal - ss.DiskSpaceUsed - s.mb.RecordNsxtNodeDiskUsageDataPoint(colTime, int64(availableStorage), metadata.AttributeDiskStateAvailable) + s.mb.RecordNsxtNodeFilesystemUsageDataPoint(colTime, int64(availableStorage), metadata.AttributeDiskStateAvailable) // ensure division by zero is safeguarded - s.mb.RecordNsxtNodeDiskUtilizationDataPoint(colTime, float64(ss.DiskSpaceUsed)/math.Max(float64(ss.DiskSpaceTotal), 1)) + s.mb.RecordNsxtNodeFilesystemUtilizationDataPoint(colTime, float64(ss.DiskSpaceUsed)/math.Max(float64(ss.DiskSpaceTotal), 1)) s.mb.EmitForResource( metadata.WithNsxtNodeName(info.nodeProps.Name), diff --git a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json index 80a781a13d9f..99d3f49b9a35 100644 --- a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json @@ -4,7 +4,7 @@ "resource": { "attributes": [ { - "key": "nsxt.interface.id", + "key": "device.id", "value": { "stringValue": "vmnic0" } @@ -24,8 +24,45 @@ }, "metrics": [ { - "name": "nsxt.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", + "name": "nsxt.node.network.io", + "description": "The number of bytes which have flowed through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "4161088074" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsxt.node.network.packet.count", + "description": "The number of packets which have flowed through the network interface on the node.", "unit": "{packets}", "sum": { "dataPoints": [ @@ -44,8 +81,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -63,8 +100,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -82,8 +119,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "63594238" }, { @@ -101,8 +138,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -120,8 +157,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -139,18 +176,45 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "isMonotonic": true } - }, + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "device.id", + "value": { + "stringValue": "vmk10" + } + }, + { + "key": "nsxt.node.name", + "value": { + "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxtreceiver" + }, + "metrics": [ { - "name": "nsxt.interface.throughput", - "description": "The number of Bytes flowing through the network interface.", + "name": "nsxt.node.network.io", + "description": "The number of bytes which have flowed through the network interface.", "unit": "By", "sum": { "dataPoints": [ @@ -163,8 +227,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "4161088074" }, { @@ -176,45 +240,18 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "isMonotonic": true } - } - ] - } - ] - }, - { - "resource": { - "attributes": [ - { - "key": "nsxt.interface.id", - "value": { - "stringValue": "vmk10" - } - }, - { - "key": "nsxt.node.name", - "value": { - "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" - } - } - ] - }, - "scopeMetrics": [ - { - "scope": { - "name": "otelcol/nsxtreceiver" - }, - "metrics": [ + }, { - "name": "nsxt.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", + "name": "nsxt.node.network.packet.count", + "description": "The number of packets which have flowed through the network interface on the node.", "unit": "{packets}", "sum": { "dataPoints": [ @@ -233,8 +270,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -252,8 +289,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -271,8 +308,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "63594238" }, { @@ -290,8 +327,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -309,8 +346,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -328,45 +365,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "0" - } - ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", - "isMonotonic": true - } - }, - { - "name": "nsxt.interface.throughput", - "description": "The number of Bytes flowing through the network interface.", - "unit": "By", - "sum": { - "dataPoints": [ - { - "attributes": [ - { - "key": "direction", - "value": { - "stringValue": "received" - } - } - ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "4161088074" - }, - { - "attributes": [ - { - "key": "direction", - "value": { - "stringValue": "transmitted" - } - } - ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], @@ -407,21 +407,6 @@ "name": "otelcol/nsxtreceiver" }, "metrics": [ - { - "name": "nsxt.node.cache.memory.usage", - "description": "The memory usage of the node's cache", - "unit": "KBy", - "sum": { - "dataPoints": [ - { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "8" - } - ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" - } - }, { "name": "nsxt.node.cpu.utilization", "description": "The average amount of CPU being used by the node.", @@ -437,8 +422,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 0.01 }, { @@ -450,15 +435,15 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 4.34 } ] } }, { - "name": "nsxt.node.disk.usage", + "name": "nsxt.node.filesystem.usage", "description": "The amount of storage space used by the node.", "unit": "By", "sum": { @@ -472,8 +457,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -485,8 +470,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], @@ -494,28 +479,43 @@ } }, { - "name": "nsxt.node.disk.utilization", + "name": "nsxt.node.filesystem.utilization", "description": "The percentage of storage space utilized.", "unit": "%", "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 0 } ] } }, + { + "name": "nsxt.node.memory.cache.usage", + "description": "The size of the node's memory cache.", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "8" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, { "name": "nsxt.node.memory.usage", - "description": "The memory usage of the node", + "description": "The memory usage of the node.", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "89169108" } ], @@ -530,7 +530,7 @@ "resource": { "attributes": [ { - "key": "nsxt.interface.id", + "key": "device.id", "value": { "stringValue": "vmnic0" } @@ -550,8 +550,45 @@ }, "metrics": [ { - "name": "nsxt.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", + "name": "nsxt.node.network.io", + "description": "The number of bytes which have flowed through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "4161088074" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "0" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsxt.node.network.packet.count", + "description": "The number of packets which have flowed through the network interface on the node.", "unit": "{packets}", "sum": { "dataPoints": [ @@ -570,8 +607,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -589,8 +626,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -608,8 +645,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "63594238" }, { @@ -627,8 +664,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -646,8 +683,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -665,18 +702,45 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "isMonotonic": true } - }, + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "device.id", + "value": { + "stringValue": "vmk10" + } + }, + { + "key": "nsxt.node.name", + "value": { + "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxtreceiver" + }, + "metrics": [ { - "name": "nsxt.interface.throughput", - "description": "The number of Bytes flowing through the network interface.", + "name": "nsxt.node.network.io", + "description": "The number of bytes which have flowed through the network interface.", "unit": "By", "sum": { "dataPoints": [ @@ -689,8 +753,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "4161088074" }, { @@ -702,45 +766,18 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "isMonotonic": true } - } - ] - } - ] - }, - { - "resource": { - "attributes": [ - { - "key": "nsxt.interface.id", - "value": { - "stringValue": "vmk10" - } - }, - { - "key": "nsxt.node.name", - "value": { - "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" - } - } - ] - }, - "scopeMetrics": [ - { - "scope": { - "name": "otelcol/nsxtreceiver" - }, - "metrics": [ + }, { - "name": "nsxt.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", + "name": "nsxt.node.network.packet.count", + "description": "The number of packets which have flowed through the network interface on the node.", "unit": "{packets}", "sum": { "dataPoints": [ @@ -759,8 +796,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -778,8 +815,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -797,8 +834,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "63594238" }, { @@ -816,8 +853,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -835,8 +872,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -854,45 +891,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "0" - } - ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", - "isMonotonic": true - } - }, - { - "name": "nsxt.interface.throughput", - "description": "The number of Bytes flowing through the network interface.", - "unit": "By", - "sum": { - "dataPoints": [ - { - "attributes": [ - { - "key": "direction", - "value": { - "stringValue": "received" - } - } - ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "4161088074" - }, - { - "attributes": [ - { - "key": "direction", - "value": { - "stringValue": "transmitted" - } - } - ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], @@ -933,21 +933,6 @@ "name": "otelcol/nsxtreceiver" }, "metrics": [ - { - "name": "nsxt.node.cache.memory.usage", - "description": "The memory usage of the node's cache", - "unit": "KBy", - "sum": { - "dataPoints": [ - { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "8" - } - ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" - } - }, { "name": "nsxt.node.cpu.utilization", "description": "The average amount of CPU being used by the node.", @@ -963,8 +948,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 0.01 }, { @@ -976,15 +961,15 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 4.34 } ] } }, { - "name": "nsxt.node.disk.usage", + "name": "nsxt.node.filesystem.usage", "description": "The amount of storage space used by the node.", "unit": "By", "sum": { @@ -998,8 +983,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -1011,8 +996,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" } ], @@ -1020,28 +1005,43 @@ } }, { - "name": "nsxt.node.disk.utilization", + "name": "nsxt.node.filesystem.utilization", "description": "The percentage of storage space utilized.", "unit": "%", "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 0 } ] } }, + { + "name": "nsxt.node.memory.cache.usage", + "description": "The size of the node's memory cache.", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "8" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, { "name": "nsxt.node.memory.usage", - "description": "The memory usage of the node", + "description": "The memory usage of the node.", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "143728936" } ], @@ -1056,7 +1056,7 @@ "resource": { "attributes": [ { - "key": "nsxt.interface.id", + "key": "device.id", "value": { "stringValue": "lo" } @@ -1076,8 +1076,45 @@ }, "metrics": [ { - "name": "nsxt.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", + "name": "nsxt.node.network.io", + "description": "The number of bytes which have flowed through the network interface.", + "unit": "By", + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "received" + } + } + ], + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "2837237037443" + }, + { + "attributes": [ + { + "key": "direction", + "value": { + "stringValue": "transmitted" + } + } + ], + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", + "asInt": "5877910030884" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", + "isMonotonic": true + } + }, + { + "name": "nsxt.node.network.packet.count", + "description": "The number of packets which have flowed through the network interface on the node.", "unit": "{packets}", "sum": { "dataPoints": [ @@ -1096,8 +1133,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "288" }, { @@ -1115,8 +1152,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -1134,8 +1171,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "12483778397" }, { @@ -1153,8 +1190,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -1172,8 +1209,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -1191,18 +1228,45 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "12313320048" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "isMonotonic": true } - }, + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "device.id", + "value": { + "stringValue": "eth0" + } + }, + { + "key": "nsxt.node.name", + "value": { + "stringValue": "nsxmgr-03" + } + } + ] + }, + "scopeMetrics": [ + { + "scope": { + "name": "otelcol/nsxtreceiver" + }, + "metrics": [ { - "name": "nsxt.interface.throughput", - "description": "The number of Bytes flowing through the network interface.", + "name": "nsxt.node.network.io", + "description": "The number of bytes which have flowed through the network interface.", "unit": "By", "sum": { "dataPoints": [ @@ -1215,8 +1279,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "2837237037443" }, { @@ -1228,45 +1292,18 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "5877910030884" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "isMonotonic": true } - } - ] - } - ] - }, - { - "resource": { - "attributes": [ - { - "key": "nsxt.interface.id", - "value": { - "stringValue": "eth0" - } - }, - { - "key": "nsxt.node.name", - "value": { - "stringValue": "nsxmgr-03" - } - } - ] - }, - "scopeMetrics": [ - { - "scope": { - "name": "otelcol/nsxtreceiver" - }, - "metrics": [ + }, { - "name": "nsxt.interface.packet.count", - "description": "The number of packets flowing through the network interface on the node.", + "name": "nsxt.node.network.packet.count", + "description": "The number of packets which have flowed through the network interface on the node.", "unit": "{packets}", "sum": { "dataPoints": [ @@ -1285,8 +1322,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "288" }, { @@ -1304,8 +1341,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -1323,8 +1360,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "12483778397" }, { @@ -1342,8 +1379,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -1361,8 +1398,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "0" }, { @@ -1380,51 +1417,14 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "12313320048" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", "isMonotonic": true } - }, - { - "name": "nsxt.interface.throughput", - "description": "The number of Bytes flowing through the network interface.", - "unit": "By", - "sum": { - "dataPoints": [ - { - "attributes": [ - { - "key": "direction", - "value": { - "stringValue": "received" - } - } - ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "2837237037443" - }, - { - "attributes": [ - { - "key": "direction", - "value": { - "stringValue": "transmitted" - } - } - ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", - "asInt": "5877910030884" - } - ], - "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE", - "isMonotonic": true - } } ] } @@ -1474,8 +1474,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 0 }, { @@ -1487,15 +1487,15 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 0 } ] } }, { - "name": "nsxt.node.disk.usage", + "name": "nsxt.node.filesystem.usage", "description": "The amount of storage space used by the node.", "unit": "By", "sum": { @@ -1509,8 +1509,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "26168032" }, { @@ -1522,8 +1522,8 @@ } } ], - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "237014124" } ], @@ -1531,14 +1531,14 @@ } }, { - "name": "nsxt.node.disk.utilization", + "name": "nsxt.node.filesystem.utilization", "description": "The percentage of storage space utilized.", "unit": "%", "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asDouble": 0.09942935492936687 } ] @@ -1546,13 +1546,13 @@ }, { "name": "nsxt.node.memory.usage", - "description": "The memory usage of the node", + "description": "The memory usage of the node.", "unit": "KBy", "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652125160518076000", - "timeUnixNano": "1652125160526121000", + "startTimeUnixNano": "1652216053832502000", + "timeUnixNano": "1652216053835312000", "asInt": "19636300" } ], @@ -1564,4 +1564,4 @@ ] } ] -} \ No newline at end of file +} From f43231d81a3133c764f1ea0590c46245a187a5f7 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 10 May 2022 16:59:48 -0400 Subject: [PATCH 40/48] fix collection of mem_cache --- receiver/nsxtreceiver/scraper.go | 5 +- .../testdata/metrics/expected_metrics.json | 291 +++++++++--------- .../status.json | 2 +- 3 files changed, 155 insertions(+), 143 deletions(-) diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index 0a145e9c1f84..762ffa4c4a67 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -230,10 +230,7 @@ func (s *scraper) recordNode( s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClassDatapath) s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClassServices) s.mb.RecordNsxtNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) - - if ss.EdgeMemUsage != nil { - s.mb.RecordNsxtNodeMemoryCacheUsageDataPoint(colTime, int64(ss.EdgeMemUsage.CacheUsage)) - } + s.mb.RecordNsxtNodeMemoryCacheUsageDataPoint(colTime, int64(ss.MemCache)) s.mb.RecordNsxtNodeFilesystemUsageDataPoint(colTime, int64(ss.DiskSpaceUsed), metadata.AttributeDiskStateUsed) availableStorage := ss.DiskSpaceTotal - ss.DiskSpaceUsed diff --git a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json index 99d3f49b9a35..a0392a775b4a 100644 --- a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json @@ -38,8 +38,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "4161088074" }, { @@ -51,8 +51,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -81,8 +81,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -100,8 +100,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -119,8 +119,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "63594238" }, { @@ -138,8 +138,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -157,8 +157,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -176,8 +176,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -227,8 +227,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "4161088074" }, { @@ -240,8 +240,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -270,8 +270,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -289,8 +289,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -308,8 +308,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "63594238" }, { @@ -327,8 +327,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -346,8 +346,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -365,8 +365,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -422,8 +422,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 0.01 }, { @@ -435,8 +435,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 4.34 } ] @@ -457,8 +457,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -470,8 +470,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -485,8 +485,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 0 } ] @@ -499,9 +499,9 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", - "asInt": "8" + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", + "asInt": "0" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" @@ -514,8 +514,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "89169108" } ], @@ -564,8 +564,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "4161088074" }, { @@ -577,8 +577,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -607,8 +607,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -626,8 +626,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -645,8 +645,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "63594238" }, { @@ -664,8 +664,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -683,8 +683,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -702,8 +702,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -753,8 +753,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "4161088074" }, { @@ -766,8 +766,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -796,8 +796,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -815,8 +815,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -834,8 +834,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "63594238" }, { @@ -853,8 +853,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -872,8 +872,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -891,8 +891,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -948,8 +948,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 0.01 }, { @@ -961,8 +961,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 4.34 } ] @@ -983,8 +983,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -996,8 +996,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" } ], @@ -1011,8 +1011,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 0 } ] @@ -1025,9 +1025,9 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", - "asInt": "8" + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", + "asInt": "234" } ], "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" @@ -1040,8 +1040,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "143728936" } ], @@ -1090,8 +1090,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "2837237037443" }, { @@ -1103,8 +1103,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "5877910030884" } ], @@ -1133,8 +1133,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "288" }, { @@ -1152,8 +1152,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -1171,8 +1171,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "12483778397" }, { @@ -1190,8 +1190,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -1209,8 +1209,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -1228,8 +1228,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "12313320048" } ], @@ -1279,8 +1279,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "2837237037443" }, { @@ -1292,8 +1292,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "5877910030884" } ], @@ -1322,8 +1322,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "288" }, { @@ -1341,8 +1341,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -1360,8 +1360,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "12483778397" }, { @@ -1379,8 +1379,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -1398,8 +1398,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "0" }, { @@ -1417,8 +1417,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "12313320048" } ], @@ -1474,8 +1474,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 0 }, { @@ -1487,8 +1487,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 0 } ] @@ -1509,8 +1509,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "26168032" }, { @@ -1522,8 +1522,8 @@ } } ], - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "237014124" } ], @@ -1537,13 +1537,28 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asDouble": 0.09942935492936687 } ] } }, + { + "name": "nsxt.node.memory.cache.usage", + "description": "The size of the node's memory cache.", + "unit": "KBy", + "sum": { + "dataPoints": [ + { + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", + "asInt": "1716556" + } + ], + "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, { "name": "nsxt.node.memory.usage", "description": "The memory usage of the node.", @@ -1551,8 +1566,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216053832502000", - "timeUnixNano": "1652216053835312000", + "startTimeUnixNano": "1652216331356277000", + "timeUnixNano": "1652216331357449000", "asInt": "19636300" } ], diff --git a/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json index 00475ab631cb..1498b1536a2d 100644 --- a/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json +++ b/receiver/nsxtreceiver/testdata/metrics/nodes/transport/f5045ed2-43ab-4a35-a2c5-d20c30a32292/status.json @@ -136,7 +136,7 @@ 0.08, 0.08 ], - "mem_cache": 0, + "mem_cache": 234, "mem_total": 803479616, "mem_used": 143728936, "source": "cached", From 49bbbb9b87667c0b163435f9dd433c81c2f5c670 Mon Sep 17 00:00:00 2001 From: schmikei Date: Tue, 10 May 2022 17:10:24 -0400 Subject: [PATCH 41/48] remove underscore --- receiver/nsxtreceiver/client_mock_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/receiver/nsxtreceiver/client_mock_test.go b/receiver/nsxtreceiver/client_mock_test.go index 2fdeb57aba86..30a02fe9ee52 100644 --- a/receiver/nsxtreceiver/client_mock_test.go +++ b/receiver/nsxtreceiver/client_mock_test.go @@ -107,8 +107,8 @@ func (m *MockClient) Interfaces(ctx context.Context, nodeID string, class nodeCl } // NodeStatus provides a mock function with given fields: ctx, nodeID, class -func (_m *MockClient) NodeStatus(ctx context.Context, nodeID string, class nodeClass) (*model.NodeStatus, error) { - ret := _m.Called(ctx, nodeID, class) +func (m *MockClient) NodeStatus(ctx context.Context, nodeID string, class nodeClass) (*model.NodeStatus, error) { + ret := m.Called(ctx, nodeID, class) var r0 *model.NodeStatus if rf, ok := ret.Get(0).(func(context.Context, string, nodeClass) *model.NodeStatus); ok { From b3436fa14c25058f60154c6c2d6c71d75f818a40 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 11 May 2022 14:58:22 -0400 Subject: [PATCH 42/48] remove comment and add nodeType and nodeID to network metrics --- receiver/nsxtreceiver/scraper.go | 2 ++ receiver/nsxtreceiver/scraper_test.go | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index 762ffa4c4a67..a37a8fc4206f 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -215,6 +215,8 @@ func (s *scraper) recordNodeInterface(colTime pdata.Timestamp, nodeProps dm.Node s.mb.EmitForResource( metadata.WithDeviceID(i.iFace.InterfaceId), metadata.WithNsxtNodeName(nodeProps.Name), + metadata.WithNsxtNodeType(nodeProps.ResourceType), + metadata.WithNsxtNodeID(nodeProps.ID), ) } diff --git a/receiver/nsxtreceiver/scraper_test.go b/receiver/nsxtreceiver/scraper_test.go index 7bdf179d3592..f4b058ceb7f0 100644 --- a/receiver/nsxtreceiver/scraper_test.go +++ b/receiver/nsxtreceiver/scraper_test.go @@ -76,8 +76,6 @@ func TestScrape(t *testing.T) { func TestScrapeTransportNodeErrors(t *testing.T) { mockClient := NewMockClient(t) - - // mockClient.On("ClusterNodes", mock.Anything).Return(nil, errUnauthorized) mockClient.On("TransportNodes", mock.Anything).Return(nil, errUnauthorized) scraper := newScraper( &Config{ From 7f187a81189708bcbba28c5bd1afc03e1f4fedb1 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 11 May 2022 15:33:03 -0400 Subject: [PATCH 43/48] fix expected metrics with new resource attributes --- .../testdata/metrics/expected_metrics.json | 348 +++++++++++------- 1 file changed, 210 insertions(+), 138 deletions(-) diff --git a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json index a0392a775b4a..7d5598f67504 100644 --- a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json @@ -14,6 +14,18 @@ "value": { "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" } + }, + { + "key": "nsxt.node.type", + "value": { + "stringValue": "TransportNode" + } + }, + { + "key": "nsxt.node.id", + "value": { + "stringValue": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827" + } } ] }, @@ -38,8 +50,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "4161088074" }, { @@ -51,8 +63,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -81,8 +93,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -100,8 +112,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -119,8 +131,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "63594238" }, { @@ -138,8 +150,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -157,8 +169,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -176,8 +188,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -203,6 +215,18 @@ "value": { "stringValue": "esxi-18938.cf5e88ac.australia-southeast1.gve.goog" } + }, + { + "key": "nsxt.node.type", + "value": { + "stringValue": "TransportNode" + } + }, + { + "key": "nsxt.node.id", + "value": { + "stringValue": "0e7bd3f2-bd49-4fa2-b650-9e9bfcdad827" + } } ] }, @@ -227,8 +251,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "4161088074" }, { @@ -240,8 +264,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -270,8 +294,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -289,8 +313,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -308,8 +332,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "63594238" }, { @@ -327,8 +351,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -346,8 +370,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -365,8 +389,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -422,8 +446,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 0.01 }, { @@ -435,8 +459,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 4.34 } ] @@ -457,8 +481,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -470,8 +494,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -485,8 +509,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 0 } ] @@ -499,8 +523,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -514,8 +538,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "89169108" } ], @@ -540,6 +564,18 @@ "value": { "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" } + }, + { + "key": "nsxt.node.type", + "value": { + "stringValue": "TransportNode" + } + }, + { + "key": "nsxt.node.id", + "value": { + "stringValue": "f5045ed2-43ab-4a35-a2c5-d20c30a32292" + } } ] }, @@ -564,8 +600,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "4161088074" }, { @@ -577,8 +613,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -607,8 +643,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -626,8 +662,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -645,8 +681,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "63594238" }, { @@ -664,8 +700,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -683,8 +719,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -702,8 +738,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -729,6 +765,18 @@ "value": { "stringValue": "esxi-27971.cf5e88ac.australia-southeast1.gve.goog" } + }, + { + "key": "nsxt.node.type", + "value": { + "stringValue": "TransportNode" + } + }, + { + "key": "nsxt.node.id", + "value": { + "stringValue": "f5045ed2-43ab-4a35-a2c5-d20c30a32292" + } } ] }, @@ -753,8 +801,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "4161088074" }, { @@ -766,8 +814,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -796,8 +844,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -815,8 +863,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -834,8 +882,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "63594238" }, { @@ -853,8 +901,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -872,8 +920,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -891,8 +939,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -948,8 +996,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 0.01 }, { @@ -961,8 +1009,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 4.34 } ] @@ -983,8 +1031,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -996,8 +1044,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" } ], @@ -1011,8 +1059,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 0 } ] @@ -1025,8 +1073,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "234" } ], @@ -1040,8 +1088,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "143728936" } ], @@ -1066,6 +1114,18 @@ "value": { "stringValue": "nsxmgr-03" } + }, + { + "key": "nsxt.node.type", + "value": { + "stringValue": "ClusterNodeConfig" + } + }, + { + "key": "nsxt.node.id", + "value": { + "stringValue": "b7a79908-9808-4c9e-bb49-b70008993fcb" + } } ] }, @@ -1090,8 +1150,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "2837237037443" }, { @@ -1103,8 +1163,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "5877910030884" } ], @@ -1133,8 +1193,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "288" }, { @@ -1152,8 +1212,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -1171,8 +1231,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "12483778397" }, { @@ -1190,8 +1250,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -1209,8 +1269,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -1228,8 +1288,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "12313320048" } ], @@ -1255,6 +1315,18 @@ "value": { "stringValue": "nsxmgr-03" } + }, + { + "key": "nsxt.node.type", + "value": { + "stringValue": "ClusterNodeConfig" + } + }, + { + "key": "nsxt.node.id", + "value": { + "stringValue": "b7a79908-9808-4c9e-bb49-b70008993fcb" + } } ] }, @@ -1279,8 +1351,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "2837237037443" }, { @@ -1292,8 +1364,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "5877910030884" } ], @@ -1322,8 +1394,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "288" }, { @@ -1341,8 +1413,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -1360,8 +1432,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "12483778397" }, { @@ -1379,8 +1451,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -1398,8 +1470,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "0" }, { @@ -1417,8 +1489,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "12313320048" } ], @@ -1474,8 +1546,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 0 }, { @@ -1487,8 +1559,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 0 } ] @@ -1509,8 +1581,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "26168032" }, { @@ -1522,8 +1594,8 @@ } } ], - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "237014124" } ], @@ -1537,8 +1609,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asDouble": 0.09942935492936687 } ] @@ -1551,8 +1623,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "1716556" } ], @@ -1566,8 +1638,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652216331356277000", - "timeUnixNano": "1652216331357449000", + "startTimeUnixNano": "1652297515686182000", + "timeUnixNano": "1652297515693918000", "asInt": "19636300" } ], From e496de9f93f575adcf88575314ca2ce6faefd599 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 11 May 2022 22:55:00 -0400 Subject: [PATCH 44/48] fix alibaba version --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index f01bfed604cb..310e1b03da31 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib go 1.17 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awskinesisexporter v0.51.0 @@ -132,6 +133,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zookeeperreceiver v0.51.0 + github.com/prometheus/prometheus v0.35.1-0.20220503184552-2381d7be5731 github.com/stretchr/testify v1.7.1 go.opentelemetry.io/collector v0.51.0 go.uber.org/multierr v1.8.0 From 8017881873d133d4a6b9f7ac746ebc8baabf4064 Mon Sep 17 00:00:00 2001 From: schmikei Date: Wed, 11 May 2022 23:11:48 -0400 Subject: [PATCH 45/48] fix alibaba version; again --- cmd/configschema/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index 443bd5818eb1..6d6c8726ea65 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -233,7 +233,7 @@ require ( github.com/nginxinc/nginx-prometheus-exporter v0.8.1-0.20201110005315-f5a5f8086c19 // indirect github.com/observiq/ctimefmt v1.0.0 // indirect github.com/olivere/elastic v6.2.37+incompatible // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.0.0-00010101000000-000000000000 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awskinesisexporter v0.51.0 // indirect From 2a24517906f698d3ce969cc5e4e0f2cd40a85a54 Mon Sep 17 00:00:00 2001 From: schmikei Date: Thu, 12 May 2022 10:35:19 -0400 Subject: [PATCH 46/48] accomodate small changes to attribute name and simple error return changing --- receiver/nsxtreceiver/README.md | 4 +- receiver/nsxtreceiver/documentation.md | 5 +- .../internal/metadata/generated_metrics_v2.go | 43 ++- receiver/nsxtreceiver/metadata.yaml | 6 +- receiver/nsxtreceiver/scraper.go | 7 +- .../testdata/metrics/expected_metrics.json | 290 +++++++++--------- 6 files changed, 174 insertions(+), 181 deletions(-) diff --git a/receiver/nsxtreceiver/README.md b/receiver/nsxtreceiver/README.md index 43b479db63e9..e976f5bbde57 100644 --- a/receiver/nsxtreceiver/README.md +++ b/receiver/nsxtreceiver/README.md @@ -44,8 +44,8 @@ receivers: username: admin password: password timeout: 60s - settings: - nsx.node.cpu.utilization: + metrics: + nsxt.node.cpu.utilization: enabled: false exporters: diff --git a/receiver/nsxtreceiver/documentation.md b/receiver/nsxtreceiver/documentation.md index 221255576804..0c4d980d5d92 100644 --- a/receiver/nsxtreceiver/documentation.md +++ b/receiver/nsxtreceiver/documentation.md @@ -8,7 +8,7 @@ These are the metrics available for this scraper. | Name | Description | Unit | Type | Attributes | | ---- | ----------- | ---- | ---- | ---------- | -| **nsxt.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • cpu.process.class
| +| **nsxt.node.cpu.utilization** | The average amount of CPU being used by the node. | % | Gauge(Double) |
  • class
| | **nsxt.node.filesystem.usage** | The amount of storage space used by the node. | By | Sum(Int) |
  • disk_state
| | **nsxt.node.filesystem.utilization** | The percentage of storage space utilized. | % | Gauge(Double) |
| | **nsxt.node.memory.cache.usage** | The size of the node's memory cache. | KBy | Sum(Int) |
| @@ -38,8 +38,7 @@ metrics: | Name | Description | Values | | ---- | ----------- | ------ | -| cpu.process.class | The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes. | datapath, services | +| class | The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes. | datapath, services | | direction (direction) | The direction of network flow. | received, transmitted | | disk_state (state) | The state of storage space. | used, available | -| load_balancer | The name of the load balancer being utilized. | | | packet.type (type) | The type of packet counter. | dropped, errored, success | diff --git a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go index c7c88ea98429..e75cc4412379 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go @@ -51,30 +51,30 @@ func DefaultMetricsSettings() MetricsSettings { } } -// AttributeCPUProcessClass specifies the a value cpu.process.class attribute. -type AttributeCPUProcessClass int +// AttributeClass specifies the a value class attribute. +type AttributeClass int const ( - _ AttributeCPUProcessClass = iota - AttributeCPUProcessClassDatapath - AttributeCPUProcessClassServices + _ AttributeClass = iota + AttributeClassDatapath + AttributeClassServices ) -// String returns the string representation of the AttributeCPUProcessClass. -func (av AttributeCPUProcessClass) String() string { +// String returns the string representation of the AttributeClass. +func (av AttributeClass) String() string { switch av { - case AttributeCPUProcessClassDatapath: + case AttributeClassDatapath: return "datapath" - case AttributeCPUProcessClassServices: + case AttributeClassServices: return "services" } return "" } -// MapAttributeCPUProcessClass is a helper map of string to AttributeCPUProcessClass attribute value. -var MapAttributeCPUProcessClass = map[string]AttributeCPUProcessClass{ - "datapath": AttributeCPUProcessClassDatapath, - "services": AttributeCPUProcessClassServices, +// MapAttributeClass is a helper map of string to AttributeClass attribute value. +var MapAttributeClass = map[string]AttributeClass{ + "datapath": AttributeClassDatapath, + "services": AttributeClassServices, } // AttributeDirection specifies the a value direction attribute. @@ -174,7 +174,7 @@ func (m *metricNsxtNodeCPUUtilization) init() { m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) } -func (m *metricNsxtNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue string) { +func (m *metricNsxtNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val float64, classAttributeValue string) { if !m.settings.Enabled { return } @@ -182,7 +182,7 @@ func (m *metricNsxtNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetDoubleVal(val) - dp.Attributes().Insert(A.CPUProcessClass, pcommon.NewValueString(cpuProcessClassAttributeValue)) + dp.Attributes().Insert(A.Class, pcommon.NewValueString(classAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -643,8 +643,8 @@ func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics { } // RecordNsxtNodeCPUUtilizationDataPoint adds a data point to nsxt.node.cpu.utilization metric. -func (mb *MetricsBuilder) RecordNsxtNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, cpuProcessClassAttributeValue AttributeCPUProcessClass) { - mb.metricNsxtNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, cpuProcessClassAttributeValue.String()) +func (mb *MetricsBuilder) RecordNsxtNodeCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64, classAttributeValue AttributeClass) { + mb.metricNsxtNodeCPUUtilization.recordDataPoint(mb.startTime, ts, val, classAttributeValue.String()) } // RecordNsxtNodeFilesystemUsageDataPoint adds a data point to nsxt.node.filesystem.usage metric. @@ -688,21 +688,18 @@ func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { // Attributes contains the possible metric attributes that can be used. var Attributes = struct { - // CPUProcessClass (The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes.) - CPUProcessClass string + // Class (The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes.) + Class string // Direction (The direction of network flow.) Direction string // DiskState (The state of storage space.) DiskState string - // LoadBalancer (The name of the load balancer being utilized.) - LoadBalancer string // PacketType (The type of packet counter.) PacketType string }{ - "cpu.process.class", + "class", "direction", "state", - "load_balancer", "type", } diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index 9e73f8da34da..54d4dcf14382 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -38,13 +38,11 @@ attributes: - dropped - errored - success - cpu.process.class: + class: description: The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes. enum: - datapath - services - load_balancer: - description: The name of the load balancer being utilized. metrics: nsxt.node.network.io: @@ -71,7 +69,7 @@ metrics: gauge: value_type: double enabled: true - attributes: [cpu.process.class] + attributes: [class] nsxt.node.filesystem.utilization: description: The percentage of storage space utilized. unit: "%" diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index a37a8fc4206f..1738ed5d6b80 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -95,8 +95,7 @@ func (s *scraper) retrieve(ctx context.Context) ([]*nodeInfo, error) { tNodes, err := s.client.TransportNodes(ctx) if err != nil { - errs.AddPartial(1, err) - return r, errs.Combine() + return r, err } cNodes, err := s.client.ClusterNodes(ctx) @@ -229,8 +228,8 @@ func (s *scraper) recordNode( } ss := info.stats.SystemStatus - s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeCPUProcessClassDatapath) - s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeCPUProcessClassServices) + s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageDpdk, metadata.AttributeClassDatapath) + s.mb.RecordNsxtNodeCPUUtilizationDataPoint(colTime, ss.CPUUsage.AvgCPUCoreUsageNonDpdk, metadata.AttributeClassServices) s.mb.RecordNsxtNodeMemoryUsageDataPoint(colTime, int64(ss.MemUsed)) s.mb.RecordNsxtNodeMemoryCacheUsageDataPoint(colTime, int64(ss.MemCache)) diff --git a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json index 7d5598f67504..d57dfcebb238 100644 --- a/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json +++ b/receiver/nsxtreceiver/testdata/metrics/expected_metrics.json @@ -50,8 +50,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "4161088074" }, { @@ -63,8 +63,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -93,8 +93,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -112,8 +112,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -131,8 +131,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "63594238" }, { @@ -150,8 +150,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -169,8 +169,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -188,8 +188,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -251,8 +251,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "4161088074" }, { @@ -264,8 +264,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -294,8 +294,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -313,8 +313,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -332,8 +332,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "63594238" }, { @@ -351,8 +351,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -370,8 +370,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -389,8 +389,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -440,27 +440,27 @@ { "attributes": [ { - "key": "cpu.process.class", + "key": "class", "value": { "stringValue": "datapath" } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 0.01 }, { "attributes": [ { - "key": "cpu.process.class", + "key": "class", "value": { "stringValue": "services" } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 4.34 } ] @@ -481,8 +481,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -494,8 +494,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -509,8 +509,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 0 } ] @@ -523,8 +523,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -538,8 +538,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "89169108" } ], @@ -600,8 +600,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "4161088074" }, { @@ -613,8 +613,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -643,8 +643,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -662,8 +662,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -681,8 +681,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "63594238" }, { @@ -700,8 +700,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -719,8 +719,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -738,8 +738,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -801,8 +801,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "4161088074" }, { @@ -814,8 +814,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -844,8 +844,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -863,8 +863,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -882,8 +882,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "63594238" }, { @@ -901,8 +901,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -920,8 +920,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -939,8 +939,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -990,27 +990,27 @@ { "attributes": [ { - "key": "cpu.process.class", + "key": "class", "value": { "stringValue": "datapath" } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 0.01 }, { "attributes": [ { - "key": "cpu.process.class", + "key": "class", "value": { "stringValue": "services" } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 4.34 } ] @@ -1031,8 +1031,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -1044,8 +1044,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" } ], @@ -1059,8 +1059,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 0 } ] @@ -1073,8 +1073,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "234" } ], @@ -1088,8 +1088,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "143728936" } ], @@ -1150,8 +1150,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "2837237037443" }, { @@ -1163,8 +1163,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "5877910030884" } ], @@ -1193,8 +1193,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "288" }, { @@ -1212,8 +1212,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -1231,8 +1231,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "12483778397" }, { @@ -1250,8 +1250,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -1269,8 +1269,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -1288,8 +1288,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "12313320048" } ], @@ -1351,8 +1351,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "2837237037443" }, { @@ -1364,8 +1364,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "5877910030884" } ], @@ -1394,8 +1394,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "288" }, { @@ -1413,8 +1413,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -1432,8 +1432,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "12483778397" }, { @@ -1451,8 +1451,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -1470,8 +1470,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "0" }, { @@ -1489,8 +1489,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "12313320048" } ], @@ -1540,27 +1540,27 @@ { "attributes": [ { - "key": "cpu.process.class", + "key": "class", "value": { "stringValue": "datapath" } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 0 }, { "attributes": [ { - "key": "cpu.process.class", + "key": "class", "value": { "stringValue": "services" } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 0 } ] @@ -1581,8 +1581,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "26168032" }, { @@ -1594,8 +1594,8 @@ } } ], - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "237014124" } ], @@ -1609,8 +1609,8 @@ "gauge": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asDouble": 0.09942935492936687 } ] @@ -1623,8 +1623,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "1716556" } ], @@ -1638,8 +1638,8 @@ "sum": { "dataPoints": [ { - "startTimeUnixNano": "1652297515686182000", - "timeUnixNano": "1652297515693918000", + "startTimeUnixNano": "1652365826688352000", + "timeUnixNano": "1652365826697632000", "asInt": "19636300" } ], @@ -1651,4 +1651,4 @@ ] } ] -} +} \ No newline at end of file From 2e6cc250a3b56ee4d6a871ca6f509eecef8ffd46 Mon Sep 17 00:00:00 2001 From: schmikei Date: Thu, 12 May 2022 12:28:55 -0400 Subject: [PATCH 47/48] just return error instead of 1 error errors.Combine() --- receiver/nsxtreceiver/scraper.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/receiver/nsxtreceiver/scraper.go b/receiver/nsxtreceiver/scraper.go index 1738ed5d6b80..f5a068f3fd82 100644 --- a/receiver/nsxtreceiver/scraper.go +++ b/receiver/nsxtreceiver/scraper.go @@ -100,8 +100,7 @@ func (s *scraper) retrieve(ctx context.Context) ([]*nodeInfo, error) { cNodes, err := s.client.ClusterNodes(ctx) if err != nil { - errs.AddPartial(1, err) - return r, errs.Combine() + return r, err } wg := &sync.WaitGroup{} From 38c88ddc1af4afd20d79c5df8debeffb20891829 Mon Sep 17 00:00:00 2001 From: schmikei Date: Thu, 12 May 2022 12:46:19 -0400 Subject: [PATCH 48/48] use latest mdatagen --- .../internal/metadata/generated_metrics_v2.go | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go index e75cc4412379..ef2ac7cacd7b 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_metrics_v2.go @@ -182,7 +182,7 @@ func (m *metricNsxtNodeCPUUtilization) recordDataPoint(start pcommon.Timestamp, dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetDoubleVal(val) - dp.Attributes().Insert(A.Class, pcommon.NewValueString(classAttributeValue)) + dp.Attributes().Insert("class", pcommon.NewValueString(classAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -235,7 +235,7 @@ func (m *metricNsxtNodeFilesystemUsage) recordDataPoint(start pcommon.Timestamp, dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) - dp.Attributes().Insert(A.DiskState, pcommon.NewValueString(diskStateAttributeValue)) + dp.Attributes().Insert("state", pcommon.NewValueString(diskStateAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -439,7 +439,7 @@ func (m *metricNsxtNodeNetworkIo) recordDataPoint(start pcommon.Timestamp, ts pc dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) - dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) + dp.Attributes().Insert("direction", pcommon.NewValueString(directionAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -492,8 +492,8 @@ func (m *metricNsxtNodeNetworkPacketCount) recordDataPoint(start pcommon.Timesta dp.SetStartTimestamp(start) dp.SetTimestamp(ts) dp.SetIntVal(val) - dp.Attributes().Insert(A.Direction, pcommon.NewValueString(directionAttributeValue)) - dp.Attributes().Insert(A.PacketType, pcommon.NewValueString(packetTypeAttributeValue)) + dp.Attributes().Insert("direction", pcommon.NewValueString(directionAttributeValue)) + dp.Attributes().Insert("type", pcommon.NewValueString(packetTypeAttributeValue)) } // updateCapacity saves max length of data point slices that will be used for the slice capacity. @@ -685,23 +685,3 @@ func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { op(mb) } } - -// Attributes contains the possible metric attributes that can be used. -var Attributes = struct { - // Class (The CPU usage of the architecture allocated for either DPDK (datapath) or non-DPDK (services) processes.) - Class string - // Direction (The direction of network flow.) - Direction string - // DiskState (The state of storage space.) - DiskState string - // PacketType (The type of packet counter.) - PacketType string -}{ - "class", - "direction", - "state", - "type", -} - -// A is an alias for Attributes. -var A = Attributes