From 92640989e4b34e9673b7bcb3cccb29921336e745 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 8 Aug 2023 10:07:56 -0400 Subject: [PATCH 01/14] adding mock http server --- go.mod | 1 + go.sum | 2 + mock_server/http_server.go | 119 +++++++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 mock_server/http_server.go diff --git a/go.mod b/go.mod index 680f843f8..07800fcdd 100644 --- a/go.mod +++ b/go.mod @@ -55,6 +55,7 @@ require ( github.com/aws/smithy-go v1.13.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/gorilla/mux v1.8.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index a330665b3..71064c969 100644 --- a/go.sum +++ b/go.sum @@ -94,6 +94,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= diff --git a/mock_server/http_server.go b/mock_server/http_server.go new file mode 100644 index 000000000..ebfcf6d75 --- /dev/null +++ b/mock_server/http_server.go @@ -0,0 +1,119 @@ +// Copyright 2021 Amazon.com, Inc. or its affiliates +// +// 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 main + +import ( + "encoding/json" + "io" + "log" + "net/http" + "sync" + "sync/atomic" + "time" + + "github.com/gorilla/mux" +) + +const ( + HealthCheckMessage = "healthcheck" + SuccessMessage = "success" + CertFilePath = "./certificates/ssl/certificate.crt" + KeyFilePath = "./certificates/private.key" + DaemonPort = ":1053" +) + +type transactionStore struct { + transactions uint32 + startTime time.Time +} + +type TransactionPayload struct { + TransactionsPerMinute float64 `json:"tpm"` +} + +func healthCheck(w http.ResponseWriter, _ *http.Request) { + if _, err := io.WriteString(w, HealthCheckMessage); err != nil { + log.Printf("Unable to write response: %v", err) + } +} + +func (ts *transactionStore) checkData(w http.ResponseWriter, _ *http.Request) { + var message string + if atomic.LoadUint32(&ts.transactions) > 0 { + message = SuccessMessage + } + + if _, err := io.WriteString(w, message); err != nil { + io.WriteString(w, err.Error()) + log.Printf("Unable to write response: %v", err) + } +} + +func (ts *transactionStore) dataReceived(w http.ResponseWriter, _ *http.Request) { + atomic.AddUint32(&ts.transactions, 1) + + // Built-in latency + time.Sleep(15 * time.Millisecond) + w.WriteHeader(http.StatusOK) +} + +// Retrieve number of transactions per minute +func (ts *transactionStore) tpm(w http.ResponseWriter, _ *http.Request) { + // Calculate duration in minutes + duration := time.Now().Sub(ts.startTime) + transactions := float64(atomic.LoadUint32(&ts.transactions)) + tpm := transactions / duration.Minutes() + + w.Header().Set("Content-Type", "application/json") + if err := json.NewEncoder(w).Encode(TransactionPayload{tpm}); err != nil { + io.WriteString(w, err.Error()) + log.Printf("Unable to write response: %v", err) + } +} + +// Starts an HTTPS server that receives requests for the data handler service at the sample server port +// Starts an HTTP server that receives request from validator only to verify the data ingestion +func main() { + var wg sync.WaitGroup + wg.Add(2) + log.Println("\033[31m Starting Server \033[0m") + store := transactionStore{startTime: time.Now()} + + go func(ts *transactionStore) { + defer wg.Done() + defer log.Println("\033[32m Stopping Server \033[0m") + dataApp := mux.NewRouter() + dataApp.PathPrefix("/put-data").HandlerFunc(ts.dataReceived) + dataApp.HandleFunc("/trace/v1", ts.dataReceived) + dataApp.HandleFunc("/metric/v1", ts.dataReceived) + if err := http.ListenAndServe(DaemonPort, dataApp); err != nil { + log.Fatalf("HTTPS server error: %v", err) + } + }(&store) + + go func(ts *transactionStore) { + defer wg.Done() + defer log.Println("\033[32m Stopping Server \033[0m") + verifyApp := http.NewServeMux() + verifyApp.HandleFunc("/", healthCheck) + verifyApp.HandleFunc("/check-data", ts.checkData) + verifyApp.HandleFunc("/tpm", ts.tpm) + if err := http.ListenAndServe(":8080", verifyApp); err != nil { + log.Fatalf("Verification server error: %v", err) + } + }(&store) + + wg.Wait() +} From b10b434629ff8f52967723b4fa12db31b3f35450 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 8 Aug 2023 15:08:59 -0400 Subject: [PATCH 02/14] added testing to httpserver --- mock_server/http_server.go | 4 ++-- mock_server/http_server_test.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 mock_server/http_server_test.go diff --git a/mock_server/http_server.go b/mock_server/http_server.go index ebfcf6d75..44d823603 100644 --- a/mock_server/http_server.go +++ b/mock_server/http_server.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package mockserver import ( "encoding/json" @@ -85,7 +85,7 @@ func (ts *transactionStore) tpm(w http.ResponseWriter, _ *http.Request) { // Starts an HTTPS server that receives requests for the data handler service at the sample server port // Starts an HTTP server that receives request from validator only to verify the data ingestion -func main() { +func startHttpServer() { var wg sync.WaitGroup wg.Add(2) log.Println("\033[31m Starting Server \033[0m") diff --git a/mock_server/http_server_test.go b/mock_server/http_server_test.go new file mode 100644 index 000000000..fa62a34e7 --- /dev/null +++ b/mock_server/http_server_test.go @@ -0,0 +1,29 @@ +package mockserver + +import ( + "net/http" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +const ( + APP_SERVER_ADDR = "http://127.0.0.1" + APP_SERVER_PORT = ":" + "8080" + APP_SERVER = APP_SERVER_ADDR + APP_SERVER_PORT +) + +func HttpServerSanityCheck(t *testing.T) { + t.Helper() + res, err := http.Get(APP_SERVER) + require.NoErrorf(t, err, "Healthcheck failed: %s", err.Error()) + require.Contains(t, res, HealthCheckMessage) +} + +func TestHttpServer(t *testing.T) { + go startHttpServer() + time.Sleep(30 * time.Second) + HttpServerSanityCheck(t) + +} From cdd5866acebc84f8c5d47d95e9c6a26c910e2da1 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 8 Aug 2023 17:27:56 -0400 Subject: [PATCH 03/14] added graceful shutdown --- mock_server/http_server.go | 39 +++++++++++++++++++++------------ mock_server/http_server_test.go | 29 ++++++++++++++++++------ 2 files changed, 47 insertions(+), 21 deletions(-) diff --git a/mock_server/http_server.go b/mock_server/http_server.go index 44d823603..197248ee8 100644 --- a/mock_server/http_server.go +++ b/mock_server/http_server.go @@ -15,11 +15,11 @@ package mockserver import ( + "context" "encoding/json" "io" "log" "net/http" - "sync" "sync/atomic" "time" @@ -85,35 +85,46 @@ func (ts *transactionStore) tpm(w http.ResponseWriter, _ *http.Request) { // Starts an HTTPS server that receives requests for the data handler service at the sample server port // Starts an HTTP server that receives request from validator only to verify the data ingestion -func startHttpServer() { - var wg sync.WaitGroup - wg.Add(2) +func startHttpServer() chan interface{} { + serverControlChan := make(chan interface{}) log.Println("\033[31m Starting Server \033[0m") store := transactionStore{startTime: time.Now()} - + dataApp := mux.NewRouter() + daemonServer := &http.Server{Addr: DaemonPort, Handler: dataApp} + verifyApp := http.NewServeMux() + appServer := &http.Server{Addr: ":8080", Handler: verifyApp} go func(ts *transactionStore) { - defer wg.Done() - defer log.Println("\033[32m Stopping Server \033[0m") - dataApp := mux.NewRouter() + defer close(serverControlChan) dataApp.PathPrefix("/put-data").HandlerFunc(ts.dataReceived) dataApp.HandleFunc("/trace/v1", ts.dataReceived) dataApp.HandleFunc("/metric/v1", ts.dataReceived) - if err := http.ListenAndServe(DaemonPort, dataApp); err != nil { + if err := daemonServer.ListenAndServe(); err != nil { log.Fatalf("HTTPS server error: %v", err) + err = daemonServer.Shutdown(context.TODO()) + log.Fatalf("Shutdown server error: %v", err) } }(&store) go func(ts *transactionStore) { - defer wg.Done() - defer log.Println("\033[32m Stopping Server \033[0m") - verifyApp := http.NewServeMux() + defer close(serverControlChan) verifyApp.HandleFunc("/", healthCheck) verifyApp.HandleFunc("/check-data", ts.checkData) verifyApp.HandleFunc("/tpm", ts.tpm) - if err := http.ListenAndServe(":8080", verifyApp); err != nil { + if err := appServer.ListenAndServe(); err != nil { log.Fatalf("Verification server error: %v", err) + err := appServer.Shutdown(context.TODO()) + log.Fatalf("Shuwdown server error: %v", err) } }(&store) + go func() { + for { + select { + case <-serverControlChan: + log.Println("\033[32m Stopping Server \033[0m") + + } + } + }() - wg.Wait() + return serverControlChan } diff --git a/mock_server/http_server_test.go b/mock_server/http_server_test.go index fa62a34e7..16ad89123 100644 --- a/mock_server/http_server_test.go +++ b/mock_server/http_server_test.go @@ -1,6 +1,7 @@ package mockserver import ( + "io" "net/http" "testing" "time" @@ -13,17 +14,31 @@ const ( APP_SERVER_PORT = ":" + "8080" APP_SERVER = APP_SERVER_ADDR + APP_SERVER_PORT ) - +func HttpGetRequest(url string) (string,error) { + res,err := http.Get(url) + if err!=nil{ + return "",err + } + responseText, err := io.ReadAll(res.Body) + if err!=nil{ + return "",err + } + return string(responseText),nil + +} func HttpServerSanityCheck(t *testing.T) { t.Helper() - res, err := http.Get(APP_SERVER) - require.NoErrorf(t, err, "Healthcheck failed: %s", err.Error()) - require.Contains(t, res, HealthCheckMessage) + resString, err := HttpGetRequest(APP_SERVER) + require.NoErrorf(t, err, "Healthcheck failed: %v", err) + require.Contains(t, resString, HealthCheckMessage) +} +func HttpServerCheckData(t * testing.T){ + } - func TestHttpServer(t *testing.T) { - go startHttpServer() - time.Sleep(30 * time.Second) + serverControlChan := startHttpServer() + time.Sleep(3 * time.Second) HttpServerSanityCheck(t) + serverControlChan<-0 } From a58c33293f1079ee635dca226c5e1ccdd7d2ec51 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 8 Aug 2023 17:30:19 -0400 Subject: [PATCH 04/14] added check data --- mock_server/http_server.go | 10 ++++--- mock_server/http_server_test.go | 46 +++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/mock_server/http_server.go b/mock_server/http_server.go index 197248ee8..231b25a36 100644 --- a/mock_server/http_server.go +++ b/mock_server/http_server.go @@ -17,6 +17,7 @@ package mockserver import ( "context" "encoding/json" + "fmt" "io" "log" "net/http" @@ -51,10 +52,11 @@ func healthCheck(w http.ResponseWriter, _ *http.Request) { func (ts *transactionStore) checkData(w http.ResponseWriter, _ *http.Request) { var message string - if atomic.LoadUint32(&ts.transactions) > 0 { + var t =atomic.LoadUint32(&ts.transactions) + if t > 0 { message = SuccessMessage } - + fmt.Printf("\033[31m Time: %d | checkData msg: %s | %d\033[0m \n", time.Now().Unix(), message,t) if _, err := io.WriteString(w, message); err != nil { io.WriteString(w, err.Error()) log.Printf("Unable to write response: %v", err) @@ -65,6 +67,7 @@ func (ts *transactionStore) dataReceived(w http.ResponseWriter, _ *http.Request) atomic.AddUint32(&ts.transactions, 1) // Built-in latency + fmt.Printf("\033[31m Time: %d | data Received \033[0m \n", time.Now().Unix()) time.Sleep(15 * time.Millisecond) w.WriteHeader(http.StatusOK) } @@ -90,11 +93,12 @@ func startHttpServer() chan interface{} { log.Println("\033[31m Starting Server \033[0m") store := transactionStore{startTime: time.Now()} dataApp := mux.NewRouter() - daemonServer := &http.Server{Addr: DaemonPort, Handler: dataApp} + daemonServer := &http.Server{Addr: ":443", Handler: dataApp} verifyApp := http.NewServeMux() appServer := &http.Server{Addr: ":8080", Handler: verifyApp} go func(ts *transactionStore) { defer close(serverControlChan) + dataApp.HandleFunc("/", healthCheck) dataApp.PathPrefix("/put-data").HandlerFunc(ts.dataReceived) dataApp.HandleFunc("/trace/v1", ts.dataReceived) dataApp.HandleFunc("/metric/v1", ts.dataReceived) diff --git a/mock_server/http_server_test.go b/mock_server/http_server_test.go index 16ad89123..29648bc93 100644 --- a/mock_server/http_server_test.go +++ b/mock_server/http_server_test.go @@ -10,35 +10,47 @@ import ( ) const ( - APP_SERVER_ADDR = "http://127.0.0.1" - APP_SERVER_PORT = ":" + "8080" - APP_SERVER = APP_SERVER_ADDR + APP_SERVER_PORT + APP_SERVER_ADDR = "http://127.0.0.1" + APP_SERVER_PORT = ":" + "8080" + APP_SERVER = APP_SERVER_ADDR + APP_SERVER_PORT + DATA_SERVER_ADDR = "http://127.0.0.1" + DATA_SERVER_PORT = ":" + "443" + DATA_SERVER = DATA_SERVER_ADDR + DATA_SERVER_PORT ) -func HttpGetRequest(url string) (string,error) { - res,err := http.Get(url) - if err!=nil{ - return "",err + +func HttpGetRequest(url string) (string, error) { + res, err := http.Get(url) + if err != nil { + return "", err } responseText, err := io.ReadAll(res.Body) - if err!=nil{ - return "",err + if err != nil { + return "", err } - return string(responseText),nil - + return string(responseText), nil + } -func HttpServerSanityCheck(t *testing.T) { +func HttpServerSanityCheck(t *testing.T, url string) { t.Helper() - resString, err := HttpGetRequest(APP_SERVER) + resString, err := HttpGetRequest(url) require.NoErrorf(t, err, "Healthcheck failed: %v", err) require.Contains(t, resString, HealthCheckMessage) } -func HttpServerCheckData(t * testing.T){ - +func HttpServerCheckData(t *testing.T) { + t.Helper() + resString, err := HttpGetRequest(APP_SERVER + "/check-data") + require.NoErrorf(t, err, "Healthcheck failed: %v", err) + // require.Contains(t, resString, HealthCheckMessage) + t.Logf("resString: %s", resString) } +func HttpServerSendTrace(t *require.TestingT) {} func TestHttpServer(t *testing.T) { serverControlChan := startHttpServer() time.Sleep(3 * time.Second) - HttpServerSanityCheck(t) - serverControlChan<-0 + HttpServerSanityCheck(t, APP_SERVER) + HttpServerSanityCheck(t, DATA_SERVER) + HttpServerCheckData(t) + time.Sleep(5 * time.Minute) + serverControlChan <- 0 } From 98639fc082feb3f3620cf5887fe29a38c72d7b42 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 9 Aug 2023 15:28:23 -0400 Subject: [PATCH 05/14] added certificates for https Co-authored-by: name --- mock_server/Makefile | 23 +++++++++ mock_server/README | 8 +++ mock_server/certificates/private.key | 52 ++++++++++++++++++++ mock_server/certificates/ssl/ca-bundle.crt | 36 ++++++++++++++ mock_server/certificates/ssl/certificate.crt | 36 ++++++++++++++ mock_server/http_server.go | 2 +- mock_server/http_server_test.go | 20 +++++++- mock_server/openssl.conf | 28 +++++++++++ 8 files changed, 202 insertions(+), 3 deletions(-) create mode 100644 mock_server/Makefile create mode 100644 mock_server/README create mode 100644 mock_server/certificates/private.key create mode 100644 mock_server/certificates/ssl/ca-bundle.crt create mode 100644 mock_server/certificates/ssl/certificate.crt create mode 100644 mock_server/openssl.conf diff --git a/mock_server/Makefile b/mock_server/Makefile new file mode 100644 index 000000000..540460b77 --- /dev/null +++ b/mock_server/Makefile @@ -0,0 +1,23 @@ +# Header above mocked_servers cert in bundle +CERT_HEADER=mocked_servers + +CONFIG_PATH=openssl.conf +CERT_PATH=certificates/ssl/certificate.crt +KEY_PATH=certificates/private.key +BUNDLE_PATH=certificates/ssl/ca-bundle.crt + +.PHONY: update-certs +update-certs: gen-cert update-bundle + +# Expects mocked_servers cert to be the last cert in the bundle +# Cuts until the first instance of "mocked_servers" in the bundle +# and concatenates it with the current cert +.PHONY: update-bundle +update-bundle: + sed /$(CERT_HEADER)/q $(BUNDLE_PATH) | cat - $(CERT_PATH) > $(BUNDLE_PATH).tmp && \ + mv $(BUNDLE_PATH).tmp $(BUNDLE_PATH) + +# Generates the annual cert and private key using the config +.PHONY: gen-cert +gen-cert: + openssl req -config $(CONFIG_PATH) -new -x509 -nodes -days 365 -out $(CERT_PATH) -keyout $(KEY_PATH) \ No newline at end of file diff --git a/mock_server/README b/mock_server/README new file mode 100644 index 000000000..74b5c8444 --- /dev/null +++ b/mock_server/README @@ -0,0 +1,8 @@ +# Mocked Servers + +Most of the tests use mocked servers as stand-ins for the exporters to send to. +The docker images are built and pushed to ECR as part of `terraform/imagebuild` and then used in the tests as part of `defaults/docker_compose.tpl`. + +Most will use the `https` mocked_server, but some test cases like `otlp_grpc_exporter_metric_mock` and `otlp_grpc_exporter_trace_mock` will need to use the `grpc_metrics` and `grpc_trace` mocked_servers. + +The servers themselves are very basic. They listen for a message and tend to set a flag to success upon receiving it. Typically, they are set up with two servers: one to mock the backend and one to report on the status of that mock (if endpoint is called, how many times, etc.). There's a built-in 15ms of latency between each message that's received. The status reporter will always be on port 8080 and support the `:8080/` (returns "healthcheck") and the `:8080/check-data` (returns "success" if mock has received messages) endpoints. \ No newline at end of file diff --git a/mock_server/certificates/private.key b/mock_server/certificates/private.key new file mode 100644 index 000000000..f1b25e528 --- /dev/null +++ b/mock_server/certificates/private.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCUVAB1VBcztRsu +D0Kr+OVwEiN5HfinLUwh+SqX1fjPuSgU5ISfzYAy4aQ20H3rpee7y0DjNyDBKnTH +yxHcN/RNoRsM0D96QuRYx9+P5wCUUNchK7Pku/lFsJiO0TtuCxA5Jq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d7uSUepJes +jp6oMUT5PvR550TYaxEM9voB92JclMKrJvp/RD7QhvHPSvRKsKp8AfqId9z9Px9l +gZN54sJDHNRYTjqPfg7GN+08eRqGlLCuum7ZafoMBnfVxRZQGTp82p8DARBYVrCn +CKSyOZ+hs0XFOUZuBIucyXKJ/gfohkFDSfoUDzkCggEBAIf6VyOyD1321K1kC6bb +bJ/Gx7gP7oPIzHMzWpuowKAOM2FgG6W65qAVBdIremAbeu+dwxN3ts731BoB2Z+0 ++NXY2Li68gyjLSgHCy6Eqg9nAFzFhl90RAXqWFgLvfh69K8qubNwi48rNu/aDb6J +uqV1GYbfpBUU/wHgUsmtF853MIDsKsRGyGnFbyfXgyVfrSRGpbQth0bD2A/gd3f2 +uWzRReYBCFbdP+47Y+HVN+w+Ig/qGv/9s22vzQQYv775ditApVOTUYJdREQchR1J +EqkH+6tsJPK7oN0h97elIaJnnn8qYeZMFDur+xIjwo6MsHkmVZZskiUGuXC/7VM3 +D5ECggEAZGHdPoHrZux7FP7aeCV3RkFyYySg3WWwpnch16RX821iIk0oZlHMXD9l +BmalEvo2Xia8cdTFjVi+FmagktmwGlPLsTXHIFEU+kHV8QG7t6iOB++gbN3z2qo3 +SQ8f90gBOUl0J30eObVaE1tpOO1flMk/VibQ9VWrpNX2v6/khbSUrXI5gVjYvMa+ +YmGOcZmo8+f9Q409DQ+LTaHH91lYt2sp1Rjk6J7fADVKT5RXWxZKW+HZ1p7Omyz6 +AVyUAyScT9mjLz7faAGEA+e9ThrIfd/N0ohAhKMGnvPMpYvw6c8NP8AGFvFAt2kt +0rI6iVINGaTTRWLvOZOnOrZ6RFXOHg== +-----END PRIVATE KEY----- diff --git a/mock_server/certificates/ssl/ca-bundle.crt b/mock_server/certificates/ssl/ca-bundle.crt new file mode 100644 index 000000000..7af408469 --- /dev/null +++ b/mock_server/certificates/ssl/ca-bundle.crt @@ -0,0 +1,36 @@ +-----BEGIN CERTIFICATE----- +MIIGOTCCBCGgAwIBAgIUcz7fCLPSodq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_server/certificates/ssl/certificate.crt b/mock_server/certificates/ssl/certificate.crt new file mode 100644 index 000000000..7af408469 --- /dev/null +++ b/mock_server/certificates/ssl/certificate.crt @@ -0,0 +1,36 @@ +-----BEGIN CERTIFICATE----- +MIIGOTCCBCGgAwIBAgIUcz7fCLPSodq6qjL3Czp30dMvib4wDQYJKoZIhvcNAQEL +BQAwgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH +DAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsMDUlU +IERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5jb20x +FDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDgwOTE5MjUzNloXDTI0MDgwODE5 +MjUzNlowgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYD +VQQHDAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsM +DUlUIERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5j +b20xFDASBgNVBAMMC2V4YW1wbGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAlFQAdVQXM7UbLg9Cq/jlcBIjeR34py1MIfkql9X4z7koFOSEn82A +MuGkNtB966Xnu8tA4zcgwSp0x8sR3Df0TaEbDNA/ekLkWMffj+cAlFDXISuz5Lv5 +RbCYjtE7bgsQOSaq5UEce1h57ngogvr53mi/zY+uRITwv44jLjIf1U0Rp12vwn/V +1lPAI2Brri8up/Gq4vbNQWzUTBcVgyR1q63whImH9GyV9W8pAATGltcxN0JdaKYc +XS9qsuHF7REMBt17MMFe39LVIbp76U8ph+vadAonM9d+78Z7dN6JMKG9Yc9g2zDl +/WBwtrcjQriwQtOVUpWgbr0HjbIdmD16tS3Ul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I421mTP7mf3MEQDwISoTAtFOHvuHEHZnJws7pJfmPiiG0WdxclJ25RFya7 +s+nwKPP+rz7AUrqkxc16nZlJLlfNqWRoFsrkNbg5AaLMAKzsdrWRBPkXig1siseD +teHsab59Of+lkNRo2g== +-----END CERTIFICATE----- diff --git a/mock_server/http_server.go b/mock_server/http_server.go index 231b25a36..e841d2dc0 100644 --- a/mock_server/http_server.go +++ b/mock_server/http_server.go @@ -102,7 +102,7 @@ func startHttpServer() chan interface{} { dataApp.PathPrefix("/put-data").HandlerFunc(ts.dataReceived) dataApp.HandleFunc("/trace/v1", ts.dataReceived) dataApp.HandleFunc("/metric/v1", ts.dataReceived) - if err := daemonServer.ListenAndServe(); err != nil { + if err := daemonServer.ListenAndServeTLS(CertFilePath, KeyFilePath ); err != nil { log.Fatalf("HTTPS server error: %v", err) err = daemonServer.Shutdown(context.TODO()) log.Fatalf("Shutdown server error: %v", err) diff --git a/mock_server/http_server_test.go b/mock_server/http_server_test.go index 29648bc93..bc21e9479 100644 --- a/mock_server/http_server_test.go +++ b/mock_server/http_server_test.go @@ -1,11 +1,13 @@ package mockserver import ( + "encoding/json" "io" "net/http" "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -43,14 +45,28 @@ func HttpServerCheckData(t *testing.T) { // require.Contains(t, resString, HealthCheckMessage) t.Logf("resString: %s", resString) } +func HttpServerCheckTPM(t *testing.T) { + t.Helper() + resString, err := HttpGetRequest(APP_SERVER + "/tpm") + require.NoErrorf(t, err, "tpm failed: %v", err) + var httpData map[string]interface{} + json.Unmarshal([]byte(resString), &httpData) + tpm, ok := httpData["tpm"] + require.True(t, ok, "tpm json is broken") + assert.Truef(t,tpm.(float64) > 1, "tpm is less than 1 %f", tpm) +} func HttpServerSendTrace(t *require.TestingT) {} func TestHttpServer(t *testing.T) { serverControlChan := startHttpServer() time.Sleep(3 * time.Second) HttpServerSanityCheck(t, APP_SERVER) - HttpServerSanityCheck(t, DATA_SERVER) + // HttpServerSanityCheck(t, DATA_SERVER) HttpServerCheckData(t) - time.Sleep(5 * time.Minute) + time.Sleep(1 * time.Minute) + for i := 1; i < 5; i++ { + HttpServerCheckTPM(t) + time.Sleep(20 * time.Minute) + } serverControlChan <- 0 } diff --git a/mock_server/openssl.conf b/mock_server/openssl.conf new file mode 100644 index 000000000..07acf7589 --- /dev/null +++ b/mock_server/openssl.conf @@ -0,0 +1,28 @@ +[CA_default] +copy_extensions = copy + +[req] +default_bits = 4096 +prompt = no +default_md = sha256 +distinguished_name = req_distinguished_name +x509_extensions = v3_ca + +[req_distinguished_name] +C = US +ST = Washington +L = Seattle +O = Example Company +OU = IT Department +emailAddress = example@example.com +CN = example.com + +[v3_ca] +basicConstraints = CA:FALSE +keyUsage = digitalSignature, keyEncipherment +subjectAltName = @alternate_names + +[alternate_names] +DNS.1 = localhost +DNS.2 = 127.0.0.1 +DNS.3 = mocked-server \ No newline at end of file From 194a59e6468e1f8ccf00aaf645d77dd1eeae7a11 Mon Sep 17 00:00:00 2001 From: okankoAMZ <107267850+okankoAMZ@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:43:48 -0400 Subject: [PATCH 06/14] Merge main to traces-performance-test (#3) * Upgrade EKS Version and Fix EKS EMF Log JSON (#329) * Multi-System Trace Integration Test (#318) Co-authored-by: Jeffrey Chien --------- Co-authored-by: Seth L <81644108+sethAmazon@users.noreply.github.com> Co-authored-by: Jeffrey Chien --- generator/test_case_generator.go | 2 + go.mod | 41 ++- go.sum | 476 ++++++++++++++++++++++++- terraform/eks/daemon/emf/main.tf | 2 +- terraform/eks/daemon/emf/variables.tf | 2 +- test/otlp/generator.go | 135 +++++++ test/otlp/resources/otlp-config.json | 8 + test/otlp/trace_test.go | 69 ++++ test/xray/generator.go | 103 ++++++ test/xray/resources/sampling-rule.json | 17 + test/xray/resources/xray-config.json | 11 + test/xray/trace_test.go | 67 ++++ util/awsservice/constant.go | 2 + util/awsservice/xray.go | 92 +++++ util/common/agent_util_unix.go | 14 +- util/common/traces.go | 114 ++++++ 16 files changed, 1128 insertions(+), 27 deletions(-) create mode 100644 test/otlp/generator.go create mode 100644 test/otlp/resources/otlp-config.json create mode 100644 test/otlp/trace_test.go create mode 100644 test/xray/generator.go create mode 100644 test/xray/resources/sampling-rule.json create mode 100644 test/xray/resources/xray-config.json create mode 100644 test/xray/trace_test.go create mode 100644 util/awsservice/xray.go create mode 100644 util/common/traces.go diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index e8f6e7cc7..0656de5f3 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -64,6 +64,8 @@ var testTypeToTestConfig = map[string][]testConfig{ {testDir: "./test/collection_interval"}, {testDir: "./test/metric_dimension"}, {testDir: "./test/restart"}, + {testDir: "./test/xray"}, + {testDir: "./test/otlp"}, { testDir: "./test/acceptance", targets: map[string]map[string]struct{}{"os": {"ubuntu-20.04": {}}}, diff --git a/go.mod b/go.mod index 07800fcdd..82d71bc14 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( collectd.org v0.5.0 github.com/DataDog/datadog-go v4.8.3+incompatible github.com/aws/aws-sdk-go v1.44.262 - github.com/aws/aws-sdk-go-v2 v1.18.0 + github.com/aws/aws-sdk-go-v2 v1.19.0 github.com/aws/aws-sdk-go-v2/config v1.18.10 github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.10.0 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 @@ -22,25 +22,33 @@ require ( github.com/aws/aws-sdk-go-v2/service/ecs v1.23.2 github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1 github.com/aws/aws-sdk-go-v2/service/ssm v1.33.0 - github.com/cenkalti/backoff/v4 v4.2.0 + github.com/aws/aws-sdk-go-v2/service/xray v1.16.14 + github.com/aws/aws-xray-sdk-go v1.8.1 + github.com/cenkalti/backoff/v4 v4.2.1 github.com/google/uuid v1.3.0 github.com/mitchellh/mapstructure v1.5.0 github.com/prozz/aws-embedded-metrics-golang v1.2.0 github.com/qri-io/jsonschema v0.2.1 github.com/shirou/gopsutil/v3 v3.23.3 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.3 + go.opentelemetry.io/contrib/propagators/aws v1.17.0 + go.opentelemetry.io/otel v1.16.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 + go.opentelemetry.io/otel/sdk v1.16.0 + go.opentelemetry.io/otel/trace v1.16.0 go.uber.org/multierr v1.9.0 golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 - golang.org/x/sys v0.6.0 + golang.org/x/sys v0.8.0 gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/Microsoft/go-winio v0.6.0 // indirect + github.com/andybalholm/brotli v1.0.4 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.10 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.18 // indirect github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.13.20 // indirect @@ -54,18 +62,35 @@ require ( github.com/aws/aws-sdk-go-v2/service/sts v1.18.2 // indirect github.com/aws/smithy-go v1.13.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/klauspost/compress v1.15.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/qri-io/jsonpointer v0.1.1 // indirect github.com/shoenig/go-m1cpu v0.1.4 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasthttp v1.34.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.7.0 // indirect - golang.org/x/mod v0.6.0 // indirect - golang.org/x/tools v0.2.0 // indirect + golang.org/x/mod v0.8.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + golang.org/x/tools v0.6.0 // indirect + google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + google.golang.org/grpc v1.55.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect ) diff --git a/go.sum b/go.sum index 71064c969..b81b7eff0 100644 --- a/go.sum +++ b/go.sum @@ -1,15 +1,56 @@ +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.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1MRDJM= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aws/aws-sdk-go v1.44.262 h1:gyXpcJptWoNkK+DiAiaBltlreoWKQXjAIh6FRh60F+I= github.com/aws/aws-sdk-go v1.44.262/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw= github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.18.0 h1:882kkTpSFhdgYRKVZ/VCgf7sd0ru57p2JCxz4/oN5RY= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2 v1.19.0 h1:klAT+y3pGFBU/qVf1uzwttpBbiuozJYWzNLHioyDJ+k= +github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= github.com/aws/aws-sdk-go-v2/config v1.18.10 h1:Znce11DWswdh+5kOsIp+QaNfY9igp1QUN+fZHCKmeCI= @@ -26,14 +67,16 @@ github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfI github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42vVYQY6pvSyJCJcFHlPIiY+YKdPtwnvMkY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 h1:kG5eQilShqmJbv11XL1VpyDbaEJzWxd4zRiCG30GSn4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 h1:hMUCiE3Zi5AHrRNGf5j985u0WyqI6r2NULhUfo0N/No= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35/go.mod h1:ipR5PvpSPqIqL5Mi82BxLnfMkHVbmco8kUwO2xrCi0M= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21/go.mod h1:+Gxn8jYn5k9ebfHEqlhrMirFjSW0v0C9fI+KN5vk2kE= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 h1:vFQlirhuM8lLlpI7imKOMsjdQLuN9CPi+k44F/OFVsk= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 h1:yOpYx+FTBdpk/g+sBU6Cb1H0U/TLEcYYp66mYqsPpcc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29/go.mod h1:M/eUABlDbw2uVrdAn+UsI6M727qp2fxkp8K0ejcBDUY= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 h1:KeTxcGdNnQudb46oOl4d90f2I33DF/c6q3RnZAmvQdQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28/go.mod h1:yRZVr/iT0AqyHeep00SZ4YfBAKojXz08w3XMBscdi0c= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.18 h1:H/mF2LNWwX00lD6FlYfKpLLZgUW7oIzCBkig78x4Xok= @@ -75,48 +118,157 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0 h1:Jfly6mRxk2ZOSlbCvZfKNS7T github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0/go.mod h1:TZSH7xLO7+phDtViY/KUp9WGCJMQkLJ/VpgkTFd5gh8= github.com/aws/aws-sdk-go-v2/service/sts v1.18.2 h1:J/4wIaGInCEYCGhTSruxCxeoA5cy91a+JT7cHFKFSHQ= github.com/aws/aws-sdk-go-v2/service/sts v1.18.2/go.mod h1:+lGbb3+1ugwKrNTWcf2RT05Xmp543B06zDFTwiTLp7I= +github.com/aws/aws-sdk-go-v2/service/xray v1.16.14 h1:wXpQ34XT8FXq7hH14OnwtHRVHFQjJRn72Fg6ClnC1fg= +github.com/aws/aws-sdk-go-v2/service/xray v1.16.14/go.mod h1:WPm8vBkEqJO6ykQhpNco10+rohJEo0VbjyZ+/sehjq0= +github.com/aws/aws-xray-sdk-go v1.8.1 h1:O4pXV+hnCskaamGsZnFpzHyAmgPGusBMN6i7nnsy0Fo= +github.com/aws/aws-xray-sdk-go v1.8.1/go.mod h1:wMmVYzej3sykAttNBkXQHK/+clAPWTOrPiajEk7Cp3A= github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash 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-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/collectd/go-collectd v0.5.0 h1:dDXnD+hkw7f3XPNtQm1feda+dGZtzTNWXZID+w0Npxk= github.com/collectd/go-collectd v0.5.0/go.mod h1:xQe/Em/Q9IrN5ifWOvK5ZP2vMIB4KlsIA550yYzhkpY= 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/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-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/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 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +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/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/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/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.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.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= 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/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +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/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +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/kinbiko/jsonassert v1.0.1 h1:8gdLmUaPWuxk2TzQSofKRqatFH6zwTF6AsUH4bugJYY= github.com/kinbiko/jsonassert v1.0.1/go.mod h1:QRwBwiAsrcJpjw+L+Q4WS8psLxuUY+HylVZS/4j74TM= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U= +github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +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/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prozz/aws-embedded-metrics-golang v1.2.0 h1:b/LFb8J9LbgANow/9nYZE3M3bkb457/dj0zAB3hPyvo= github.com/prozz/aws-embedded-metrics-golang v1.2.0/go.mod h1:MXOqF9cJCEHjj77LWq7NWK44/AOyaFzwmcAYqR3057M= github.com/qri-io/jsonpointer v0.1.1 h1:prVZBZLL6TW5vsSB9fFHFAMBLI4b0ri5vribQlTJiBA= github.com/qri-io/jsonpointer v0.1.1/go.mod h1:DnJPaYgiKu56EuDp8TU5wFLdZIcAnb/uH9v37ZaMV64= github.com/qri-io/jsonschema v0.2.1 h1:NNFoKms+kut6ABPf6xiKNM5214jzxAhDBrPHCJ97Wg0= github.com/qri-io/jsonschema v0.2.1/go.mod h1:g7DPkiOsK1xv6T/Ao5scXRkd+yTFygcANPBaaqW+VrI= +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/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil/v3 v3.23.3 h1:Syt5vVZXUDXPEXpIBt5ziWsJ4LdSAAxF4l/xZeQgSEE= @@ -125,69 +277,367 @@ github.com/shoenig/go-m1cpu v0.1.4 h1:SZPIgRM2sEF9NJy50mRHu9PKGwxyyTTJIWvCtgVboz github.com/shoenig/go-m1cpu v0.1.4/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.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.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.34.0 h1:d3AAQJ2DRcxJYHm7OXNXtXt2as1vMDfxeIcFvhmGGm4= +github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= 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.opentelemetry.io/contrib/propagators/aws v1.17.0 h1:IX8d7l2uRw61BlmZBOTQFaK+y22j6vytMVTs9wFrO+c= +go.opentelemetry.io/contrib/propagators/aws v1.17.0/go.mod h1:pAlCYRWff4uGqRXOVn3WP8pDZ5E0K56bEoG7a1VSL4k= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 h1:t4ZwRPU+emrcvM2e9DHd0Fsf0JTPVcbfa/BhTDF03d0= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0/go.mod h1:vLarbg68dH2Wa77g71zmKQqlQ8+8Rq3GRG31uc0WcWI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 h1:cbsD4cUcviQGXdw8+bo5x2wazq10SKz8hEbtCRPcU78= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0/go.mod h1:JgXSGah17croqhJfhByOLVY719k1emAXC8MVhCIJlRs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 h1:TVQp/bboR4mhZSav+MdgXB8FaRho1RC8UwVn3T0vjVc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0/go.mod h1:I33vtIe0sR96wfrUcilIzLoA3mLHhRmz9S9Te0S3gDo= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= 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/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +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-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI= golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +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-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-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-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +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-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +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-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/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-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-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-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-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-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-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/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/term v0.1.0/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.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/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +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-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.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 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= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +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/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-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-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +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.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.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.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +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 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-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/terraform/eks/daemon/emf/main.tf b/terraform/eks/daemon/emf/main.tf index e1bcfb305..28b8247de 100644 --- a/terraform/eks/daemon/emf/main.tf +++ b/terraform/eks/daemon/emf/main.tf @@ -337,7 +337,7 @@ resource "kubernetes_daemonset" "service" { command = [ "/bin/sh", "-c", - "while true; do CURRENT_TIME=\"$(date +%s%3N)\"; TIMESTAMP=\"$(($CURRENT_TIME *1000))\"; echo '{\"_aws\":{\"Timestamp\":'\"$${TIMESTAMP}\"',\"LogGroupName\":\"EMFEKSLogGroup\",\"CloudWatchMetrics\":[{\"Namespace\":\"EMFEKSNameSpace\",\"Dimensions\":[[\"Type\",\"ClusterName\"]],\"Metrics\":[{\"Name\":\"EMFCounter\",\"Unit\":\"Count\"}]}]},\"Type\":\"Counter\",\"EMFCounter\":5, \"ClusterName\": \"${aws_eks_cluster.this.name}\"}}' | socat -v -t 0 - UDP:0.0.0.0:25888; sleep 60; done" + "while true; do CURRENT_TIME=\"$(date +%s%3N)\"; TIMESTAMP=\"$(($CURRENT_TIME *1000))\"; echo '{\"_aws\":{\"Timestamp\":'\"$${TIMESTAMP}\"',\"LogGroupName\":\"EMFEKSLogGroup\",\"CloudWatchMetrics\":[{\"Namespace\":\"EMFEKSNameSpace\",\"Dimensions\":[[\"Type\",\"ClusterName\"]],\"Metrics\":[{\"Name\":\"EMFCounter\",\"Unit\":\"Count\"}]}]},\"Type\":\"Counter\",\"EMFCounter\":5, \"ClusterName\": \"${aws_eks_cluster.this.name}\"}' | socat -v -t 0 - UDP:0.0.0.0:25888; sleep 60; done" ] env { name = "HOST_IP" diff --git a/terraform/eks/daemon/emf/variables.tf b/terraform/eks/daemon/emf/variables.tf index 015d9b940..41afe484a 100644 --- a/terraform/eks/daemon/emf/variables.tf +++ b/terraform/eks/daemon/emf/variables.tf @@ -23,7 +23,7 @@ variable "cwagent_image_tag" { variable "k8s_version" { type = string - default = "1.24" + default = "1.27" } variable "ami_type" { diff --git a/test/otlp/generator.go b/test/otlp/generator.go new file mode 100644 index 000000000..d530f2910 --- /dev/null +++ b/test/otlp/generator.go @@ -0,0 +1,135 @@ +package otlp + +import ( + "context" + "errors" + "time" + + "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "go.opentelemetry.io/contrib/propagators/aws/xray" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" + "go.opentelemetry.io/otel/sdk/resource" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/trace" + "golang.org/x/exp/maps" +) + +var generatorError = errors.New("Generator error") + +const ( + serviceName = "load-generator" + attributeKeyAwsXrayAnnotations = "aws.xray.annotations" +) + +type OtlpTracesGenerator struct { + common.TraceGenerator + common.TraceGeneratorInterface +} + +func (g *OtlpTracesGenerator) StartSendingTraces(ctx context.Context) error { + client, shutdown, err := setupClient(ctx) + if err != nil { + return err + } + defer shutdown(ctx) + ticker := time.NewTicker(g.Cfg.Interval) + for { + select { + case <-g.Done: + ticker.Stop() + return client.ForceFlush(ctx) + case <-ticker.C: + if err = g.Generate(ctx); err != nil { + return err + } + } + } +} +func (g *OtlpTracesGenerator) StopSendingTraces() { + close(g.Done) +} +func newLoadGenerator(cfg *common.TraceGeneratorConfig) *OtlpTracesGenerator { + return &OtlpTracesGenerator{ + TraceGenerator: common.TraceGenerator{ + Cfg: cfg, + Done: make(chan struct{}), + SegmentsGenerationCount: 0, + SegmentsEndedCount: 0, + }, + } +} +func (g *OtlpTracesGenerator) Generate(ctx context.Context) error { + tracer := otel.Tracer("tracer") + g.SegmentsGenerationCount++ + _, span := tracer.Start(ctx, "example-span", trace.WithSpanKind(trace.SpanKindServer)) + defer func() { + span.End() + g.SegmentsEndedCount++ + }() + + if len(g.Cfg.Annotations) > 0 { + span.SetAttributes(attribute.StringSlice(attributeKeyAwsXrayAnnotations, maps.Keys(g.Cfg.Annotations))) + } + span.SetAttributes(g.Cfg.Attributes...) + return nil +} + +func (g *OtlpTracesGenerator) GetSegmentCount() (int, int) { + return g.SegmentsGenerationCount, g.SegmentsEndedCount +} + +func (g *OtlpTracesGenerator) GetAgentConfigPath() string { + return g.AgentConfigPath +} +func (g *OtlpTracesGenerator) GetAgentRuntime() time.Duration { + return g.AgentRuntime +} +func (g *OtlpTracesGenerator) GetName() string { + return g.Name +} +func (g *OtlpTracesGenerator) GetGeneratorConfig() *common.TraceGeneratorConfig { + return g.Cfg +} + +func setupClient(ctx context.Context) (*sdktrace.TracerProvider, func(context.Context) error, error) { + res := resource.NewWithAttributes( + semconv.SchemaURL, + semconv.ServiceName(serviceName), + ) + + tp, err := setupTraceProvider(ctx, res) + if err != nil { + return nil, nil, err + } + + otel.SetTracerProvider(tp) + otel.SetTextMapPropagator(xray.Propagator{}) + + return tp, func(context.Context) (err error) { + timeoutCtx, cancel := context.WithTimeout(ctx, time.Second) + defer cancel() + + err = tp.Shutdown(timeoutCtx) + if err != nil { + return err + } + return nil + }, nil +} + +func setupTraceProvider(ctx context.Context, res *resource.Resource) (*sdktrace.TracerProvider, error) { + exporter, err := otlptracegrpc.New(ctx, otlptracegrpc.WithInsecure()) + if err != nil { + return nil, err + } + + return sdktrace.NewTracerProvider( + sdktrace.WithSampler(sdktrace.AlwaysSample()), + sdktrace.WithBatcher(exporter), + sdktrace.WithResource(res), + sdktrace.WithIDGenerator(xray.NewIDGenerator()), + ), nil +} diff --git a/test/otlp/resources/otlp-config.json b/test/otlp/resources/otlp-config.json new file mode 100644 index 000000000..1f179f995 --- /dev/null +++ b/test/otlp/resources/otlp-config.json @@ -0,0 +1,8 @@ +{ + "traces": { + "traces_collected": { + "otlp": { + } + } + } +} \ No newline at end of file diff --git a/test/otlp/trace_test.go b/test/otlp/trace_test.go new file mode 100644 index 000000000..cae894eae --- /dev/null +++ b/test/otlp/trace_test.go @@ -0,0 +1,69 @@ +package otlp + +import ( + "path/filepath" + "testing" + "time" + + "github.com/aws/amazon-cloudwatch-agent-test/environment" + "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/attribute" +) + +const ( + agentRuntime = 5 * time.Minute + loadGeneratorInterval = 5 * time.Second + testSegmentCount = 20 +) + +func init() { + environment.RegisterEnvironmentMetaDataFlags() +} + +func TestTraces(t *testing.T) { + env := environment.GetEnvironmentMetaData() + testCases := map[string]struct { + agentConfigPath string + generatorConfig *common.TraceGeneratorConfig + }{ + "WithOTLP/Simple": { + agentConfigPath: filepath.Join("resources", "otlp-config.json"), + generatorConfig: &common.TraceGeneratorConfig{ + Interval: loadGeneratorInterval, + Annotations: map[string]interface{}{ + "test_type": "simple_otlp", + "instance_id": env.InstanceId, + "commit_sha": env.CwaCommitSha, + }, + Metadata: map[string]map[string]interface{}{ + "default": { + "custom_key": "custom_value", + }, + }, + Attributes: []attribute.KeyValue{ + attribute.String("custom_key", "custom_value"), + attribute.String("test_type", "simple_otlp"), + attribute.String("instance_id", env.InstanceId), + attribute.String("commit_sha", env.CwaCommitSha), + }, + }, + }, + } + t.Logf("Sanity check: number of test cases:%d", len(testCases)) + for name, testCase := range testCases { + + t.Run(name, func(t *testing.T) { + + OtlpTestCfg := common.TraceTestConfig{ + Generator: newLoadGenerator(testCase.generatorConfig), + Name: name, + AgentConfigPath: testCase.agentConfigPath, + AgentRuntime: agentRuntime, + } + err := common.TraceTest(t, OtlpTestCfg) + require.NoError(t, err, "TraceTest failed because %s", err) + + }) + } +} diff --git a/test/xray/generator.go b/test/xray/generator.go new file mode 100644 index 000000000..450af0b1e --- /dev/null +++ b/test/xray/generator.go @@ -0,0 +1,103 @@ +package xray + +import ( + "context" + "errors" + "log" + "os" + "path" + "time" + "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "github.com/aws/aws-xray-sdk-go/strategy/sampling" + "github.com/aws/aws-xray-sdk-go/xray" + "github.com/aws/aws-xray-sdk-go/xraylog" +) + +var generatorError = errors.New("Generator error") +type XrayTracesGenerator struct { + common.TraceGenerator + common.TraceGeneratorInterface +} + +func (g *XrayTracesGenerator) StartSendingTraces(ctx context.Context) error { + ticker := time.NewTicker(g.Cfg.Interval) + for { + select { + case <-g.Done: + ticker.Stop() + return nil + case <-ticker.C: + if err := g.Generate(ctx); err != nil { + return err + } + } + } +} +func (g *XrayTracesGenerator) StopSendingTraces() { + close(g.Done) +} +func newLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { + s, err := sampling.NewLocalizedStrategyFromFilePath( + path.Join("resources", "sampling-rule.json")) + if err != nil { + log.Fatalf("Couldn't apply sampling rule : %s", err) + } + xray.Configure(xray.Config{SamplingStrategy: s}) + xray.SetLogger(xraylog.NewDefaultLogger(os.Stdout, xraylog.LogLevelWarn)) + return &XrayTracesGenerator{ + TraceGenerator: common.TraceGenerator{ + Cfg: cfg, + Done: make(chan struct{}), + SegmentsGenerationCount: 0, + SegmentsEndedCount: 0, + }, + } +} +func (g *XrayTracesGenerator) Generate(ctx context.Context) error { + rootCtx, root := xray.BeginSegment(ctx, "load-generator") + g.SegmentsGenerationCount++ + defer func() { + root.Close(nil) + g.SegmentsEndedCount++ + }() + + for key, value := range g.Cfg.Annotations { + if err := root.AddAnnotation(key, value); err != nil { + return err + } + } + + for namespace, metadata := range g.Cfg.Metadata { + for key, value := range metadata { + if err := root.AddMetadataToNamespace(namespace, key, value); err != nil { + return err + } + } + } + + _, subSeg := xray.BeginSubsegment(rootCtx, "with-error") + defer subSeg.Close(nil) + + if err := subSeg.AddError(generatorError); err != nil { + return err + } + + return nil +} + +func (g *XrayTracesGenerator) GetSegmentCount() (int, int) { + return g.SegmentsGenerationCount, g.SegmentsEndedCount +} + +func (g *XrayTracesGenerator) GetAgentConfigPath() string { + return g.AgentConfigPath +} +func (g *XrayTracesGenerator) GetAgentRuntime() time.Duration { + return g.AgentRuntime +} +func (g *XrayTracesGenerator) GetName() string { + return g.Name +} +func (g *XrayTracesGenerator) GetGeneratorConfig() *common.TraceGeneratorConfig { + return g.Cfg +} diff --git a/test/xray/resources/sampling-rule.json b/test/xray/resources/sampling-rule.json new file mode 100644 index 000000000..72d46496e --- /dev/null +++ b/test/xray/resources/sampling-rule.json @@ -0,0 +1,17 @@ +{ + "version": 2, + "rules": [ + { + "description": "debug", + "host": "*", + "http_method": "*", + "url_path": "*", + "fixed_target": 0, + "rate": 1.0 + } + ], + "default": { + "fixed_target": 1, + "rate": 1.0 + } + } \ No newline at end of file diff --git a/test/xray/resources/xray-config.json b/test/xray/resources/xray-config.json new file mode 100644 index 000000000..75be23507 --- /dev/null +++ b/test/xray/resources/xray-config.json @@ -0,0 +1,11 @@ +{ + "agent":{ + "debug":true + }, + "traces": { + "traces_collected": { + "xray": { + } + } + } +} \ No newline at end of file diff --git a/test/xray/trace_test.go b/test/xray/trace_test.go new file mode 100644 index 000000000..73f803b02 --- /dev/null +++ b/test/xray/trace_test.go @@ -0,0 +1,67 @@ +package xray + +import ( + "path/filepath" + "testing" + "time" + + "github.com/aws/amazon-cloudwatch-agent-test/environment" + "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "github.com/stretchr/testify/require" +) + +const ( + agentRuntime = 1 * time.Minute + loadGeneratorInterval = 6 * time.Second +) + +// WARNING: If you increase number of segments generated +// You might see that the xray is dropping segments +// To overcome this please update the sampling-rule such that the "rate" is higher. +func init() { + environment.RegisterEnvironmentMetaDataFlags() +} + +func TestTraces(t *testing.T) { + env := environment.GetEnvironmentMetaData() + testCases := map[string]struct { + agentConfigPath string + generatorConfig *common.TraceGeneratorConfig + }{ + "WithXray/Simple": { + agentConfigPath: filepath.Join("resources", "xray-config.json"), + generatorConfig: &common.TraceGeneratorConfig{ + Interval: loadGeneratorInterval, + Annotations: map[string]interface{}{ + "test_type": "simple_xray", + "instance_id": env.InstanceId, + "commit_sha": env.CwaCommitSha, + }, + Metadata: map[string]map[string]interface{}{ + "default": { + "nested": map[string]interface{}{ + "key": "value", + }, + }, + "custom_namespace": { + "custom_key": "custom_value", + }, + }, + }, + }, + } + for name, testCase := range testCases { + + t.Run(name, func(t *testing.T) { + XrayTestCfg := common.TraceTestConfig{ + Generator: newLoadGenerator(testCase.generatorConfig), + Name: name, + AgentConfigPath: testCase.agentConfigPath, + AgentRuntime: agentRuntime, + } + err := common.TraceTest(t, XrayTestCfg) + require.NoError(t, err, "TraceTest failed because %s", err) + + }) + } +} diff --git a/util/awsservice/constant.go b/util/awsservice/constant.go index a0ce572b0..ff2a313d7 100644 --- a/util/awsservice/constant.go +++ b/util/awsservice/constant.go @@ -17,6 +17,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ecs" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/ssm" + "github.com/aws/aws-sdk-go-v2/service/xray" backoff "github.com/cenkalti/backoff/v4" ) @@ -48,4 +49,5 @@ var ( DynamodbClient = dynamodb.NewFromConfig(awsCfg) S3Client = s3.NewFromConfig(awsCfg) CloudformationClient = cloudformation.NewFromConfig(awsCfg) + XrayClient = xray.NewFromConfig(awsCfg) ) diff --git a/util/awsservice/xray.go b/util/awsservice/xray.go new file mode 100644 index 000000000..8c22fb871 --- /dev/null +++ b/util/awsservice/xray.go @@ -0,0 +1,92 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package awsservice + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/xray" + "github.com/aws/aws-sdk-go-v2/service/xray/types" +) + +const ( + // BatchGetTraces has a max trace ID size of 5. + batchGetTraceSizes = 5 +) + +func FilterExpression(annotations map[string]interface{}) string { + var expression string + for key, value := range annotations { + result, err := json.Marshal(value) + if err != nil { + continue + } + if len(expression) != 0 { + expression += " AND " + } + expression += fmt.Sprintf("annotation.%s = %s", key, result) + } + return expression +} + +func GetTraceIDs(startTime time.Time, endTime time.Time, filter string) ([]string, error) { + var traceIDs []string + input := &xray.GetTraceSummariesInput{StartTime: aws.Time(startTime), EndTime: aws.Time(endTime), FilterExpression: aws.String(filter)} + for { + output, err := XrayClient.GetTraceSummaries(context.Background(), input) + if err != nil { + return nil, err + } + for _, summary := range output.TraceSummaries { + traceIDs = append(traceIDs, *summary.Id) + } + if output.NextToken == nil { + break + } + input.NextToken = output.NextToken + } + return traceIDs, nil +} + +func GetSegments(traceIDs []string) ([]types.Segment, error) { + var segments []types.Segment + traces, err := GetBatchTraces(traceIDs) + if err != nil { + return nil, err + } + for _, trace := range traces { + segments = append(segments, trace.Segments...) + } + return segments, nil +} + +func GetBatchTraces(traceIDs []string) ([]types.Trace, error) { + var traces []types.Trace + length := len(traceIDs) + for i := 0; i < length; i += batchGetTraceSizes { + j := i + batchGetTraceSizes + if j > length { + j = length + } + input := &xray.BatchGetTracesInput{TraceIds: traceIDs[i:j]} + for { + output, err := XrayClient.BatchGetTraces(context.Background(), input) + if err != nil { + return nil, err + } + for _, trace := range output.Traces { + traces = append(traces, trace) + } + if output.NextToken == nil { + break + } + input.NextToken = output.NextToken + } + } + return traces, nil +} diff --git a/util/common/agent_util_unix.go b/util/common/agent_util_unix.go index 957d1b5c8..03c9a7287 100644 --- a/util/common/agent_util_unix.go +++ b/util/common/agent_util_unix.go @@ -6,13 +6,15 @@ package common import ( + "bytes" "fmt" - "github.com/aws/amazon-cloudwatch-agent-test/environment" "log" "os/exec" "path/filepath" "strings" "time" + + "github.com/aws/amazon-cloudwatch-agent-test/environment" ) const ( @@ -41,10 +43,14 @@ func CopyFile(pathIn string, pathOut string) { } log.Printf("File %s abs path %s", pathIn, pathInAbs) - out, err := exec.Command("bash", "-c", "sudo cp "+pathInAbs+" "+pathOut).Output() - + cmd := exec.Command("bash", "-c", "sudo cp "+pathInAbs+" "+pathOut) + var out bytes.Buffer + var stderr bytes.Buffer + cmd.Stdout = &out + cmd.Stderr = &stderr + err = cmd.Run() if err != nil { - log.Fatal(fmt.Sprint(err) + string(out)) + log.Fatalf("Error : %s | Error Code: %s | Out: %s", fmt.Sprint(err), stderr.String(), out.String()) } log.Printf("File : %s copied to : %s", pathIn, pathOut) diff --git a/util/common/traces.go b/util/common/traces.go new file mode 100644 index 000000000..b22dd1983 --- /dev/null +++ b/util/common/traces.go @@ -0,0 +1,114 @@ +package common + +import ( + "context" + "encoding/json" + "reflect" + "testing" + "time" + + "github.com/aws/amazon-cloudwatch-agent-test/util/awsservice" + "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/attribute" +) + +const ( + AGENT_SHUTDOWN_DELAY = 20 * time.Second // this const is the delay between stopping trace generation and stopping agent +) + +type TraceTestConfig struct { + Generator TraceGeneratorInterface + Name string + AgentConfigPath string + AgentRuntime time.Duration +} +type TraceGeneratorConfig struct { + Interval time.Duration + Annotations map[string]interface{} + Metadata map[string]map[string]interface{} + Attributes []attribute.KeyValue +} +type TraceGenerator struct { + Cfg *TraceGeneratorConfig + SegmentsGenerationCount int + SegmentsEndedCount int + AgentConfigPath string + AgentRuntime time.Duration + Name string + Done chan struct{} +} +type TraceGeneratorInterface interface { + StartSendingTraces(ctx context.Context) error + StopSendingTraces() + Generate(ctx context.Context) error + GetSegmentCount() (int, int) + GetAgentConfigPath() string + GetGeneratorConfig() *TraceGeneratorConfig + GetContext() context.Context + GetAgentRuntime() time.Duration + GetName() string +} + +func TraceTest(t *testing.T, traceTest TraceTestConfig) error { + t.Helper() + startTime := time.Now() + CopyFile(traceTest.AgentConfigPath, ConfigOutputPath) + require.NoError(t, StartAgent(ConfigOutputPath, true, false), "Couldn't Start the agent") + go func() { + require.NoError(t, traceTest.Generator.StartSendingTraces(context.Background()), "load generator exited with error") + }() + time.Sleep(traceTest.AgentRuntime) + traceTest.Generator.StopSendingTraces() + time.Sleep(AGENT_SHUTDOWN_DELAY) + StopAgent() + testsGenerated, testsEnded := traceTest.Generator.GetSegmentCount() + t.Logf("For %s , Test Cases Generated %d | Test Cases Ended: %d", traceTest.Name, testsGenerated, testsEnded) + endTime := time.Now() + t.Logf("Agent has been running for %s", endTime.Sub(startTime)) + time.Sleep(10 * time.Second) + + traceIDs, err := awsservice.GetTraceIDs(startTime, endTime, awsservice.FilterExpression( + traceTest.Generator.GetGeneratorConfig().Annotations)) + require.NoError(t, err, "unable to get trace IDs") + segments, err := awsservice.GetSegments(traceIDs) + require.NoError(t, err, "unable to get segments") + + assert.True(t, len(segments) >= testsGenerated, + "FAILED: Not enough segments, expected %d but got %d , traceIDCount: %d", + testsGenerated, len(segments), len(traceIDs)) + require.NoError(t, SegmentValidationTest(t, traceTest, segments), "Segment Validation Failed") + return nil +} + +func SegmentValidationTest(t *testing.T, traceTest TraceTestConfig, segments []types.Segment) error { + t.Helper() + cfg := traceTest.Generator.GetGeneratorConfig() + for _, segment := range segments { + var result map[string]interface{} + require.NoError(t, json.Unmarshal([]byte(*segment.Document), &result)) + if _, ok := result["parent_id"]; ok { + // skip subsegments + continue + } + annotations, ok := result["annotations"] + assert.True(t, ok, "missing annotations") + assert.True(t, reflect.DeepEqual(annotations, cfg.Annotations), "mismatching annotations") + metadataByNamespace, ok := result["metadata"].(map[string]interface{}) + assert.True(t, ok, "missing metadata") + for namespace, wantMetadata := range cfg.Metadata { + var gotMetadata map[string]interface{} + gotMetadata, ok = metadataByNamespace[namespace].(map[string]interface{}) + assert.Truef(t, ok, "missing metadata in namespace: %s", namespace) + for key, wantValue := range wantMetadata { + var gotValue interface{} + gotValue, ok = gotMetadata[key] + assert.Truef(t, ok, "missing expected metadata key: %s", key) + assert.Truef(t, reflect.DeepEqual(gotValue, wantValue), "mismatching values for key (%s):\ngot\n\t%v\nwant\n\t%v", key, gotValue, wantValue) + } + } + } + return nil + +} From 9ee337e3f787d4cc60d4013001574927ba5f1a42 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Thu, 10 Aug 2023 16:36:48 -0400 Subject: [PATCH 07/14] added xray performance test --- generator/test_case_generator.go | 11 +- mock_server/http_server_test.go | 71 +++++++++--- test/performance/trace/xray/agent_config.json | 107 ++++++++++++++++++ test/performance/trace/xray/parameters.yml | 70 ++++++++++++ validator/models/validation_config.go | 2 +- 5 files changed, 240 insertions(+), 21 deletions(-) create mode 100644 test/performance/trace/xray/agent_config.json create mode 100644 test/performance/trace/xray/parameters.yml diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index 0656de5f3..dabdfaf20 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -115,11 +115,12 @@ var testTypeToTestConfig = map[string][]testConfig{ //{testDir: "../../../test/assume_role"}, }, "ec2_performance": { - {testDir: "../../test/performance/emf"}, - {testDir: "../../test/performance/logs"}, - {testDir: "../../test/performance/system"}, - {testDir: "../../test/performance/statsd"}, - {testDir: "../../test/performance/collectd"}, + // {testDir: "../../test/performance/emf"}, + // {testDir: "../../test/performance/logs"}, + // {testDir: "../../test/performance/system"}, + // {testDir: "../../test/performance/statsd"}, + // {testDir: "../../test/performance/collectd"}, + {testDir: "../../test/performance/trace/xray"}, }, "ec2_windows_performance": { {testDir: "../../test/performance/windows/logs"}, diff --git a/mock_server/http_server_test.go b/mock_server/http_server_test.go index bc21e9479..b5dfca0c8 100644 --- a/mock_server/http_server_test.go +++ b/mock_server/http_server_test.go @@ -1,35 +1,58 @@ package mockserver import ( + "crypto/tls" "encoding/json" "io" "net/http" + "sync" "testing" "time" + "github.com/aws/amazon-cloudwatch-agent-test/test/xray" + "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) - +//https://github.com/aws-observability/aws-otel-test-framework/blob/terraform/mocked_servers/https/main.go const ( APP_SERVER_ADDR = "http://127.0.0.1" APP_SERVER_PORT = ":" + "8080" APP_SERVER = APP_SERVER_ADDR + APP_SERVER_PORT - DATA_SERVER_ADDR = "http://127.0.0.1" + DATA_SERVER_ADDR = "https://127.0.0.1" DATA_SERVER_PORT = ":" + "443" DATA_SERVER = DATA_SERVER_ADDR + DATA_SERVER_PORT + + SEND_TEST_DATA_COUNT time.Duration= 10 * time.Second + TPM_CHECK_INTERVAL time.Duration = 10 * time.Second + ) +func ResponseToString(res * http.Response) (string,error){ + responseText, err := io.ReadAll(res.Body) + if err != nil { + return "", err + } + return string(responseText), nil +} +func HttpsGetRequest(url string) (string, error){ + tr := &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + } + + client := &http.Client{Transport: tr} -func HttpGetRequest(url string) (string, error) { - res, err := http.Get(url) + res, err := client.Get(url) if err != nil { return "", err } - responseText, err := io.ReadAll(res.Body) + return ResponseToString(res) +} +func HttpGetRequest(url string) (string, error) { + res, err := http.Get(url) if err != nil { return "", err } - return string(responseText), nil + return ResponseToString(res) } func HttpServerSanityCheck(t *testing.T, url string) { @@ -38,6 +61,12 @@ func HttpServerSanityCheck(t *testing.T, url string) { require.NoErrorf(t, err, "Healthcheck failed: %v", err) require.Contains(t, resString, HealthCheckMessage) } +func HttpsServerSanityCheck(t *testing.T, url string) { + t.Helper() + resString, err := HttpsGetRequest(url) + require.NoErrorf(t, err, "Healthcheck failed: %v", err) + require.Contains(t, resString, HealthCheckMessage) +} func HttpServerCheckData(t *testing.T) { t.Helper() resString, err := HttpGetRequest(APP_SERVER + "/check-data") @@ -55,18 +84,30 @@ func HttpServerCheckTPM(t *testing.T) { require.True(t, ok, "tpm json is broken") assert.Truef(t,tpm.(float64) > 1, "tpm is less than 1 %f", tpm) } -func HttpServerSendTrace(t *require.TestingT) {} -func TestHttpServer(t *testing.T) { +// func HttpServerSendData(t *testing.T,) { +// var wg sync.WaitGroup +// wg.Add(2) +// go func(){ +// defer wg.Done() +// for i := 1; i < 5; i++ { +// HttpServerCheckTPM(t) +// time.Sleep(TPM_CHECK_INTERVAL) +// } +// }() +// wg.Wait() +// } +func TestMockServer(t *testing.T) { serverControlChan := startHttpServer() time.Sleep(3 * time.Second) HttpServerSanityCheck(t, APP_SERVER) - // HttpServerSanityCheck(t, DATA_SERVER) - HttpServerCheckData(t) - time.Sleep(1 * time.Minute) - for i := 1; i < 5; i++ { - HttpServerCheckTPM(t) - time.Sleep(20 * time.Minute) - } + HttpsServerSanityCheck(t, DATA_SERVER) + // HttpServerSendData(t) + // time.Sleep(1 * time.Minute) serverControlChan <- 0 } + + +func TestStartMockServer(t * testing.T){ + startHttpServer() +} diff --git a/test/performance/trace/xray/agent_config.json b/test/performance/trace/xray/agent_config.json new file mode 100644 index 000000000..aedc8d55b --- /dev/null +++ b/test/performance/trace/xray/agent_config.json @@ -0,0 +1,107 @@ +{ + "agent": { + "debug": true + }, + "traces": { + "endpoint_override" : "https://127.0.0.1/put-data", + "traces_collected": { + "xray": { + } + } + }, + "metrics": { + "namespace": "CloudWatchAgentPerformance", + "append_dimensions": { + "InstanceId": "${aws:InstanceId}" + }, + "metrics_collected": { + "cpu": { + "measurement": [ + "time_active", "time_guest", "time_guest_nice", "time_idle", "time_iowait", "time_irq", + "time_nice", "time_softirq", "time_steal", "time_system", "time_user", + "usage_active", "usage_guest", "usage_guest_nice", "usage_idle", "usage_iowait", "usage_irq", + "usage_nice", "usage_softirq", "usage_steal", "usage_system", "usage_user" + ], + "metrics_collection_interval": 1 + }, + "swap": { + "measurement": [ + "free","used","used_percent" + ], + "metrics_collection_interval": 1 + }, + "processes": { + "measurement": [ + "blocked","running","sleeping","stopped","total","dead","idle","paging","total_threads","zombies" + ], + "metrics_collection_interval": 1 + }, + "netstat": { + "measurement": [ + "tcp_close","tcp_close_wait","tcp_closing", "tcp_established","tcp_fin_wait1","tcp_fin_wait2","tcp_last_ack", + "tcp_listen","tcp_none","tcp_syn_sent","tcp_syn_recv","tcp_time_wait","udp_socket" + ], + "metrics_collection_interval": 1 + }, + "mem": { + "measurement": [ + "active", "available", "available_percent", "buffered", "cached", "free", "inactive", "total", + "used", "used_percent" + ], + "metrics_collection_interval": 1 + }, + "diskio": { + "resources": [ + "*" + ], + "measurement": [ + "iops_in_progress", "io_time", "reads", "read_bytes", "read_time", "writes", "write_bytes", "write_time" + ], + "metrics_collection_interval": 1 + }, + "disk": { + "resources": [ + "*" + ], + "measurement": [ + "free","inodes_free","inodes_total","inodes_used","total","used","used_percent" + ], + "drop_device": true, + "metrics_collection_interval": 1 + }, + "ethtool": { + "interface_include": [ + "eth0", + "ens5" + ], + "metrics_include": [ + "queue_0_tx_cnt","queue_0_rx_cnt" + ] + }, + "net": { + "resources": [ + "eth0" + ], + "measurement": [ + "bytes_sent", "bytes_recv", "drop_in", "drop_out", "err_in", "err_out", "packets_sent", "packets_recv" + ], + "metrics_collection_interval": 1 + }, + "procstat": [ + { + "exe": "cloudwatch-agent", + "measurement": [ + "cpu_usage", + "memory_rss", + "memory_swap", + "memory_vms", + "memory_data", + "num_fds", + "write_bytes" + ], + "metrics_collection_interval": 1 + } + ] + } + } + } \ No newline at end of file diff --git a/test/performance/trace/xray/parameters.yml b/test/performance/trace/xray/parameters.yml new file mode 100644 index 000000000..38c9e4b90 --- /dev/null +++ b/test/performance/trace/xray/parameters.yml @@ -0,0 +1,70 @@ +receivers: ["trace-xray"] + +test_case: "trace_xray_performance" +validate_type: "performance" +data_type: "metrics" +# Number of metrics to be sent or number of log lines being written each minute +values_per_minute: "" +# Number of seconds the agent should run and collect the metrics. In this case, 5 minutes +agent_collection_period: 300 + +commit_hash: +commit_date: + +cloudwatch_agent_config: "" + +# Metric that the test needs to validate +metric_namespace: "CloudWatchAgentPerformance" +metric_validation: + - metric_name: "procstat_cpu_usage" + metric_dimension: + - name: "exe" + value: "cloudwatch-agent" + - name: "process_name" + value: "amazon-cloudwatch-agent" + - metric_name: "procstat_memory_rss" + metric_dimension: + - name: "exe" + value: "cloudwatch-agent" + - name: "process_name" + value: "amazon-cloudwatch-agent" + - metric_name: "procstat_memory_swap" + metric_dimension: + - name: "exe" + value: "cloudwatch-agent" + - name: "process_name" + value: "amazon-cloudwatch-agent" + - metric_name: "procstat_memory_vms" + metric_dimension: + - name: "exe" + value: "cloudwatch-agent" + - name: "process_name" + value: "amazon-cloudwatch-agent" + - metric_name: "procstat_memory_data" + metric_dimension: + - name: "exe" + value: "cloudwatch-agent" + - name: "process_name" + value: "amazon-cloudwatch-agent" + - metric_name: "procstat_num_fds" + metric_dimension: + - name: "exe" + value: "cloudwatch-agent" + - name: "process_name" + value: "amazon-cloudwatch-agent" + - metric_name: "procstat_write_bytes" + metric_dimension: + - name: "exe" + value: "cloudwatch-agent" + - name: "process_name" + value: "amazon-cloudwatch-agent" + - metric_name: "net_bytes_sent" + metric_dimension: + - name: "interface" + value: "eth0" + - metric_name: "net_packets_sent" + metric_dimension: + - name: "interface" + value: "eth0" + - metric_name: "mem_total" + metric_dimension: [] \ No newline at end of file diff --git a/validator/models/validation_config.go b/validator/models/validation_config.go index ed9a96fb6..3087d4f86 100644 --- a/validator/models/validation_config.go +++ b/validator/models/validation_config.go @@ -15,7 +15,7 @@ import ( "gopkg.in/yaml.v3" ) -var supportedReceivers = []string{"logs", "statsd", "collectd", "system", "emf"} +var supportedReceivers = []string{"logs", "statsd", "collectd", "system", "emf","trace-xray"} type ValidateConfig interface { GetPluginsConfig() []string From c61d69ac2e0d089bdd04a625ac55aeca60d2b78c Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Fri, 11 Aug 2023 12:06:33 -0400 Subject: [PATCH 08/14] generating traces --- go.mod | 2 +- terraform/performance/main.tf | 2 + test/otlp/generator.go | 2 +- test/otlp/trace_test.go | 2 +- test/performance/trace/xray/parameters.yml | 6 +-- test/xray/generator.go | 21 +++++++++- test/xray/trace_test.go | 2 +- util/common/traces.go | 12 +++++- validator/models/validation_config.go | 2 +- validator/resources/sampling-rule.json | 17 +++++++++ validator/resources/xray-config.json | 11 ++++++ validator/validators/basic/basic_validator.go | 2 + .../basic/resources/sampling-rule.json | 17 +++++++++ validator/validators/util/common.go | 38 +++++++++++++++++++ 14 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 validator/resources/sampling-rule.json create mode 100644 validator/resources/xray-config.json create mode 100644 validator/validators/basic/resources/sampling-rule.json diff --git a/go.mod b/go.mod index 82d71bc14..5c50a915e 100644 --- a/go.mod +++ b/go.mod @@ -26,6 +26,7 @@ require ( github.com/aws/aws-xray-sdk-go v1.8.1 github.com/cenkalti/backoff/v4 v4.2.1 github.com/google/uuid v1.3.0 + github.com/gorilla/mux v1.8.0 github.com/mitchellh/mapstructure v1.5.0 github.com/prozz/aws-embedded-metrics-golang v1.2.0 github.com/qri-io/jsonschema v0.2.1 @@ -67,7 +68,6 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect - github.com/gorilla/mux v1.8.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/klauspost/compress v1.15.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect diff --git a/terraform/performance/main.tf b/terraform/performance/main.tf index 2a6182c3a..2374c4c8d 100644 --- a/terraform/performance/main.tf +++ b/terraform/performance/main.tf @@ -91,6 +91,8 @@ resource "null_resource" "install_binaries" { "aws s3 cp s3://${var.s3_bucket}/integration-test/packaging/${var.cwa_github_sha}/amazon-cloudwatch-agent.msi .", "aws s3 cp s3://${var.s3_bucket}/integration-test/binary/${var.cwa_github_sha}/${var.family}/${var.arc}/${local.install_package} .", "aws s3 cp s3://${var.s3_bucket}/integration-test/validator/${var.cwa_github_sha}/${var.family}/${var.arc}/${local.install_validator} .", + "git clone https://github.com/okankoAMZ/amazon-cloudwatch-agent-test.git", + "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", local.ami_family["install_command"], ] } diff --git a/test/otlp/generator.go b/test/otlp/generator.go index d530f2910..7064d0fd5 100644 --- a/test/otlp/generator.go +++ b/test/otlp/generator.go @@ -51,7 +51,7 @@ func (g *OtlpTracesGenerator) StartSendingTraces(ctx context.Context) error { func (g *OtlpTracesGenerator) StopSendingTraces() { close(g.Done) } -func newLoadGenerator(cfg *common.TraceGeneratorConfig) *OtlpTracesGenerator { +func NewLoadGenerator(cfg *common.TraceGeneratorConfig) *OtlpTracesGenerator { return &OtlpTracesGenerator{ TraceGenerator: common.TraceGenerator{ Cfg: cfg, diff --git a/test/otlp/trace_test.go b/test/otlp/trace_test.go index cae894eae..158bd11ce 100644 --- a/test/otlp/trace_test.go +++ b/test/otlp/trace_test.go @@ -56,7 +56,7 @@ func TestTraces(t *testing.T) { t.Run(name, func(t *testing.T) { OtlpTestCfg := common.TraceTestConfig{ - Generator: newLoadGenerator(testCase.generatorConfig), + Generator: NewLoadGenerator(testCase.generatorConfig), Name: name, AgentConfigPath: testCase.agentConfigPath, AgentRuntime: agentRuntime, diff --git a/test/performance/trace/xray/parameters.yml b/test/performance/trace/xray/parameters.yml index 38c9e4b90..f9d115133 100644 --- a/test/performance/trace/xray/parameters.yml +++ b/test/performance/trace/xray/parameters.yml @@ -1,9 +1,9 @@ -receivers: ["trace-xray"] +receivers: ["xray"] test_case: "trace_xray_performance" validate_type: "performance" -data_type: "metrics" -# Number of metrics to be sent or number of log lines being written each minute +data_type: "traces" +# Number of metrics or traces to be sent or number of log lines being written each minute values_per_minute: "" # Number of seconds the agent should run and collect the metrics. In this case, 5 minutes agent_collection_period: 300 diff --git a/test/xray/generator.go b/test/xray/generator.go index 450af0b1e..19a9b8aed 100644 --- a/test/xray/generator.go +++ b/test/xray/generator.go @@ -3,10 +3,13 @@ package xray import ( "context" "errors" + "fmt" "log" "os" "path" + "path/filepath" "time" + "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/aws/aws-xray-sdk-go/strategy/sampling" "github.com/aws/aws-xray-sdk-go/xray" @@ -14,6 +17,7 @@ import ( ) var generatorError = errors.New("Generator error") + type XrayTracesGenerator struct { common.TraceGenerator common.TraceGeneratorInterface @@ -36,7 +40,21 @@ func (g *XrayTracesGenerator) StartSendingTraces(ctx context.Context) error { func (g *XrayTracesGenerator) StopSendingTraces() { close(g.Done) } -func newLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { +func listDir() { + err := filepath.Walk(".", + func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + fmt.Println(path, info.Size()) + return nil + }) + if err != nil { + log.Println(err) + } +} +func NewLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { + listDir() s, err := sampling.NewLocalizedStrategyFromFilePath( path.Join("resources", "sampling-rule.json")) if err != nil { @@ -55,6 +73,7 @@ func newLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { } func (g *XrayTracesGenerator) Generate(ctx context.Context) error { rootCtx, root := xray.BeginSegment(ctx, "load-generator") + log.Println("Generated Trace") g.SegmentsGenerationCount++ defer func() { root.Close(nil) diff --git a/test/xray/trace_test.go b/test/xray/trace_test.go index 73f803b02..b9ec305c8 100644 --- a/test/xray/trace_test.go +++ b/test/xray/trace_test.go @@ -54,7 +54,7 @@ func TestTraces(t *testing.T) { t.Run(name, func(t *testing.T) { XrayTestCfg := common.TraceTestConfig{ - Generator: newLoadGenerator(testCase.generatorConfig), + Generator: NewLoadGenerator(testCase.generatorConfig), Name: name, AgentConfigPath: testCase.agentConfigPath, AgentRuntime: agentRuntime, diff --git a/util/common/traces.go b/util/common/traces.go index b22dd1983..4020276bd 100644 --- a/util/common/traces.go +++ b/util/common/traces.go @@ -17,7 +17,6 @@ import ( const ( AGENT_SHUTDOWN_DELAY = 20 * time.Second // this const is the delay between stopping trace generation and stopping agent ) - type TraceTestConfig struct { Generator TraceGeneratorInterface Name string @@ -50,7 +49,6 @@ type TraceGeneratorInterface interface { GetAgentRuntime() time.Duration GetName() string } - func TraceTest(t *testing.T, traceTest TraceTestConfig) error { t.Helper() startTime := time.Now() @@ -112,3 +110,13 @@ func SegmentValidationTest(t *testing.T, traceTest TraceTestConfig, segments []t return nil } +func GenerateTraces(traceTest TraceTestConfig) error{ + CopyFile(traceTest.AgentConfigPath, ConfigOutputPath) + go func() { + traceTest.Generator.StartSendingTraces(context.Background()) + }() + time.Sleep(traceTest.AgentRuntime) + traceTest.Generator.StopSendingTraces() + time.Sleep(AGENT_SHUTDOWN_DELAY) + return nil +} diff --git a/validator/models/validation_config.go b/validator/models/validation_config.go index 3087d4f86..d4446eded 100644 --- a/validator/models/validation_config.go +++ b/validator/models/validation_config.go @@ -15,7 +15,7 @@ import ( "gopkg.in/yaml.v3" ) -var supportedReceivers = []string{"logs", "statsd", "collectd", "system", "emf","trace-xray"} +var supportedReceivers = []string{"logs", "statsd", "collectd", "system", "emf","xray"} type ValidateConfig interface { GetPluginsConfig() []string diff --git a/validator/resources/sampling-rule.json b/validator/resources/sampling-rule.json new file mode 100644 index 000000000..72d46496e --- /dev/null +++ b/validator/resources/sampling-rule.json @@ -0,0 +1,17 @@ +{ + "version": 2, + "rules": [ + { + "description": "debug", + "host": "*", + "http_method": "*", + "url_path": "*", + "fixed_target": 0, + "rate": 1.0 + } + ], + "default": { + "fixed_target": 1, + "rate": 1.0 + } + } \ No newline at end of file diff --git a/validator/resources/xray-config.json b/validator/resources/xray-config.json new file mode 100644 index 000000000..75be23507 --- /dev/null +++ b/validator/resources/xray-config.json @@ -0,0 +1,11 @@ +{ + "agent":{ + "debug":true + }, + "traces": { + "traces_collected": { + "xray": { + } + } + } +} \ No newline at end of file diff --git a/validator/validators/basic/basic_validator.go b/validator/validators/basic/basic_validator.go index a99096504..60ed6faed 100644 --- a/validator/validators/basic/basic_validator.go +++ b/validator/validators/basic/basic_validator.go @@ -49,6 +49,8 @@ func (s *BasicValidator) GenerateLoad() error { switch dataType { case "logs": return common.StartLogWrite(agentConfigFilePath, agentCollectionPeriod, metricSendingInterval, dataRate) + case "traces": + return util.StartTraceGeneration(receiver,agentConfigFilePath,agentCollectionPeriod,metricSendingInterval) default: // Sending metrics based on the receivers; however, for scraping plugin (e.g prometheus), we would need to scrape it instead of sending return common.StartSendingMetrics(receiver, agentCollectionPeriod, metricSendingInterval, dataRate, logGroup, metricNamespace) diff --git a/validator/validators/basic/resources/sampling-rule.json b/validator/validators/basic/resources/sampling-rule.json new file mode 100644 index 000000000..72d46496e --- /dev/null +++ b/validator/validators/basic/resources/sampling-rule.json @@ -0,0 +1,17 @@ +{ + "version": 2, + "rules": [ + { + "description": "debug", + "host": "*", + "http_method": "*", + "url_path": "*", + "fixed_target": 0, + "rate": 1.0 + } + ], + "default": { + "fixed_target": 1, + "rate": 1.0 + } + } \ No newline at end of file diff --git a/validator/validators/util/common.go b/validator/validators/util/common.go index cfac9b029..7fc272031 100644 --- a/validator/validators/util/common.go +++ b/validator/validators/util/common.go @@ -5,7 +5,10 @@ package util import ( "fmt" + "time" + "github.com/aws/amazon-cloudwatch-agent-test/test/xray" + "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" ) @@ -18,3 +21,38 @@ func LogCloudWatchDimension(dims []types.Dimension) string { } return dimension } + +func StartTraceGeneration(receiver string, agentConfigPath string,agentRuntime time.Duration ,traceSendingInterval time.Duration) error{ + cfg := common.TraceTestConfig{ + Generator: nil, + Name: "", + AgentConfigPath: agentConfigPath, + AgentRuntime: agentRuntime, + } + xrayGenCfg := common.TraceGeneratorConfig{ + Interval: traceSendingInterval, + Annotations:map[string]interface{}{ + "test_type": "simple_otlp", + }, + Metadata: map[string]map[string]interface{}{ + "default": { + "nested": map[string]interface{}{ + "key": "value", + }, + }, + "custom_namespace": { + "custom_key": "custom_value", + }, + }, + } + switch receiver{ + case "xray": + cfg.Generator = xray.NewLoadGenerator(&xrayGenCfg) + cfg.Name = "xray-performance-test" + case "otlp": + default: + panic("Invalid trace receiver") + } + err := common.GenerateTraces(cfg) + return err +} From 42e34c608364fff5b5abf08c5d6b44a4f8cb8e80 Mon Sep 17 00:00:00 2001 From: okankoAMZ <107267850+okankoAMZ@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:23:22 -0400 Subject: [PATCH 09/14] PR Cleanup (#6) --- mock_server/certificates/private.key | 52 ---------- mock_server/certificates/ssl/ca-bundle.crt | 36 ------- mock_server/certificates/ssl/certificate.crt | 36 ------- {mock_server => mockserver}/Makefile | 9 +- {mock_server => mockserver}/README | 5 - mockserver/certificates/private.key | 52 ++++++++++ mockserver/certificates/ssl/ca-bundle.crt | 36 +++++++ mockserver/certificates/ssl/certificate.crt | 36 +++++++ {mock_server => mockserver}/http_server.go | 20 ++-- .../http_server_test.go | 19 +--- {mock_server => mockserver}/openssl.conf | 3 +- terraform/performance/main.tf | 16 +++- test/performance/trace/xray/agent_config.json | 96 +------------------ test/xray/generator.go | 2 +- util/common/traces.go | 18 ++-- validator/resources/sampling-rule.json | 17 ---- validator/resources/xray-config.json | 11 --- .../basic/resources/sampling-rule.json | 17 ---- validator/validators/util/common.go | 22 ++--- validator/validators/validator.go | 8 +- 20 files changed, 186 insertions(+), 325 deletions(-) delete mode 100644 mock_server/certificates/private.key delete mode 100644 mock_server/certificates/ssl/ca-bundle.crt delete mode 100644 mock_server/certificates/ssl/certificate.crt rename {mock_server => mockserver}/Makefile (80%) rename {mock_server => mockserver}/README (56%) create mode 100644 mockserver/certificates/private.key create mode 100644 mockserver/certificates/ssl/ca-bundle.crt create mode 100644 mockserver/certificates/ssl/certificate.crt rename {mock_server => mockserver}/http_server.go (92%) rename {mock_server => mockserver}/http_server_test.go (87%) rename {mock_server => mockserver}/openssl.conf (93%) delete mode 100644 validator/resources/sampling-rule.json delete mode 100644 validator/resources/xray-config.json delete mode 100644 validator/validators/basic/resources/sampling-rule.json diff --git a/mock_server/certificates/private.key b/mock_server/certificates/private.key deleted file mode 100644 index f1b25e528..000000000 --- a/mock_server/certificates/private.key +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PRIVATE K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IVATE KEY----- diff --git a/mock_server/certificates/ssl/ca-bundle.crt b/mock_server/certificates/ssl/ca-bundle.crt deleted file mode 100644 index 7af408469..000000000 --- a/mock_server/certificates/ssl/ca-bundle.crt +++ /dev/null @@ -1,36 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGOTCCBCGgAwIBAgIUcz7fCLPSodq6qjL3Czp30dMvib4wDQYJKoZIhvcNAQEL -BQAwgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH -DAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsMDUlU -IERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5jb20x -FDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDgwOTE5MjUzNloXDTI0MDgwODE5 -MjUzNlowgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYD -VQQHDAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsM -DUlUIERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5j -b20xFDASBgNVBAMMC2V4YW1wbGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAlFQAdVQXM7UbLg9Cq/jlcBIjeR34py1MIfkql9X4z7koFOSEn82A -MuGkNtB966Xnu8tA4zcgwSp0x8sR3Df0TaEbDNA/ekLkWMffj+cAlFDXISuz5Lv5 -RbCYjtE7bgsQOSaq5UEce1h57ngogvr53mi/zY+uRITwv44jLjIf1U0Rp12vwn/V -1lPAI2Brri8up/Gq4vbNQWzUTBcVgyR1q63whImH9GyV9W8pAATGltcxN0JdaKYc -XS9qsuHF7REMBt17MMFe39LVIbp76U8ph+vadAonM9d+78Z7dN6JMKG9Yc9g2zDl -/WBwtrcj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DVZJ3up+oqzjhJr+Xf+ -MSF6scI421mTP7mf3MEQDwISoTAtFOHvuHEHZnJws7pJfmPiiG0WdxclJ25RFya7 -s+nwKPP+rz7AUrqkxc16nZlJLlfNqWRoFsrkNbg5AaLMAKzsdrWRBPkXig1siseD -teHsab59Of+lkNRo2g== ------END CERTIFICATE----- diff --git a/mock_server/certificates/ssl/certificate.crt b/mock_server/certificates/ssl/certificate.crt deleted file mode 100644 index 7af408469..000000000 --- a/mock_server/certificates/ssl/certificate.crt +++ /dev/null @@ -1,36 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGOTCCBCGgAwIBAgIUcz7fCLPSodq6qjL3Czp30dMvib4wDQYJKoZIhvcNAQEL -BQAwgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH -DAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsMDUlU -IERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5jb20x -FDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDgwOTE5MjUzNloXDTI0MDgwODE5 -MjUzNlowgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYD -VQQHDAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsM -DUlUIERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5j -b20xFDASBgNVBAMMC2V4YW1wbGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAlFQAdVQXM7UbLg9Cq/jlcBIjeR34py1MIfkql9X4z7koFOSEn82A -MuGkNtB966Xnu8tA4zcgwSp0x8sR3Df0TaEbDNA/ekLkWMffj+cAlFDXISuz5Lv5 -RbCYjtE7bgsQOSaq5UEce1h57ngogvr53mi/z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ejWpfb3w/TWncdntqYndYRUR2Mr/1HNPSAiP6vaqFH6e/fzbE -G+b0+A8S5VEFzARO4RWwiXAxjhyWfPgC+TYPar5pmD7XGL6J1XepAvZGUsW0mqZD -9MdV62syt1kX2Ogok6Wz4dCkvzzy9N+oY+LvNhQfSr6ahDVZJ3up+oqzjhJr+Xf+ -MSF6scI421mTP7mf3MEQDwISoTAtFOHvuHEHZnJws7pJfmPiiG0WdxclJ25RFya7 -s+nwKPP+rz7AUrqkxc16nZlJLlfNqWRoFsrkNbg5AaLMAKzsdrWRBPkXig1siseD -teHsab59Of+lkNRo2g== ------END CERTIFICATE----- diff --git a/mock_server/Makefile b/mockserver/Makefile similarity index 80% rename from mock_server/Makefile rename to mockserver/Makefile index 540460b77..d54dbbd3a 100644 --- a/mock_server/Makefile +++ b/mockserver/Makefile @@ -1,13 +1,16 @@ # Header above mocked_servers cert in bundle -CERT_HEADER=mocked_servers +CERT_HEADER=mockserver CONFIG_PATH=openssl.conf CERT_PATH=certificates/ssl/certificate.crt KEY_PATH=certificates/private.key BUNDLE_PATH=certificates/ssl/ca-bundle.crt - +.PHONY: clean +clean: + rm -rf $(CERT_PATH) $(BUNDLE_PATH) $(KEY_PATH) + touch $(CERT_PATH) $(BUNDLE_PATH) $(KEY_PATH) .PHONY: update-certs -update-certs: gen-cert update-bundle +update-certs: clean gen-cert update-bundle # Expects mocked_servers cert to be the last cert in the bundle # Cuts until the first instance of "mocked_servers" in the bundle diff --git a/mock_server/README b/mockserver/README similarity index 56% rename from mock_server/README rename to mockserver/README index 74b5c8444..10cdf5346 100644 --- a/mock_server/README +++ b/mockserver/README @@ -1,8 +1,3 @@ # Mocked Servers -Most of the tests use mocked servers as stand-ins for the exporters to send to. -The docker images are built and pushed to ECR as part of `terraform/imagebuild` and then used in the tests as part of `defaults/docker_compose.tpl`. - -Most will use the `https` mocked_server, but some test cases like `otlp_grpc_exporter_metric_mock` and `otlp_grpc_exporter_trace_mock` will need to use the `grpc_metrics` and `grpc_trace` mocked_servers. - The servers themselves are very basic. They listen for a message and tend to set a flag to success upon receiving it. Typically, they are set up with two servers: one to mock the backend and one to report on the status of that mock (if endpoint is called, how many times, etc.). There's a built-in 15ms of latency between each message that's received. The status reporter will always be on port 8080 and support the `:8080/` (returns "healthcheck") and the `:8080/check-data` (returns "success" if mock has received messages) endpoints. \ No newline at end of file diff --git a/mockserver/certificates/private.key b/mockserver/certificates/private.key new file mode 100644 index 000000000..ffd7280da --- /dev/null +++ b/mockserver/certificates/private.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQCs0ou1PZSRfHmL +UmkWI3upcnUSWjQcoUXNSeSxPn5sQtEeObd91D8xBVAOFTdTFgKv5rKT7NcDpflW +//b/ovOqui1uxKDAim1LHs4auhMvRXhi2iLFOCrlAFuDXOFeNe2xvd/zDJr4pQNY +jieLbSGhXQKhNP6E4iguCuSZLhV8aqj56lk5fi9OiiAIz2JqLpv5F3H1YGFde5/l +v5wyuFvozYTehIF8KDpcuvl3NWb376QOghV9Plmb4QoLYN24TvnlOFrgprJy2zRK +n1bZ1jOrIsiB700wHHcFWlkyb0k+o1BoDWFaN1lBDn171oSp5FNXB/86wsJKWX/b +i5v9HHzT12KMpPs3HFvdbPSdmUiRhVwX9XNpbv0sm6Jo3ZX2FrtWj7pWPA97VHrs +nCtErtdb3qnAKFyHGte4gCBDC6RzY/Sx51++LE+nyIukawY3YIyXn8n+e5AKUM6w +7K9sTxLj27kkBw71R1DKwHoEhoFOyE2KbQi6T/2YxOQclvfC9qC8M1sQMw4OdXak +JNn6Elju2PMjYj8fLPOwphNn+7z6p8fjWKvvrGkfgIfEpSK8Y7Em/MtqT+RH17kT +8AZrJnmlLRgyEQIaUZ6PEbnakJZS1zGPBP7unzsY6BZ9jzUXdMgtEEJSgm+c3vPh +CUt/70VW5pBZO++PzSBQkkaTlCZY5wIDAQABAoICAAXItE50ZGQQ5B1p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tVI3wQEX+qlFk1pZUeclRAWJc5TjCx8NxQPBGyyd9GzW9wqEl7iqCQ9ccN +V3FHAjdCjXVbkKeO1qW6u6BnZbAJYeCmEXciy4oV2Vuhog4UCfLmIWIvZZknqPpZ +88/dRSWkoh7r9VUM539msvQaoVZoQ8YKrAwnr/GPc2+lwKvX2nYlLFBgNY+yHoJz +liaBRkmTNbr9D7l2dbBc+HBX+WAG7wDEbcHT/25VTDe9qVwaOJYaA/8YwHlKkgk6 +MS4NuDAuF8b/rhwtUJW4UY19lq3fstdV +-----END PRIVATE KEY----- diff --git a/mockserver/certificates/ssl/ca-bundle.crt b/mockserver/certificates/ssl/ca-bundle.crt new file mode 100644 index 000000000..f476b3333 --- /dev/null +++ b/mockserver/certificates/ssl/ca-bundle.crt @@ -0,0 +1,36 @@ +-----BEGIN CERTIFICATE----- +MIIGOTCCBCGgAwIBAgIUTbGrEtezpQ4lTSJq4Vq4/Wf7wokwDQYJKoZIhvcNAQEL +BQAwgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH +DAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsMDUlU +IERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5jb20x +FDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDgxNjIzMDY0M1oXDTI0MDgxNTIz +MDY0M1owgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYD +VQQHDAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsM +DUlUIERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5j +b20xFDASBgNVBAMMC2V4YW1wbGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEArNKLtT2UkX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4M52xmcL99SsaK0u +q1jErAGekfc6l37KHUypimaA065KgnJz7Crg1t6JUNHjpROXjdkrf1+TZZ/z6C+p +KPm2zvITUvr05dLlS05J2ghOd3B/+DDg0b+GgOuqq3bxcTgNwVPogpKO/mJGIxY/ +HDPkLcPulnaHm+NB/IIK2owfnXRC8Qujq2bthyHdP4cGGn4Q82cA8FRO04L3oGrC +6BcroCZqWkllaVNJtoFig0UqXQv6aNqT0kgO3B12Km7wd50ye2+awyVP62J0Bi9W +qBNMWT5LVAgt6sY4xBwxjKd3fizoQEcxRrD2Hk+mw4DCU/6ni5PSf8l0x31Mk5rk +UnuHFMnxTBBfUonIhRKg59b5qVdgs6Il8N+aRV2ZP3WUoOEZCFiNzqbJrcjMMlur +8Zj/fYYyywA7Ck4Srv8NPVskc4wic1aXBlDvbz4UjC+T1ElIfgM36HfV+d/weMs/ +rKvn+B6q4wmPGcC4Rw== +-----END CERTIFICATE----- diff --git a/mockserver/certificates/ssl/certificate.crt b/mockserver/certificates/ssl/certificate.crt new file mode 100644 index 000000000..f476b3333 --- /dev/null +++ b/mockserver/certificates/ssl/certificate.crt @@ -0,0 +1,36 @@ +-----BEGIN CERTIFICATE----- +MIIGOTCCBCGgAwIBAgIUTbGrEtezpQ4lTSJq4Vq4/Wf7wokwDQYJKoZIhvcNAQEL +BQAwgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH +DAdTZWF0dGxlMRgwFgYDVQQKDA9FeGFtcGxlIENvbXBhbnkxFjAUBgNVBAsMDUlU +IERlcGFydG1lbnQxIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVAZXhhbXBsZS5jb20x +FDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDgxNjIzMDY0M1oXDTI0MDgxNTIz +MDY0M1owgaAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYD +VQQHDAdTZWF0dGxlMRgwFgYDVQQKDA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LD6h2uJ +7l/CsVn9Vw8c6SMIwL83IjUHyFxSmQauplYOKH6wN5++EUYazPYXfQRrbNXa9dMw +U8W7B8neo2/EVF3GC+9lGEhhiGgBIizwID9CG1k6vl40TPmD7o4qNP8QjQeAQbDo +bRta2oCb+40IOVHJQrr3H3KzP+6sRd4H3WbyWAf/Wtb76GSC4M52xmcL99SsaK0u +q1jErAGekfc6l37KHUypimaA065KgnJz7Crg1t6JUNHjpROXjdkrf1+TZZ/z6C+p +KPm2zvITUvr05dLlS05J2ghOd3B/+DDg0b+GgOuqq3bxcTgNwVPogpKO/mJGIxY/ +HDPkLcPulnaHm+NB/IIK2owfnXRC8Qujq2bthyHdP4cGGn4Q82cA8FRO04L3oGrC +6BcroCZqWkllaVNJtoFig0UqXQv6aNqT0kgO3B12Km7wd50ye2+awyVP62J0Bi9W +qBNMWT5LVAgt6sY4xBwxjKd3fizoQEcxRrD2Hk+mw4DCU/6ni5PSf8l0x31Mk5rk +UnuHFMnxTBBfUonIhRKg59b5qVdgs6Il8N+aRV2ZP3WUoOEZCFiNzqbJrcjMMlur +8Zj/fYYyywA7Ck4Srv8NPVskc4wic1aXBlDvbz4UjC+T1ElIfgM36HfV+d/weMs/ +rKvn+B6q4wmPGcC4Rw== +-----END CERTIFICATE----- diff --git a/mock_server/http_server.go b/mockserver/http_server.go similarity index 92% rename from mock_server/http_server.go rename to mockserver/http_server.go index e841d2dc0..18321b4dc 100644 --- a/mock_server/http_server.go +++ b/mockserver/http_server.go @@ -23,6 +23,7 @@ import ( "net/http" "sync/atomic" "time" + "path" "github.com/gorilla/mux" ) @@ -30,11 +31,12 @@ import ( const ( HealthCheckMessage = "healthcheck" SuccessMessage = "success" - CertFilePath = "./certificates/ssl/certificate.crt" - KeyFilePath = "./certificates/private.key" - DaemonPort = ":1053" -) +) +var ( + CertFilePath = path.Join("certificates","ssl", "certificate.crt") + KeyFilePath = path.Join("certificates","private.key") +) type transactionStore struct { transactions uint32 startTime time.Time @@ -52,11 +54,11 @@ func healthCheck(w http.ResponseWriter, _ *http.Request) { func (ts *transactionStore) checkData(w http.ResponseWriter, _ *http.Request) { var message string - var t =atomic.LoadUint32(&ts.transactions) - if t > 0 { + var t = atomic.LoadUint32(&ts.transactions) + if t > 0 { message = SuccessMessage } - fmt.Printf("\033[31m Time: %d | checkData msg: %s | %d\033[0m \n", time.Now().Unix(), message,t) + fmt.Printf("\033[31m Time: %d | checkData msg: %s | %d\033[0m \n", time.Now().Unix(), message, t) if _, err := io.WriteString(w, message); err != nil { io.WriteString(w, err.Error()) log.Printf("Unable to write response: %v", err) @@ -88,7 +90,7 @@ func (ts *transactionStore) tpm(w http.ResponseWriter, _ *http.Request) { // Starts an HTTPS server that receives requests for the data handler service at the sample server port // Starts an HTTP server that receives request from validator only to verify the data ingestion -func startHttpServer() chan interface{} { +func StartHttpServer() chan interface{} { serverControlChan := make(chan interface{}) log.Println("\033[31m Starting Server \033[0m") store := transactionStore{startTime: time.Now()} @@ -102,7 +104,7 @@ func startHttpServer() chan interface{} { dataApp.PathPrefix("/put-data").HandlerFunc(ts.dataReceived) dataApp.HandleFunc("/trace/v1", ts.dataReceived) dataApp.HandleFunc("/metric/v1", ts.dataReceived) - if err := daemonServer.ListenAndServeTLS(CertFilePath, KeyFilePath ); err != nil { + if err := daemonServer.ListenAndServeTLS(CertFilePath, KeyFilePath); err != nil { log.Fatalf("HTTPS server error: %v", err) err = daemonServer.Shutdown(context.TODO()) log.Fatalf("Shutdown server error: %v", err) diff --git a/mock_server/http_server_test.go b/mockserver/http_server_test.go similarity index 87% rename from mock_server/http_server_test.go rename to mockserver/http_server_test.go index b90420765..5200d6142 100644 --- a/mock_server/http_server_test.go +++ b/mockserver/http_server_test.go @@ -83,29 +83,16 @@ func HttpServerCheckTPM(t *testing.T) { assert.Truef(t, tpm.(float64) > 1, "tpm is less than 1 %f", tpm) } -// func HttpServerSendData(t *testing.T,) { -// var wg sync.WaitGroup -// wg.Add(2) -// go func(){ -// defer wg.Done() -// for i := 1; i < 5; i++ { -// HttpServerCheckTPM(t) -// time.Sleep(TPM_CHECK_INTERVAL) -// } -// }() -// wg.Wait() -// } func TestMockServer(t *testing.T) { - serverControlChan := startHttpServer() + serverControlChan := StartHttpServer() time.Sleep(3 * time.Second) HttpServerSanityCheck(t, APP_SERVER) HttpsServerSanityCheck(t, DATA_SERVER) - // HttpServerSendData(t) - // time.Sleep(1 * time.Minute) + time.Sleep(1 * time.Minute) serverControlChan <- 0 } func TestStartMockServer(t *testing.T) { - startHttpServer() + StartHttpServer() } diff --git a/mock_server/openssl.conf b/mockserver/openssl.conf similarity index 93% rename from mock_server/openssl.conf rename to mockserver/openssl.conf index 07acf7589..b764c53fc 100644 --- a/mock_server/openssl.conf +++ b/mockserver/openssl.conf @@ -25,4 +25,5 @@ subjectAltName = @alternate_names [alternate_names] DNS.1 = localhost DNS.2 = 127.0.0.1 -DNS.3 = mocked-server \ No newline at end of file +DNS.3 = mockserver +IP.1 = 127.0.0.1 \ No newline at end of file diff --git a/terraform/performance/main.tf b/terraform/performance/main.tf index 2374c4c8d..0eab9508d 100644 --- a/terraform/performance/main.tf +++ b/terraform/performance/main.tf @@ -91,8 +91,6 @@ resource "null_resource" "install_binaries" { "aws s3 cp s3://${var.s3_bucket}/integration-test/packaging/${var.cwa_github_sha}/amazon-cloudwatch-agent.msi .", "aws s3 cp s3://${var.s3_bucket}/integration-test/binary/${var.cwa_github_sha}/${var.family}/${var.arc}/${local.install_package} .", "aws s3 cp s3://${var.s3_bucket}/integration-test/validator/${var.cwa_github_sha}/${var.family}/${var.arc}/${local.install_validator} .", - "git clone https://github.com/okankoAMZ/amazon-cloudwatch-agent-test.git", - "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", local.ami_family["install_command"], ] } @@ -113,9 +111,19 @@ resource "null_resource" "validator_linux" { inline = [ "export AWS_REGION=${var.region}", "sudo chmod +x ./${local.install_validator}", - "./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", + #mock server dependencies getting transfered. + "git clone https://github.com/okankoAMZ/amazon-cloudwatch-agent-test.git", + "cd amazon-cloudwatch-agent-test && git checkout xray-performance-test", + "cd ..", + "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", + "cp -a amazon-cloudwatch-agent-test/mockserver/. /home/ec2-user/", + "sudo make update-certs", + "sudo cp certificates/ssl/certificate.crt /usr/local/share/ca-certificates/terraform.crt", + "sudo update-ca-certificates", + "sudo ./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", + "sudo setcap 'cap_net_bind_service=+ep' validator", local.start_command, - "./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=false", + "sudo ./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=false", ] } } diff --git a/test/performance/trace/xray/agent_config.json b/test/performance/trace/xray/agent_config.json index aedc8d55b..90283d83e 100644 --- a/test/performance/trace/xray/agent_config.json +++ b/test/performance/trace/xray/agent_config.json @@ -9,99 +9,5 @@ } } }, - "metrics": { - "namespace": "CloudWatchAgentPerformance", - "append_dimensions": { - "InstanceId": "${aws:InstanceId}" - }, - "metrics_collected": { - "cpu": { - "measurement": [ - "time_active", "time_guest", "time_guest_nice", "time_idle", "time_iowait", "time_irq", - "time_nice", "time_softirq", "time_steal", "time_system", "time_user", - "usage_active", "usage_guest", "usage_guest_nice", "usage_idle", "usage_iowait", "usage_irq", - "usage_nice", "usage_softirq", "usage_steal", "usage_system", "usage_user" - ], - "metrics_collection_interval": 1 - }, - "swap": { - "measurement": [ - "free","used","used_percent" - ], - "metrics_collection_interval": 1 - }, - "processes": { - "measurement": [ - "blocked","running","sleeping","stopped","total","dead","idle","paging","total_threads","zombies" - ], - "metrics_collection_interval": 1 - }, - "netstat": { - "measurement": [ - "tcp_close","tcp_close_wait","tcp_closing", "tcp_established","tcp_fin_wait1","tcp_fin_wait2","tcp_last_ack", - "tcp_listen","tcp_none","tcp_syn_sent","tcp_syn_recv","tcp_time_wait","udp_socket" - ], - "metrics_collection_interval": 1 - }, - "mem": { - "measurement": [ - "active", "available", "available_percent", "buffered", "cached", "free", "inactive", "total", - "used", "used_percent" - ], - "metrics_collection_interval": 1 - }, - "diskio": { - "resources": [ - "*" - ], - "measurement": [ - "iops_in_progress", "io_time", "reads", "read_bytes", "read_time", "writes", "write_bytes", "write_time" - ], - "metrics_collection_interval": 1 - }, - "disk": { - "resources": [ - "*" - ], - "measurement": [ - "free","inodes_free","inodes_total","inodes_used","total","used","used_percent" - ], - "drop_device": true, - "metrics_collection_interval": 1 - }, - "ethtool": { - "interface_include": [ - "eth0", - "ens5" - ], - "metrics_include": [ - "queue_0_tx_cnt","queue_0_rx_cnt" - ] - }, - "net": { - "resources": [ - "eth0" - ], - "measurement": [ - "bytes_sent", "bytes_recv", "drop_in", "drop_out", "err_in", "err_out", "packets_sent", "packets_recv" - ], - "metrics_collection_interval": 1 - }, - "procstat": [ - { - "exe": "cloudwatch-agent", - "measurement": [ - "cpu_usage", - "memory_rss", - "memory_swap", - "memory_vms", - "memory_data", - "num_fds", - "write_bytes" - ], - "metrics_collection_interval": 1 - } - ] - } - } + "insecure": true } \ No newline at end of file diff --git a/test/xray/generator.go b/test/xray/generator.go index 905be3446..49262e92e 100644 --- a/test/xray/generator.go +++ b/test/xray/generator.go @@ -56,7 +56,7 @@ func NewLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { } func (g *XrayTracesGenerator) Generate(ctx context.Context) error { rootCtx, root := xray.BeginSegment(ctx, "load-generator") - log.Println("Generated Trace") + log.Println("\033[34mGenerated Trace\033[0m") g.SegmentsGenerationCount++ defer func() { root.Close(nil) diff --git a/util/common/traces.go b/util/common/traces.go index e194d1b4c..4cc3e48ea 100644 --- a/util/common/traces.go +++ b/util/common/traces.go @@ -112,13 +112,13 @@ func SegmentValidationTest(t *testing.T, traceTest TraceTestConfig, segments []t return nil } -func GenerateTraces(traceTest TraceTestConfig) error{ - CopyFile(traceTest.AgentConfigPath, ConfigOutputPath) - go func() { - traceTest.Generator.StartSendingTraces(context.Background()) - }() - time.Sleep(traceTest.AgentRuntime) - traceTest.Generator.StopSendingTraces() - time.Sleep(AGENT_SHUTDOWN_DELAY) - return nil +func GenerateTraces(traceTest TraceTestConfig) error { + CopyFile(traceTest.AgentConfigPath, ConfigOutputPath) + go func() { + traceTest.Generator.StartSendingTraces(context.Background()) + }() + time.Sleep(traceTest.AgentRuntime) + traceTest.Generator.StopSendingTraces() + time.Sleep(AGENT_SHUTDOWN_DELAY) + return nil } diff --git a/validator/resources/sampling-rule.json b/validator/resources/sampling-rule.json deleted file mode 100644 index 72d46496e..000000000 --- a/validator/resources/sampling-rule.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 2, - "rules": [ - { - "description": "debug", - "host": "*", - "http_method": "*", - "url_path": "*", - "fixed_target": 0, - "rate": 1.0 - } - ], - "default": { - "fixed_target": 1, - "rate": 1.0 - } - } \ No newline at end of file diff --git a/validator/resources/xray-config.json b/validator/resources/xray-config.json deleted file mode 100644 index 75be23507..000000000 --- a/validator/resources/xray-config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "agent":{ - "debug":true - }, - "traces": { - "traces_collected": { - "xray": { - } - } - } -} \ No newline at end of file diff --git a/validator/validators/basic/resources/sampling-rule.json b/validator/validators/basic/resources/sampling-rule.json deleted file mode 100644 index 72d46496e..000000000 --- a/validator/validators/basic/resources/sampling-rule.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 2, - "rules": [ - { - "description": "debug", - "host": "*", - "http_method": "*", - "url_path": "*", - "fixed_target": 0, - "rate": 1.0 - } - ], - "default": { - "fixed_target": 1, - "rate": 1.0 - } - } \ No newline at end of file diff --git a/validator/validators/util/common.go b/validator/validators/util/common.go index 7fc272031..48736edf7 100644 --- a/validator/validators/util/common.go +++ b/validator/validators/util/common.go @@ -6,7 +6,6 @@ package util import ( "fmt" "time" - "github.com/aws/amazon-cloudwatch-agent-test/test/xray" "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" @@ -22,17 +21,17 @@ func LogCloudWatchDimension(dims []types.Dimension) string { return dimension } -func StartTraceGeneration(receiver string, agentConfigPath string,agentRuntime time.Duration ,traceSendingInterval time.Duration) error{ +func StartTraceGeneration(receiver string, agentConfigPath string, agentRuntime time.Duration, traceSendingInterval time.Duration) error { cfg := common.TraceTestConfig{ - Generator: nil, - Name: "", - AgentConfigPath: agentConfigPath, - AgentRuntime: agentRuntime, + Generator: nil, + Name: "", + AgentConfigPath: agentConfigPath, + AgentRuntime: agentRuntime, } xrayGenCfg := common.TraceGeneratorConfig{ Interval: traceSendingInterval, - Annotations:map[string]interface{}{ - "test_type": "simple_otlp", + Annotations: map[string]interface{}{ + "test_type": "simple_otlp", }, Metadata: map[string]map[string]interface{}{ "default": { @@ -44,14 +43,15 @@ func StartTraceGeneration(receiver string, agentConfigPath string,agentRuntime t "custom_key": "custom_value", }, }, - } - switch receiver{ + } + switch receiver { case "xray": cfg.Generator = xray.NewLoadGenerator(&xrayGenCfg) cfg.Name = "xray-performance-test" case "otlp": + panic("Only supports xray for now.") default: - panic("Invalid trace receiver") + panic("Invalid trace receiver") } err := common.GenerateTraces(cfg) return err diff --git a/validator/validators/validator.go b/validator/validators/validator.go index f8da17d36..0c2f881db 100644 --- a/validator/validators/validator.go +++ b/validator/validators/validator.go @@ -8,6 +8,7 @@ import ( "log" "time" + "github.com/aws/amazon-cloudwatch-agent-test/mockserver" "github.com/aws/amazon-cloudwatch-agent-test/validator/models" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/feature" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/performance" @@ -44,7 +45,8 @@ func LaunchValidator(vConfig models.ValidateConfig) error { log.Printf("Start to sleep %f s for the metric to be available in the beginning of next minute ", durationBeforeNextMinute.Seconds()) time.Sleep(durationBeforeNextMinute) - + log.Printf("Start mock server \n") + mockserverChan := mockserver.StartHttpServer() log.Printf("Start to generate load in %f s for the agent to collect and send all the metrics to CloudWatch within the datapoint period ", agentCollectionPeriod.Seconds()) err = validator.GenerateLoad() if err != nil { @@ -60,7 +62,9 @@ func LaunchValidator(vConfig models.ValidateConfig) error { if err != nil { return err } - + log.Printf("Closing the mock server") + mockserverChan <- 0 + close(mockserverChan) err = validator.Cleanup() if err != nil { return err From 5a58b0588478b67f208594241b25d4934db31346 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Fri, 18 Aug 2023 11:40:19 -0400 Subject: [PATCH 10/14] trying docker --- terraform/performance/main.tf | 17 ++-- test/performance/trace/xray/agent_config.json | 99 ++++++++++++++++++- .../performance/performance_validator.go | 1 + validator/validators/util/common.go | 2 +- validator/validators/validator.go | 7 +- 5 files changed, 110 insertions(+), 16 deletions(-) diff --git a/terraform/performance/main.tf b/terraform/performance/main.tf index 0eab9508d..71961e1af 100644 --- a/terraform/performance/main.tf +++ b/terraform/performance/main.tf @@ -109,21 +109,22 @@ resource "null_resource" "validator_linux" { } provisioner "remote-exec" { inline = [ - "export AWS_REGION=${var.region}", - "sudo chmod +x ./${local.install_validator}", #mock server dependencies getting transfered. "git clone https://github.com/okankoAMZ/amazon-cloudwatch-agent-test.git", - "cd amazon-cloudwatch-agent-test && git checkout xray-performance-test", + "cd amazon-cloudwatch-agent-test && git checkout xray-perf-test-docker", + "cd mockserver && sudo docker build -t mockserver . && cd ..", + "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver", + # "go test ./test/xray -p 1 -timeout 1h -computeType=EC2 ", "cd ..", "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", "cp -a amazon-cloudwatch-agent-test/mockserver/. /home/ec2-user/", "sudo make update-certs", - "sudo cp certificates/ssl/certificate.crt /usr/local/share/ca-certificates/terraform.crt", - "sudo update-ca-certificates", - "sudo ./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", - "sudo setcap 'cap_net_bind_service=+ep' validator", + "export AWS_REGION=${var.region}", + "sudo chmod +x ./${local.install_validator}", + "printenv", + "./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", local.start_command, - "sudo ./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=false", + "./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=false", ] } } diff --git a/test/performance/trace/xray/agent_config.json b/test/performance/trace/xray/agent_config.json index 90283d83e..547950f13 100644 --- a/test/performance/trace/xray/agent_config.json +++ b/test/performance/trace/xray/agent_config.json @@ -1,5 +1,7 @@ { "agent": { + "metrics_collection_interval": 1, + "run_as_user": "root", "debug": true }, "traces": { @@ -9,5 +11,100 @@ } } }, - "insecure": true + "insecure": true, + "metrics": { + "namespace": "CloudWatchAgentPerformance", + "append_dimensions": { + "InstanceId": "${aws:InstanceId}" + }, + "metrics_collected": { + "cpu": { + "measurement": [ + "time_active", "time_guest", "time_guest_nice", "time_idle", "time_iowait", "time_irq", + "time_nice", "time_softirq", "time_steal", "time_system", "time_user", + "usage_active", "usage_guest", "usage_guest_nice", "usage_idle", "usage_iowait", "usage_irq", + "usage_nice", "usage_softirq", "usage_steal", "usage_system", "usage_user" + ], + "metrics_collection_interval": 1 + }, + "swap": { + "measurement": [ + "free","used","used_percent" + ], + "metrics_collection_interval": 1 + }, + "processes": { + "measurement": [ + "blocked","running","sleeping","stopped","total","dead","idle","paging","total_threads","zombies" + ], + "metrics_collection_interval": 1 + }, + "netstat": { + "measurement": [ + "tcp_close","tcp_close_wait","tcp_closing", "tcp_established","tcp_fin_wait1","tcp_fin_wait2","tcp_last_ack", + "tcp_listen","tcp_none","tcp_syn_sent","tcp_syn_recv","tcp_time_wait","udp_socket" + ], + "metrics_collection_interval": 1 + }, + "mem": { + "measurement": [ + "active", "available", "available_percent", "buffered", "cached", "free", "inactive", "total", + "used", "used_percent" + ], + "metrics_collection_interval": 1 + }, + "diskio": { + "resources": [ + "*" + ], + "measurement": [ + "iops_in_progress", "io_time", "reads", "read_bytes", "read_time", "writes", "write_bytes", "write_time" + ], + "metrics_collection_interval": 1 + }, + "disk": { + "resources": [ + "*" + ], + "measurement": [ + "free","inodes_free","inodes_total","inodes_used","total","used","used_percent" + ], + "drop_device": true, + "metrics_collection_interval": 1 + }, + "ethtool": { + "interface_include": [ + "eth0", + "ens5" + ], + "metrics_include": [ + "queue_0_tx_cnt","queue_0_rx_cnt" + ] + }, + "net": { + "resources": [ + "eth0" + ], + "measurement": [ + "bytes_sent", "bytes_recv", "drop_in", "drop_out", "err_in", "err_out", "packets_sent", "packets_recv" + ], + "metrics_collection_interval": 1 + }, + "procstat": [ + { + "exe": "cloudwatch-agent", + "measurement": [ + "cpu_usage", + "memory_rss", + "memory_swap", + "memory_vms", + "memory_data", + "num_fds", + "write_bytes" + ], + "metrics_collection_interval": 1 + } + ] + } + } } \ No newline at end of file diff --git a/validator/validators/performance/performance_validator.go b/validator/validators/performance/performance_validator.go index b1e98f032..9f7261532 100644 --- a/validator/validators/performance/performance_validator.go +++ b/validator/validators/performance/performance_validator.go @@ -222,6 +222,7 @@ func (s *PerformanceValidator) GetPerformanceMetrics(startTime, endTime time.Tim }) } } + log.Println("Performance Metric Query", performanceMetricDataQueries) metrics, err := awsservice.GetMetricData(performanceMetricDataQueries, startTime, endTime) if err != nil { diff --git a/validator/validators/util/common.go b/validator/validators/util/common.go index 48736edf7..d78498382 100644 --- a/validator/validators/util/common.go +++ b/validator/validators/util/common.go @@ -21,7 +21,7 @@ func LogCloudWatchDimension(dims []types.Dimension) string { return dimension } -func StartTraceGeneration(receiver string, agentConfigPath string, agentRuntime time.Duration, traceSendingInterval time.Duration) error { +func StartTraceGeneration(receiver string, agentConfigPath string, agentRuntime time.Duration, traceSendingInterval time.Duration) error { cfg := common.TraceTestConfig{ Generator: nil, Name: "", diff --git a/validator/validators/validator.go b/validator/validators/validator.go index 0c2f881db..d771208a5 100644 --- a/validator/validators/validator.go +++ b/validator/validators/validator.go @@ -8,7 +8,7 @@ import ( "log" "time" - "github.com/aws/amazon-cloudwatch-agent-test/mockserver" + // "github.com/aws/amazon-cloudwatch-agent-test/mockserver" "github.com/aws/amazon-cloudwatch-agent-test/validator/models" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/feature" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/performance" @@ -45,8 +45,6 @@ func LaunchValidator(vConfig models.ValidateConfig) error { log.Printf("Start to sleep %f s for the metric to be available in the beginning of next minute ", durationBeforeNextMinute.Seconds()) time.Sleep(durationBeforeNextMinute) - log.Printf("Start mock server \n") - mockserverChan := mockserver.StartHttpServer() log.Printf("Start to generate load in %f s for the agent to collect and send all the metrics to CloudWatch within the datapoint period ", agentCollectionPeriod.Seconds()) err = validator.GenerateLoad() if err != nil { @@ -62,9 +60,6 @@ func LaunchValidator(vConfig models.ValidateConfig) error { if err != nil { return err } - log.Printf("Closing the mock server") - mockserverChan <- 0 - close(mockserverChan) err = validator.Cleanup() if err != nil { return err From 87e2799f8031392f9e31357083bed624dc031ea6 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Thu, 31 Aug 2023 13:02:01 -0400 Subject: [PATCH 11/14] PR Cleanup --- generator/test_case_generator.go | 10 +++++----- terraform/performance/main.tf | 2 +- .../validators/performance/performance_validator.go | 1 - validator/validators/validator.go | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index dabdfaf20..ee9e17b0b 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -115,11 +115,11 @@ var testTypeToTestConfig = map[string][]testConfig{ //{testDir: "../../../test/assume_role"}, }, "ec2_performance": { - // {testDir: "../../test/performance/emf"}, - // {testDir: "../../test/performance/logs"}, - // {testDir: "../../test/performance/system"}, - // {testDir: "../../test/performance/statsd"}, - // {testDir: "../../test/performance/collectd"}, + {testDir: "../../test/performance/emf"}, + {testDir: "../../test/performance/logs"}, + {testDir: "../../test/performance/system"}, + {testDir: "../../test/performance/statsd"}, + {testDir: "../../test/performance/collectd"}, {testDir: "../../test/performance/trace/xray"}, }, "ec2_windows_performance": { diff --git a/terraform/performance/main.tf b/terraform/performance/main.tf index 71961e1af..f164d10a8 100644 --- a/terraform/performance/main.tf +++ b/terraform/performance/main.tf @@ -110,11 +110,11 @@ resource "null_resource" "validator_linux" { provisioner "remote-exec" { inline = [ #mock server dependencies getting transfered. + # todo make this optional with a env var. "git clone https://github.com/okankoAMZ/amazon-cloudwatch-agent-test.git", "cd amazon-cloudwatch-agent-test && git checkout xray-perf-test-docker", "cd mockserver && sudo docker build -t mockserver . && cd ..", "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver", - # "go test ./test/xray -p 1 -timeout 1h -computeType=EC2 ", "cd ..", "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", "cp -a amazon-cloudwatch-agent-test/mockserver/. /home/ec2-user/", diff --git a/validator/validators/performance/performance_validator.go b/validator/validators/performance/performance_validator.go index 9f7261532..b1e98f032 100644 --- a/validator/validators/performance/performance_validator.go +++ b/validator/validators/performance/performance_validator.go @@ -222,7 +222,6 @@ func (s *PerformanceValidator) GetPerformanceMetrics(startTime, endTime time.Tim }) } } - log.Println("Performance Metric Query", performanceMetricDataQueries) metrics, err := awsservice.GetMetricData(performanceMetricDataQueries, startTime, endTime) if err != nil { diff --git a/validator/validators/validator.go b/validator/validators/validator.go index d771208a5..e137c6b64 100644 --- a/validator/validators/validator.go +++ b/validator/validators/validator.go @@ -8,7 +8,6 @@ import ( "log" "time" - // "github.com/aws/amazon-cloudwatch-agent-test/mockserver" "github.com/aws/amazon-cloudwatch-agent-test/validator/models" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/feature" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/performance" @@ -42,9 +41,9 @@ func LaunchValidator(vConfig models.ValidateConfig) error { if err != nil { return err } - log.Printf("Start to sleep %f s for the metric to be available in the beginning of next minute ", durationBeforeNextMinute.Seconds()) time.Sleep(durationBeforeNextMinute) + log.Printf("Start to generate load in %f s for the agent to collect and send all the metrics to CloudWatch within the datapoint period ", agentCollectionPeriod.Seconds()) err = validator.GenerateLoad() if err != nil { @@ -60,6 +59,7 @@ func LaunchValidator(vConfig models.ValidateConfig) error { if err != nil { return err } + err = validator.Cleanup() if err != nil { return err From 1c8283036afc39d897810e123e07118770a1fa58 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Fri, 1 Sep 2023 12:49:35 -0400 Subject: [PATCH 12/14] alternative optional mock server start --- generator/test_case_generator.go | 13 +++++++++---- terraform/performance/main.tf | 7 ++----- terraform/performance/variables.tf | 4 ++++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index ee9e17b0b..166adfda7 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -31,13 +31,15 @@ type matrixRow struct { TerraformDir string `json:"terraform_dir"` UseSSM bool `json:"useSSM"` ExcludedTests string `json:"excludedTests"` + RunMockServer bool `json:"run_mock_server"` } type testConfig struct { // this gives more flexibility to define terraform dir when there should be a different set of terraform files // e.g. statsd can have a multiple terraform module sets for difference test scenarios (ecs, eks or ec2) - testDir string - terraformDir string + testDir string + terraformDir string + runMockServer bool // define target matrix field as set(s) // empty map means a testConfig will be created with a test entry for each entry from *_test_matrix.json targets map[string]map[string]struct{} @@ -120,7 +122,8 @@ var testTypeToTestConfig = map[string][]testConfig{ {testDir: "../../test/performance/system"}, {testDir: "../../test/performance/statsd"}, {testDir: "../../test/performance/collectd"}, - {testDir: "../../test/performance/trace/xray"}, + {testDir: "../../test/performance/trace/xray", + runMockServer: true}, }, "ec2_windows_performance": { {testDir: "../../test/performance/windows/logs"}, @@ -210,7 +213,9 @@ func genMatrix(testType string, testConfigs []testConfig) []matrixRow { testMatrixComplete := make([]matrixRow, 0, len(testMatrix)) for _, test := range testMatrix { for _, testConfig := range testConfigs { - row := matrixRow{TestDir: testConfig.testDir, TestType: testType, TerraformDir: testConfig.terraformDir} + log.Printf("Run mock? %s",testConfig.runMockServer) + row := matrixRow{TestDir: testConfig.testDir, TestType: testType, TerraformDir: testConfig.terraformDir, + RunMockServer: testConfig.runMockServer} err = mapstructure.Decode(test, &row) if err != nil { log.Panicf("can't decode map test %v to metric line struct with error %v", testConfig, err) diff --git a/terraform/performance/main.tf b/terraform/performance/main.tf index f164d10a8..9c9960b14 100644 --- a/terraform/performance/main.tf +++ b/terraform/performance/main.tf @@ -113,15 +113,12 @@ resource "null_resource" "validator_linux" { # todo make this optional with a env var. "git clone https://github.com/okankoAMZ/amazon-cloudwatch-agent-test.git", "cd amazon-cloudwatch-agent-test && git checkout xray-perf-test-docker", - "cd mockserver && sudo docker build -t mockserver . && cd ..", - "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver", + var.run_mock_server? "cd mockserver && sudo docker build -t mockserver . && cd .." : "", + var.run_mock_server? "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver" : "", "cd ..", "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", - "cp -a amazon-cloudwatch-agent-test/mockserver/. /home/ec2-user/", - "sudo make update-certs", "export AWS_REGION=${var.region}", "sudo chmod +x ./${local.install_validator}", - "printenv", "./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", local.start_command, "./${local.install_validator} --validator-config=${module.validator.instance_validator_config} --preparation-mode=false", diff --git a/terraform/performance/variables.tf b/terraform/performance/variables.tf index 0fee5fa04..0bc95f104 100644 --- a/terraform/performance/variables.tf +++ b/terraform/performance/variables.tf @@ -66,3 +66,7 @@ variable "family" { error_message = "Valid values for family are (windows, linux)." } } +variable "run_mock_server"{ + type = bool + default = false +} \ No newline at end of file From 0d6c84344510212ead9a31c56d057125d4bceef1 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 5 Sep 2023 15:50:17 -0400 Subject: [PATCH 13/14] merging docker branch --- generator/test_case_generator.go | 8 +-- go.mod | 1 - go.sum | 2 - mockserver/Dockerfile | 13 ++++ mockserver/go.mod | 5 ++ mockserver/http_server_test.go | 98 -------------------------- mockserver/{http_server.go => main.go} | 45 ++++++------ terraform/performance/main.tf | 8 +-- terraform/performance/variables.tf | 4 +- 9 files changed, 47 insertions(+), 137 deletions(-) create mode 100644 mockserver/Dockerfile create mode 100644 mockserver/go.mod delete mode 100644 mockserver/http_server_test.go rename mockserver/{http_server.go => main.go} (83%) diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index 3b2f4f695..44daec2e1 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -31,7 +31,6 @@ type matrixRow struct { TerraformDir string `json:"terraform_dir"` UseSSM bool `json:"useSSM"` ExcludedTests string `json:"excludedTests"` - RunMockServer bool `json:"run_mock_server"` MetadataEnabled string `json:"metadataEnabled"` } @@ -123,8 +122,7 @@ var testTypeToTestConfig = map[string][]testConfig{ {testDir: "../../test/performance/system"}, {testDir: "../../test/performance/statsd"}, {testDir: "../../test/performance/collectd"}, - {testDir: "../../test/performance/trace/xray", - runMockServer: true}, + {testDir: "../../test/performance/trace/xray",runMockServer: true}, }, "ec2_windows_performance": { {testDir: "../../test/performance/windows/logs"}, @@ -227,9 +225,7 @@ func genMatrix(testType string, testConfigs []testConfig) []matrixRow { testMatrixComplete := make([]matrixRow, 0, len(testMatrix)) for _, test := range testMatrix { for _, testConfig := range testConfigs { - log.Printf("Run mock? %s",testConfig.runMockServer) - row := matrixRow{TestDir: testConfig.testDir, TestType: testType, TerraformDir: testConfig.terraformDir, - RunMockServer: testConfig.runMockServer} + row := matrixRow{TestDir: testConfig.testDir, TestType: testType, TerraformDir: testConfig.terraformDir} err = mapstructure.Decode(test, &row) if err != nil { log.Panicf("can't decode map test %v to metric line struct with error %v", testConfig, err) diff --git a/go.mod b/go.mod index 5c50a915e..7d9cd75fd 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,6 @@ require ( github.com/aws/aws-xray-sdk-go v1.8.1 github.com/cenkalti/backoff/v4 v4.2.1 github.com/google/uuid v1.3.0 - github.com/gorilla/mux v1.8.0 github.com/mitchellh/mapstructure v1.5.0 github.com/prozz/aws-embedded-metrics-golang v1.2.0 github.com/qri-io/jsonschema v0.2.1 diff --git a/go.sum b/go.sum index b81b7eff0..b664d244a 100644 --- a/go.sum +++ b/go.sum @@ -232,8 +232,6 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4Zs 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/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= diff --git a/mockserver/Dockerfile b/mockserver/Dockerfile new file mode 100644 index 000000000..a26bc7a38 --- /dev/null +++ b/mockserver/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.19 AS build +WORKDIR $GOPATH/main +COPY . . +RUN go env -w GOPROXY=direct +RUN GO111MODULE=on go mod download +RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -o=/bin/main . +EXPOSE 80 +EXPOSE 443 +FROM scratch +ENV AWS_REGION="us-west-2" +COPY --from=build /bin/main /bin/main +COPY certificates certificates +ENTRYPOINT ["/bin/main"] \ No newline at end of file diff --git a/mockserver/go.mod b/mockserver/go.mod new file mode 100644 index 000000000..9cd6b1a7a --- /dev/null +++ b/mockserver/go.mod @@ -0,0 +1,5 @@ +module mockserver + +go 1.20 + +require github.com/gorilla/mux v1.8.0 \ No newline at end of file diff --git a/mockserver/http_server_test.go b/mockserver/http_server_test.go deleted file mode 100644 index 5200d6142..000000000 --- a/mockserver/http_server_test.go +++ /dev/null @@ -1,98 +0,0 @@ -package mockserver - -import ( - "crypto/tls" - "encoding/json" - "io" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// https://github.com/aws-observability/aws-otel-test-framework/blob/terraform/mocked_servers/https/main.go -const ( - APP_SERVER_ADDR = "http://127.0.0.1" - APP_SERVER_PORT = ":" + "8080" - APP_SERVER = APP_SERVER_ADDR + APP_SERVER_PORT - DATA_SERVER_ADDR = "https://127.0.0.1" - DATA_SERVER_PORT = ":" + "443" - DATA_SERVER = DATA_SERVER_ADDR + DATA_SERVER_PORT - - SEND_TEST_DATA_COUNT time.Duration = 10 * time.Second - TPM_CHECK_INTERVAL time.Duration = 10 * time.Second -) - -func ResponseToString(res *http.Response) (string, error) { - responseText, err := io.ReadAll(res.Body) - if err != nil { - return "", err - } - return string(responseText), nil -} -func HttpsGetRequest(url string) (string, error) { - tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - } - - client := &http.Client{Transport: tr} - - res, err := client.Get(url) - if err != nil { - return "", err - } - return ResponseToString(res) -} -func HttpGetRequest(url string) (string, error) { - res, err := http.Get(url) - if err != nil { - return "", err - } - return ResponseToString(res) - -} -func HttpServerSanityCheck(t *testing.T, url string) { - t.Helper() - resString, err := HttpGetRequest(url) - require.NoErrorf(t, err, "Healthcheck failed: %v", err) - require.Contains(t, resString, HealthCheckMessage) -} -func HttpsServerSanityCheck(t *testing.T, url string) { - t.Helper() - resString, err := HttpsGetRequest(url) - require.NoErrorf(t, err, "Healthcheck failed: %v", err) - require.Contains(t, resString, HealthCheckMessage) -} -func HttpServerCheckData(t *testing.T) { - t.Helper() - resString, err := HttpGetRequest(APP_SERVER + "/check-data") - require.NoErrorf(t, err, "Healthcheck failed: %v", err) - // require.Contains(t, resString, HealthCheckMessage) - t.Logf("resString: %s", resString) -} -func HttpServerCheckTPM(t *testing.T) { - t.Helper() - resString, err := HttpGetRequest(APP_SERVER + "/tpm") - require.NoErrorf(t, err, "tpm failed: %v", err) - var httpData map[string]interface{} - json.Unmarshal([]byte(resString), &httpData) - tpm, ok := httpData["tpm"] - require.True(t, ok, "tpm json is broken") - assert.Truef(t, tpm.(float64) > 1, "tpm is less than 1 %f", tpm) -} - -func TestMockServer(t *testing.T) { - serverControlChan := StartHttpServer() - time.Sleep(3 * time.Second) - HttpServerSanityCheck(t, APP_SERVER) - HttpsServerSanityCheck(t, DATA_SERVER) - time.Sleep(1 * time.Minute) - serverControlChan <- 0 - -} - -func TestStartMockServer(t *testing.T) { - StartHttpServer() -} diff --git a/mockserver/http_server.go b/mockserver/main.go similarity index 83% rename from mockserver/http_server.go rename to mockserver/main.go index 18321b4dc..a087b7c21 100644 --- a/mockserver/http_server.go +++ b/mockserver/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package mockserver +package main import ( "context" @@ -21,9 +21,10 @@ import ( "io" "log" "net/http" + "path" + "sync" "sync/atomic" "time" - "path" "github.com/gorilla/mux" ) @@ -31,12 +32,13 @@ import ( const ( HealthCheckMessage = "healthcheck" SuccessMessage = "success" - ) + var ( - CertFilePath = path.Join("certificates","ssl", "certificate.crt") - KeyFilePath = path.Join("certificates","private.key") + CertFilePath = path.Join("certificates", "ssl", "certificate.crt") + KeyFilePath = path.Join("certificates", "private.key") ) + type transactionStore struct { transactions uint32 startTime time.Time @@ -46,7 +48,7 @@ type TransactionPayload struct { TransactionsPerMinute float64 `json:"tpm"` } -func healthCheck(w http.ResponseWriter, _ *http.Request) { +func healthCheck(w http.ResponseWriter, _ *http.Request) { if _, err := io.WriteString(w, HealthCheckMessage); err != nil { log.Printf("Unable to write response: %v", err) } @@ -90,8 +92,8 @@ func (ts *transactionStore) tpm(w http.ResponseWriter, _ *http.Request) { // Starts an HTTPS server that receives requests for the data handler service at the sample server port // Starts an HTTP server that receives request from validator only to verify the data ingestion -func StartHttpServer() chan interface{} { - serverControlChan := make(chan interface{}) +func StartHttpServer() { + var wg sync.WaitGroup log.Println("\033[31m Starting Server \033[0m") store := transactionStore{startTime: time.Now()} dataApp := mux.NewRouter() @@ -99,38 +101,33 @@ func StartHttpServer() chan interface{} { verifyApp := http.NewServeMux() appServer := &http.Server{Addr: ":8080", Handler: verifyApp} go func(ts *transactionStore) { - defer close(serverControlChan) - dataApp.HandleFunc("/", healthCheck) + wg.Add(1) + dataApp.HandleFunc("/ping", healthCheck) dataApp.PathPrefix("/put-data").HandlerFunc(ts.dataReceived) dataApp.HandleFunc("/trace/v1", ts.dataReceived) dataApp.HandleFunc("/metric/v1", ts.dataReceived) if err := daemonServer.ListenAndServeTLS(CertFilePath, KeyFilePath); err != nil { - log.Fatalf("HTTPS server error: %v", err) + log.Printf("HTTPS server error: %v", err) err = daemonServer.Shutdown(context.TODO()) log.Fatalf("Shutdown server error: %v", err) } }(&store) go func(ts *transactionStore) { - defer close(serverControlChan) - verifyApp.HandleFunc("/", healthCheck) + wg.Add(1) + verifyApp.HandleFunc("/ping", healthCheck) verifyApp.HandleFunc("/check-data", ts.checkData) verifyApp.HandleFunc("/tpm", ts.tpm) if err := appServer.ListenAndServe(); err != nil { - log.Fatalf("Verification server error: %v", err) + log.Printf("Verification server error: %v", err) err := appServer.Shutdown(context.TODO()) log.Fatalf("Shuwdown server error: %v", err) } }(&store) - go func() { - for { - select { - case <-serverControlChan: - log.Println("\033[32m Stopping Server \033[0m") - - } - } - }() + wg.Done() + log.Println("\033[32m Stopping Server \033[0m") +} - return serverControlChan +func main() { + StartHttpServer() } diff --git a/terraform/performance/main.tf b/terraform/performance/main.tf index 9c9960b14..264c183e8 100644 --- a/terraform/performance/main.tf +++ b/terraform/performance/main.tf @@ -111,10 +111,10 @@ resource "null_resource" "validator_linux" { inline = [ #mock server dependencies getting transfered. # todo make this optional with a env var. - "git clone https://github.com/okankoAMZ/amazon-cloudwatch-agent-test.git", - "cd amazon-cloudwatch-agent-test && git checkout xray-perf-test-docker", - var.run_mock_server? "cd mockserver && sudo docker build -t mockserver . && cd .." : "", - var.run_mock_server? "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver" : "", + "git clone https://github.com/aws/amazon-cloudwatch-agent-test.git", + "cd amazon-cloudwatch-agent-test && git checkout xray-performance-test", + var.run_mock_server ? "cd mockserver && sudo docker build -t mockserver . && cd .." : "echo skipping mock server build", + var.run_mock_server ? "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver" : "echo skipping mock server", "cd ..", "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", "export AWS_REGION=${var.region}", diff --git a/terraform/performance/variables.tf b/terraform/performance/variables.tf index 0bc95f104..06e93c120 100644 --- a/terraform/performance/variables.tf +++ b/terraform/performance/variables.tf @@ -66,7 +66,7 @@ variable "family" { error_message = "Valid values for family are (windows, linux)." } } -variable "run_mock_server"{ - type = bool +variable "run_mock_server" { + type = bool default = false } \ No newline at end of file From 8a81870d21439d3bd6e1d39e860c5b3611210668 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 3 Oct 2023 11:38:36 -0400 Subject: [PATCH 14/14] Restructed Xray Test --- generator/test_case_generator.go | 2 +- mockserver/README | 3 - mockserver/README.md | 41 ++++++++++++ mockserver/go.sum | 1 + mockserver/main.go | 65 ++++++++++--------- terraform/performance/main.tf | 8 +-- terraform/performance/variables.tf | 9 +++ test/otlp/trace_test.go | 13 ++-- test/xray/trace_test.go | 13 ++-- .../common/{traces.go => traces/base/base.go} | 18 ++--- util/common/traces/generate.go | 43 ++++++++++++ .../common/traces}/otlp/generator.go | 12 ++-- .../common/traces}/xray/generator.go | 19 +++--- validator/models/validation_config.go | 2 +- validator/validators/basic/basic_validator.go | 3 +- validator/validators/util/common.go | 38 ----------- 16 files changed, 175 insertions(+), 115 deletions(-) delete mode 100644 mockserver/README create mode 100644 mockserver/README.md create mode 100644 mockserver/go.sum rename util/common/{traces.go => traces/base/base.go} (92%) create mode 100644 util/common/traces/generate.go rename {test => util/common/traces}/otlp/generator.go (90%) rename {test => util/common/traces}/xray/generator.go (85%) diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index 008d0b023..3c9a0ed91 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -131,7 +131,7 @@ var testTypeToTestConfig = map[string][]testConfig{ {testDir: "../../test/performance/system"}, {testDir: "../../test/performance/statsd"}, {testDir: "../../test/performance/collectd"}, - {testDir: "../../test/performance/trace/xray",runMockServer: true}, + {testDir: "../../test/performance/trace/xray", runMockServer: true}, }, "ec2_windows_performance": { {testDir: "../../test/performance/windows/logs"}, diff --git a/mockserver/README b/mockserver/README deleted file mode 100644 index 10cdf5346..000000000 --- a/mockserver/README +++ /dev/null @@ -1,3 +0,0 @@ -# Mocked Servers - -The servers themselves are very basic. They listen for a message and tend to set a flag to success upon receiving it. Typically, they are set up with two servers: one to mock the backend and one to report on the status of that mock (if endpoint is called, how many times, etc.). There's a built-in 15ms of latency between each message that's received. The status reporter will always be on port 8080 and support the `:8080/` (returns "healthcheck") and the `:8080/check-data` (returns "success" if mock has received messages) endpoints. \ No newline at end of file diff --git a/mockserver/README.md b/mockserver/README.md new file mode 100644 index 000000000..39d5b6c0c --- /dev/null +++ b/mockserver/README.md @@ -0,0 +1,41 @@ +# The Mock Server + +## Overview + +The Mock Server is a simple server designed for receiving metric and trace data, providing a simulated endpoint for testing purposes. It listens on two separate ports: 8080 and 443. +## Running the server +This server is runs as a docker container to run this server: +1. First build the docker container with +```sh +sudo docker build -t mockserver . +``` +2. Run the container by mapping the ports you would like to use, for example: +```sh +sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver +``` + +## How it Works +### The Receiver + +The receiver component of the Mock Server operates on port 443. It is responsible for receiving messages and incrementing the transaction count. To simulate real-world conditions, there is a built-in 15ms latency between each received message. The data received can be sent to three possible routes: + +- **Check Receiver Status:** You can check if the receiver is alive by making a request to `/ping`. + +- **Send Data:** Use the `/put-data` route to send data. This route supports two sub-routes: + - `/put-data/trace/v1`: Use this sub-route for sending trace data. + - `/put-data/metrics`: Use this sub-route for sending metrics data. + +> [!Important] +> Currently, both traces and metrics are handled in the same way. + +### The Verifier + +The verifier component can be accessed via a listener on port 8080. It provides information about the transactions, including: + +- **Transactions per Minute:** You can obtain the transactions per minute by making a request to `/tpm`. + +- **Transaction Count:** To check the total transaction count, use the `/check-data` route. + +- **Verifier Status:** Determine if the verification server is alive by sending a request to `/ping`. + + diff --git a/mockserver/go.sum b/mockserver/go.sum new file mode 100644 index 000000000..2a61a10c4 --- /dev/null +++ b/mockserver/go.sum @@ -0,0 +1 @@ +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= diff --git a/mockserver/main.go b/mockserver/main.go index a087b7c21..72dcfe0a1 100644 --- a/mockserver/main.go +++ b/mockserver/main.go @@ -1,4 +1,4 @@ -// Copyright 2021 Amazon.com, Inc. or its affiliates +// Copyright 2023 Amazon.com, Inc. or its affiliates // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package main import ( "context" "encoding/json" - "fmt" "io" "log" "net/http" @@ -39,45 +38,51 @@ var ( KeyFilePath = path.Join("certificates", "private.key") ) -type transactionStore struct { +type transactionHttpServer struct { transactions uint32 startTime time.Time } type TransactionPayload struct { - TransactionsPerMinute float64 `json:"tpm"` + TransactionsPerMinute float64 `json:"GetNumberOfTransactionsPerMinute"` } -func healthCheck(w http.ResponseWriter, _ *http.Request) { +func healthCheck(w http.ResponseWriter, _ *http.Request) { if _, err := io.WriteString(w, HealthCheckMessage); err != nil { + w.WriteHeader(http.StatusInternalServerError) log.Printf("Unable to write response: %v", err) + return } + w.WriteHeader(http.StatusOK) } -func (ts *transactionStore) checkData(w http.ResponseWriter, _ *http.Request) { +func (ts *transactionHttpServer) checkTransactionCount(w http.ResponseWriter, _ *http.Request) { var message string var t = atomic.LoadUint32(&ts.transactions) if t > 0 { message = SuccessMessage } - fmt.Printf("\033[31m Time: %d | checkData msg: %s | %d\033[0m \n", time.Now().Unix(), message, t) + log.Printf("\033[31m Time: %d | checkTransactionCount msg: %s | %d\033[0m \n", time.Now().Unix(), message, t) if _, err := io.WriteString(w, message); err != nil { + w.WriteHeader(http.StatusInternalServerError) io.WriteString(w, err.Error()) log.Printf("Unable to write response: %v", err) + return } + w.WriteHeader(http.StatusOK) } -func (ts *transactionStore) dataReceived(w http.ResponseWriter, _ *http.Request) { +func (ts *transactionHttpServer) recordTransaction(w http.ResponseWriter, _ *http.Request) { atomic.AddUint32(&ts.transactions, 1) // Built-in latency - fmt.Printf("\033[31m Time: %d | data Received \033[0m \n", time.Now().Unix()) + log.Printf("\033[31m Time: %s | transaction received \033[0m \n", time.Now().String()) time.Sleep(15 * time.Millisecond) w.WriteHeader(http.StatusOK) } // Retrieve number of transactions per minute -func (ts *transactionStore) tpm(w http.ResponseWriter, _ *http.Request) { +func (ts *transactionHttpServer) GetNumberOfTransactionsPerMinute(w http.ResponseWriter, _ *http.Request) { // Calculate duration in minutes duration := time.Now().Sub(ts.startTime) transactions := float64(atomic.LoadUint32(&ts.transactions)) @@ -85,46 +90,48 @@ func (ts *transactionStore) tpm(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") if err := json.NewEncoder(w).Encode(TransactionPayload{tpm}); err != nil { + w.WriteHeader(http.StatusInternalServerError) io.WriteString(w, err.Error()) log.Printf("Unable to write response: %v", err) } } -// Starts an HTTPS server that receives requests for the data handler service at the sample server port // Starts an HTTP server that receives request from validator only to verify the data ingestion func StartHttpServer() { var wg sync.WaitGroup log.Println("\033[31m Starting Server \033[0m") - store := transactionStore{startTime: time.Now()} + store := transactionHttpServer{startTime: time.Now()} + //2 servers one for receiving the data , one for verify data dataApp := mux.NewRouter() - daemonServer := &http.Server{Addr: ":443", Handler: dataApp} - verifyApp := http.NewServeMux() - appServer := &http.Server{Addr: ":8080", Handler: verifyApp} - go func(ts *transactionStore) { - wg.Add(1) + dataReceiverServer := &http.Server{Addr: ":443", Handler: dataApp} + verificationRequestServer := http.NewServeMux() + appServer := &http.Server{Addr: ":8080", Handler: verificationRequestServer} + wg.Add(2) + go func(ts *transactionHttpServer) { + defer wg.Done() dataApp.HandleFunc("/ping", healthCheck) - dataApp.PathPrefix("/put-data").HandlerFunc(ts.dataReceived) - dataApp.HandleFunc("/trace/v1", ts.dataReceived) - dataApp.HandleFunc("/metric/v1", ts.dataReceived) - if err := daemonServer.ListenAndServeTLS(CertFilePath, KeyFilePath); err != nil { + dataApp.PathPrefix("/put-data").HandlerFunc(ts.recordTransaction) + dataApp.HandleFunc("/trace/v1", ts.recordTransaction) + dataApp.HandleFunc("/metric/v1", ts.recordTransaction) + if err := dataReceiverServer.ListenAndServeTLS(CertFilePath, KeyFilePath); err != nil { log.Printf("HTTPS server error: %v", err) - err = daemonServer.Shutdown(context.TODO()) + err = dataReceiverServer.Shutdown(context.TODO()) log.Fatalf("Shutdown server error: %v", err) } }(&store) - go func(ts *transactionStore) { - wg.Add(1) - verifyApp.HandleFunc("/ping", healthCheck) - verifyApp.HandleFunc("/check-data", ts.checkData) - verifyApp.HandleFunc("/tpm", ts.tpm) + go func(ts *transactionHttpServer) { + defer wg.Done() + verificationRequestServer.HandleFunc("/ping", healthCheck) + verificationRequestServer.HandleFunc("/check-data", ts.checkTransactionCount) + verificationRequestServer.HandleFunc("/tpm", ts.GetNumberOfTransactionsPerMinute) if err := appServer.ListenAndServe(); err != nil { log.Printf("Verification server error: %v", err) err := appServer.Shutdown(context.TODO()) - log.Fatalf("Shuwdown server error: %v", err) + log.Fatalf("Shutdown server error: %v", err) } }(&store) - wg.Done() + wg.Wait() log.Println("\033[32m Stopping Server \033[0m") } diff --git a/terraform/performance/main.tf b/terraform/performance/main.tf index 264c183e8..e83c3813d 100644 --- a/terraform/performance/main.tf +++ b/terraform/performance/main.tf @@ -110,12 +110,10 @@ resource "null_resource" "validator_linux" { provisioner "remote-exec" { inline = [ #mock server dependencies getting transfered. - # todo make this optional with a env var. - "git clone https://github.com/aws/amazon-cloudwatch-agent-test.git", - "cd amazon-cloudwatch-agent-test && git checkout xray-performance-test", + "git clone --branch ${var.github_test_repo_branch} ${var.github_test_repo}", var.run_mock_server ? "cd mockserver && sudo docker build -t mockserver . && cd .." : "echo skipping mock server build", - var.run_mock_server ? "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver" : "echo skipping mock server", - "cd ..", + var.run_mock_server ? "sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver" : "echo skipping mock server run", + "cd ..", # return to root , two copy xray configs next to validator "cp -r amazon-cloudwatch-agent-test/test/xray/resources /home/ec2-user/", "export AWS_REGION=${var.region}", "sudo chmod +x ./${local.install_validator}", diff --git a/terraform/performance/variables.tf b/terraform/performance/variables.tf index 06e93c120..f571f0911 100644 --- a/terraform/performance/variables.tf +++ b/terraform/performance/variables.tf @@ -66,6 +66,15 @@ variable "family" { error_message = "Valid values for family are (windows, linux)." } } +variable "github_test_repo" { + type = string + default = "https://github.com/aws/amazon-cloudwatch-agent-test.git" +} + +variable "github_test_repo_branch" { + type = string + default = "main" +} variable "run_mock_server" { type = bool default = false diff --git a/test/otlp/trace_test.go b/test/otlp/trace_test.go index 158bd11ce..fd68dd95e 100644 --- a/test/otlp/trace_test.go +++ b/test/otlp/trace_test.go @@ -6,7 +6,8 @@ import ( "time" "github.com/aws/amazon-cloudwatch-agent-test/environment" - "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/base" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/otlp" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/attribute" ) @@ -25,11 +26,11 @@ func TestTraces(t *testing.T) { env := environment.GetEnvironmentMetaData() testCases := map[string]struct { agentConfigPath string - generatorConfig *common.TraceGeneratorConfig + generatorConfig *base.TraceGeneratorConfig }{ "WithOTLP/Simple": { agentConfigPath: filepath.Join("resources", "otlp-config.json"), - generatorConfig: &common.TraceGeneratorConfig{ + generatorConfig: &base.TraceGeneratorConfig{ Interval: loadGeneratorInterval, Annotations: map[string]interface{}{ "test_type": "simple_otlp", @@ -55,13 +56,13 @@ func TestTraces(t *testing.T) { t.Run(name, func(t *testing.T) { - OtlpTestCfg := common.TraceTestConfig{ - Generator: NewLoadGenerator(testCase.generatorConfig), + OtlpTestCfg := base.TraceTestConfig{ + Generator: otlp.NewLoadGenerator(testCase.generatorConfig), Name: name, AgentConfigPath: testCase.agentConfigPath, AgentRuntime: agentRuntime, } - err := common.TraceTest(t, OtlpTestCfg) + err := base.TraceTest(t, OtlpTestCfg) require.NoError(t, err, "TraceTest failed because %s", err) }) diff --git a/test/xray/trace_test.go b/test/xray/trace_test.go index b9ec305c8..430a147b4 100644 --- a/test/xray/trace_test.go +++ b/test/xray/trace_test.go @@ -6,7 +6,8 @@ import ( "time" "github.com/aws/amazon-cloudwatch-agent-test/environment" - "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/base" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/xray" "github.com/stretchr/testify/require" ) @@ -26,11 +27,11 @@ func TestTraces(t *testing.T) { env := environment.GetEnvironmentMetaData() testCases := map[string]struct { agentConfigPath string - generatorConfig *common.TraceGeneratorConfig + generatorConfig *base.TraceGeneratorConfig }{ "WithXray/Simple": { agentConfigPath: filepath.Join("resources", "xray-config.json"), - generatorConfig: &common.TraceGeneratorConfig{ + generatorConfig: &base.TraceGeneratorConfig{ Interval: loadGeneratorInterval, Annotations: map[string]interface{}{ "test_type": "simple_xray", @@ -53,13 +54,13 @@ func TestTraces(t *testing.T) { for name, testCase := range testCases { t.Run(name, func(t *testing.T) { - XrayTestCfg := common.TraceTestConfig{ - Generator: NewLoadGenerator(testCase.generatorConfig), + XrayTestCfg := base.TraceTestConfig{ + Generator: xray.NewLoadGenerator(testCase.generatorConfig), Name: name, AgentConfigPath: testCase.agentConfigPath, AgentRuntime: agentRuntime, } - err := common.TraceTest(t, XrayTestCfg) + err := base.TraceTest(t, XrayTestCfg) require.NoError(t, err, "TraceTest failed because %s", err) }) diff --git a/util/common/traces.go b/util/common/traces/base/base.go similarity index 92% rename from util/common/traces.go rename to util/common/traces/base/base.go index 4cc3e48ea..72c43baa0 100644 --- a/util/common/traces.go +++ b/util/common/traces/base/base.go @@ -1,17 +1,17 @@ -package common +package base import ( "context" "encoding/json" - "reflect" - "testing" - "time" - "github.com/aws/amazon-cloudwatch-agent-test/util/awsservice" + "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/aws/aws-sdk-go-v2/service/xray/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/attribute" + "reflect" + "testing" + "time" ) const ( @@ -54,15 +54,15 @@ type TraceGeneratorInterface interface { func TraceTest(t *testing.T, traceTest TraceTestConfig) error { t.Helper() startTime := time.Now() - CopyFile(traceTest.AgentConfigPath, ConfigOutputPath) - require.NoError(t, StartAgent(ConfigOutputPath, true, false), "Couldn't Start the agent") + common.CopyFile(traceTest.AgentConfigPath, common.ConfigOutputPath) + require.NoError(t, common.StartAgent(common.ConfigOutputPath, true, false), "Couldn't Start the agent") go func() { require.NoError(t, traceTest.Generator.StartSendingTraces(context.Background()), "load generator exited with error") }() time.Sleep(traceTest.AgentRuntime) traceTest.Generator.StopSendingTraces() time.Sleep(AGENT_SHUTDOWN_DELAY) - StopAgent() + common.StopAgent() testsGenerated, testsEnded := traceTest.Generator.GetSegmentCount() t.Logf("For %s , Test Cases Generated %d | Test Cases Ended: %d", traceTest.Name, testsGenerated, testsEnded) endTime := time.Now() @@ -113,7 +113,7 @@ func SegmentValidationTest(t *testing.T, traceTest TraceTestConfig, segments []t } func GenerateTraces(traceTest TraceTestConfig) error { - CopyFile(traceTest.AgentConfigPath, ConfigOutputPath) + common.CopyFile(traceTest.AgentConfigPath, common.ConfigOutputPath) go func() { traceTest.Generator.StartSendingTraces(context.Background()) }() diff --git a/util/common/traces/generate.go b/util/common/traces/generate.go new file mode 100644 index 000000000..55a2857d0 --- /dev/null +++ b/util/common/traces/generate.go @@ -0,0 +1,43 @@ +package traces + +import ( + "fmt" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/base" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/xray" + "time" +) + +func StartTraceGeneration(receiver string, agentConfigPath string, agentRuntime time.Duration, traceSendingInterval time.Duration) error { + cfg := base.TraceTestConfig{ + Generator: nil, + Name: "", + AgentConfigPath: agentConfigPath, + AgentRuntime: agentRuntime, + } + xrayGenCfg := base.TraceGeneratorConfig{ + Interval: traceSendingInterval, + Annotations: map[string]interface{}{ + "test_type": "simple_otlp", + }, + Metadata: map[string]map[string]interface{}{ + "default": { + "nested": map[string]interface{}{ + "key": "value", + }, + }, + "custom_namespace": { + "custom_key": "custom_value", + }, + }, + } + switch receiver { + case "xray": + cfg.Generator = xray.NewLoadGenerator(&xrayGenCfg) + cfg.Name = "xray-performance-test" + case "otlp": + default: + return fmt.Errorf("%s is not supported.", receiver) + } + err := base.GenerateTraces(cfg) + return err +} diff --git a/test/otlp/generator.go b/util/common/traces/otlp/generator.go similarity index 90% rename from test/otlp/generator.go rename to util/common/traces/otlp/generator.go index 7064d0fd5..017fb3f4c 100644 --- a/test/otlp/generator.go +++ b/util/common/traces/otlp/generator.go @@ -5,7 +5,7 @@ import ( "errors" "time" - "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/base" "go.opentelemetry.io/contrib/propagators/aws/xray" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" @@ -25,8 +25,8 @@ const ( ) type OtlpTracesGenerator struct { - common.TraceGenerator - common.TraceGeneratorInterface + base.TraceGenerator + base.TraceGeneratorInterface } func (g *OtlpTracesGenerator) StartSendingTraces(ctx context.Context) error { @@ -51,9 +51,9 @@ func (g *OtlpTracesGenerator) StartSendingTraces(ctx context.Context) error { func (g *OtlpTracesGenerator) StopSendingTraces() { close(g.Done) } -func NewLoadGenerator(cfg *common.TraceGeneratorConfig) *OtlpTracesGenerator { +func NewLoadGenerator(cfg *base.TraceGeneratorConfig) *OtlpTracesGenerator { return &OtlpTracesGenerator{ - TraceGenerator: common.TraceGenerator{ + TraceGenerator: base.TraceGenerator{ Cfg: cfg, Done: make(chan struct{}), SegmentsGenerationCount: 0, @@ -90,7 +90,7 @@ func (g *OtlpTracesGenerator) GetAgentRuntime() time.Duration { func (g *OtlpTracesGenerator) GetName() string { return g.Name } -func (g *OtlpTracesGenerator) GetGeneratorConfig() *common.TraceGeneratorConfig { +func (g *OtlpTracesGenerator) GetGeneratorConfig() *base.TraceGeneratorConfig { return g.Cfg } diff --git a/test/xray/generator.go b/util/common/traces/xray/generator.go similarity index 85% rename from test/xray/generator.go rename to util/common/traces/xray/generator.go index 49262e92e..344202877 100644 --- a/test/xray/generator.go +++ b/util/common/traces/xray/generator.go @@ -3,21 +3,21 @@ package xray import ( "context" "errors" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces/base" + "github.com/aws/aws-xray-sdk-go/strategy/sampling" + "github.com/aws/aws-xray-sdk-go/xray" + "github.com/aws/aws-xray-sdk-go/xraylog" "log" "os" "path" "time" - "github.com/aws/amazon-cloudwatch-agent-test/util/common" - "github.com/aws/aws-xray-sdk-go/strategy/sampling" - "github.com/aws/aws-xray-sdk-go/xray" - "github.com/aws/aws-xray-sdk-go/xraylog" ) var generatorError = errors.New("Generator error") type XrayTracesGenerator struct { - common.TraceGenerator - common.TraceGeneratorInterface + base.TraceGenerator + base.TraceGeneratorInterface } func (g *XrayTracesGenerator) StartSendingTraces(ctx context.Context) error { @@ -37,7 +37,7 @@ func (g *XrayTracesGenerator) StartSendingTraces(ctx context.Context) error { func (g *XrayTracesGenerator) StopSendingTraces() { close(g.Done) } -func NewLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { +func NewLoadGenerator(cfg *base.TraceGeneratorConfig) *XrayTracesGenerator { s, err := sampling.NewLocalizedStrategyFromFilePath( path.Join("resources", "sampling-rule.json")) if err != nil { @@ -46,7 +46,7 @@ func NewLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { xray.Configure(xray.Config{SamplingStrategy: s}) xray.SetLogger(xraylog.NewDefaultLogger(os.Stdout, xraylog.LogLevelWarn)) return &XrayTracesGenerator{ - TraceGenerator: common.TraceGenerator{ + TraceGenerator: base.TraceGenerator{ Cfg: cfg, Done: make(chan struct{}), SegmentsGenerationCount: 0, @@ -56,7 +56,6 @@ func NewLoadGenerator(cfg *common.TraceGeneratorConfig) *XrayTracesGenerator { } func (g *XrayTracesGenerator) Generate(ctx context.Context) error { rootCtx, root := xray.BeginSegment(ctx, "load-generator") - log.Println("\033[34mGenerated Trace\033[0m") g.SegmentsGenerationCount++ defer func() { root.Close(nil) @@ -100,6 +99,6 @@ func (g *XrayTracesGenerator) GetAgentRuntime() time.Duration { func (g *XrayTracesGenerator) GetName() string { return g.Name } -func (g *XrayTracesGenerator) GetGeneratorConfig() *common.TraceGeneratorConfig { +func (g *XrayTracesGenerator) GetGeneratorConfig() *base.TraceGeneratorConfig { return g.Cfg } diff --git a/validator/models/validation_config.go b/validator/models/validation_config.go index d4446eded..6d29ee2c7 100644 --- a/validator/models/validation_config.go +++ b/validator/models/validation_config.go @@ -15,7 +15,7 @@ import ( "gopkg.in/yaml.v3" ) -var supportedReceivers = []string{"logs", "statsd", "collectd", "system", "emf","xray"} +var supportedReceivers = []string{"logs", "statsd", "collectd", "system", "emf", "xray"} type ValidateConfig interface { GetPluginsConfig() []string diff --git a/validator/validators/basic/basic_validator.go b/validator/validators/basic/basic_validator.go index 60ed6faed..885b5a61c 100644 --- a/validator/validators/basic/basic_validator.go +++ b/validator/validators/basic/basic_validator.go @@ -16,6 +16,7 @@ import ( "github.com/aws/amazon-cloudwatch-agent-test/util/awsservice" "github.com/aws/amazon-cloudwatch-agent-test/util/common" + "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces" "github.com/aws/amazon-cloudwatch-agent-test/validator/models" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/util" ) @@ -50,7 +51,7 @@ func (s *BasicValidator) GenerateLoad() error { case "logs": return common.StartLogWrite(agentConfigFilePath, agentCollectionPeriod, metricSendingInterval, dataRate) case "traces": - return util.StartTraceGeneration(receiver,agentConfigFilePath,agentCollectionPeriod,metricSendingInterval) + return traces.StartTraceGeneration(receiver, agentConfigFilePath, agentCollectionPeriod, metricSendingInterval) default: // Sending metrics based on the receivers; however, for scraping plugin (e.g prometheus), we would need to scrape it instead of sending return common.StartSendingMetrics(receiver, agentCollectionPeriod, metricSendingInterval, dataRate, logGroup, metricNamespace) diff --git a/validator/validators/util/common.go b/validator/validators/util/common.go index d78498382..048abe9fe 100644 --- a/validator/validators/util/common.go +++ b/validator/validators/util/common.go @@ -5,9 +5,6 @@ package util import ( "fmt" - "time" - "github.com/aws/amazon-cloudwatch-agent-test/test/xray" - "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" ) @@ -21,38 +18,3 @@ func LogCloudWatchDimension(dims []types.Dimension) string { return dimension } -func StartTraceGeneration(receiver string, agentConfigPath string, agentRuntime time.Duration, traceSendingInterval time.Duration) error { - cfg := common.TraceTestConfig{ - Generator: nil, - Name: "", - AgentConfigPath: agentConfigPath, - AgentRuntime: agentRuntime, - } - xrayGenCfg := common.TraceGeneratorConfig{ - Interval: traceSendingInterval, - Annotations: map[string]interface{}{ - "test_type": "simple_otlp", - }, - Metadata: map[string]map[string]interface{}{ - "default": { - "nested": map[string]interface{}{ - "key": "value", - }, - }, - "custom_namespace": { - "custom_key": "custom_value", - }, - }, - } - switch receiver { - case "xray": - cfg.Generator = xray.NewLoadGenerator(&xrayGenCfg) - cfg.Name = "xray-performance-test" - case "otlp": - panic("Only supports xray for now.") - default: - panic("Invalid trace receiver") - } - err := common.GenerateTraces(cfg) - return err -}