From 3ed9bc1e0d454239961368dca1c55caa7bbbbcc7 Mon Sep 17 00:00:00 2001 From: gadotroee <55343099+gadotroee@users.noreply.github.com> Date: Wed, 13 Apr 2022 11:28:48 +0300 Subject: [PATCH] Upgrade Basenine version to `v0.7.1` (#984) * Basenine MongoDB mess * Fix more * Fix the `mongodb` container arguments * Add Basenine ARM64 binary * Make the changes related to `leftOff` becoming a string value * Make `leftOffTop` state string * Handle `CloseConnection` in `Fetch` * Upgrade Basenine to `0.7.0` * Revert the changes in `package.json` and `package-lock.json` * Fix the `Dockerfile` * Remove the binaries * Increase the Basenine up deadline to 20 seconds * Revert the changes in `shared/kubernetes/provider.go` * Fix the OAS generator tests * Protect from race condition * Fix mutexes * Fix unlock * Fix logging data types * Try to stabilize the tests * Remove the `replace` statement * revert the change the done in https://github.com/up9inc/mizu/pull/984/commits/2899414f2b82ed8fdb2e84a7b6aa00f8e8b8f5e0 to not change the leftOff * Change `leftOffBottom` empty string default value to `latest` * Upgrade Basenine to `0.7.1` * Handle the Basenine client library errors better * Use `DEFAULT_QUERY` constant * Remove `min=-1` * Replace some `Errorf`s with `Panicf`s * Remove the closure in `runGenerator` method * Remove an unnecessary check Co-authored-by: M. Mert Yildiran Co-authored-by: Andrey Pokhilko Co-authored-by: undera Co-authored-by: AmitUp9 <96980485+AmitUp9@users.noreply.github.com> --- Dockerfile | 4 +- agent/go.mod | 2 +- agent/go.sum | 4 +- agent/pkg/api/main.go | 13 +- agent/pkg/api/socket_data_streamer.go | 6 +- agent/pkg/app/main.go | 2 +- agent/pkg/controllers/entries_controller.go | 3 +- agent/pkg/entries/entries_provider.go | 4 +- agent/pkg/models/models.go | 2 +- agent/pkg/oas/feeder_test.go | 7 +- agent/pkg/oas/oas-samples/carts.json | 96 + agent/pkg/oas/oas-samples/catalogue.json | 485 +++++ agent/pkg/oas/oas-samples/httpbin.org.json | 897 +++++++++ .../pkg/oas/oas-samples/trcc-api-service.json | 1787 +++++++++++++++++ agent/pkg/oas/oas_generator.go | 37 +- agent/pkg/oas/oas_generator_test.go | 4 + agent/pkg/oas/specgen.go | 21 +- .../oas/test_artifacts/params.har.spec.json | 118 +- agent/pkg/oas/tree.go | 7 +- agent/pkg/oas/tree_test.go | 3 +- agent/pkg/oas/utils.go | 6 +- agent/pkg/oas/utils_test.go | 2 +- agent/pkg/up9/main.go | 4 +- cli/go.mod | 4 +- cli/go.sum | 8 +- tap/api/api.go | 4 +- .../components/TrafficViewer/EntriesList.tsx | 18 +- .../EntryListItem/EntryListItem.tsx | 6 +- .../TrafficViewer/TrafficViewer.tsx | 7 +- ui-common/src/hooks/useWS.tsx | 2 +- ui-common/src/recoil/leftOffTop/atom.ts | 2 +- 31 files changed, 3427 insertions(+), 138 deletions(-) create mode 100644 agent/pkg/oas/oas-samples/carts.json create mode 100644 agent/pkg/oas/oas-samples/catalogue.json create mode 100644 agent/pkg/oas/oas-samples/httpbin.org.json create mode 100644 agent/pkg/oas/oas-samples/trcc-api-service.json diff --git a/Dockerfile b/Dockerfile index cbf82e25f..1633cc49f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,8 +87,8 @@ RUN go build -ldflags="-extldflags=-static -s -w \ -X 'github.com/up9inc/mizu/agent/pkg/version.Ver=${VER}'" -o mizuagent . # Download Basenine executable, verify the sha1sum -ADD https://github.com/up9inc/basenine/releases/download/v0.6.6/basenine_linux_${GOARCH} ./basenine_linux_${GOARCH} -ADD https://github.com/up9inc/basenine/releases/download/v0.6.6/basenine_linux_${GOARCH}.sha256 ./basenine_linux_${GOARCH}.sha256 +ADD https://github.com/up9inc/basenine/releases/download/v0.7.1/basenine_linux_${GOARCH} ./basenine_linux_${GOARCH} +ADD https://github.com/up9inc/basenine/releases/download/v0.7.1/basenine_linux_${GOARCH}.sha256 ./basenine_linux_${GOARCH}.sha256 RUN shasum -a 256 -c basenine_linux_"${GOARCH}".sha256 && \ chmod +x ./basenine_linux_"${GOARCH}" && \ diff --git a/agent/go.mod b/agent/go.mod index 464e8937c..646efe7e1 100644 --- a/agent/go.mod +++ b/agent/go.mod @@ -21,7 +21,7 @@ require ( github.com/orcaman/concurrent-map v1.0.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/stretchr/testify v1.7.0 - github.com/up9inc/basenine/client/go v0.0.0-20220326121918-785f3061c8ce + github.com/up9inc/basenine/client/go v0.0.0-20220413023528-c741e4aa1cf2 github.com/up9inc/mizu/shared v0.0.0 github.com/up9inc/mizu/tap v0.0.0 github.com/up9inc/mizu/tap/api v0.0.0 diff --git a/agent/go.sum b/agent/go.sum index f9ccd9867..6ad179247 100644 --- a/agent/go.sum +++ b/agent/go.sum @@ -683,8 +683,8 @@ github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= -github.com/up9inc/basenine/client/go v0.0.0-20220326121918-785f3061c8ce h1:vMTCpKItc9OyTLJXocNaq2NcBU5EnurJgTVOYb8W8dw= -github.com/up9inc/basenine/client/go v0.0.0-20220326121918-785f3061c8ce/go.mod h1:SvJGPoa/6erhUQV7kvHBwM/0x5LyO6XaG2lUaCaKiUI= +github.com/up9inc/basenine/client/go v0.0.0-20220413023528-c741e4aa1cf2 h1:2Ol+X82EOLac/GGP/oB0ACVP/g2vIJrAuzCjZcn+RRI= +github.com/up9inc/basenine/client/go v0.0.0-20220413023528-c741e4aa1cf2/go.mod h1:SvJGPoa/6erhUQV7kvHBwM/0x5LyO6XaG2lUaCaKiUI= github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695APm9hlsSMoOoE65U4/TcqNj90mc69Rlg= github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/wI2L/jsondiff v0.1.1 h1:r2TkoEet7E4JMO5+s1RCY2R0LrNPNHY6hbDeow2hRHw= diff --git a/agent/pkg/api/main.go b/agent/pkg/api/main.go index af11980df..478c4b55e 100644 --- a/agent/pkg/api/main.go +++ b/agent/pkg/api/main.go @@ -5,13 +5,14 @@ import ( "context" "encoding/json" "fmt" - "github.com/up9inc/mizu/agent/pkg/models" "os" "path" "sort" "strings" "time" + "github.com/up9inc/mizu/agent/pkg/models" + "github.com/up9inc/mizu/agent/pkg/dependency" "github.com/up9inc/mizu/agent/pkg/elastic" "github.com/up9inc/mizu/agent/pkg/har" @@ -104,9 +105,11 @@ func startReadingChannel(outputItems <-chan *tapApi.OutputChannelItem, extension connection, err := basenine.NewConnection(shared.BasenineHost, shared.BaseninePort) if err != nil { - panic(err) + logger.Log.Panicf("Can't establish a new connection to Basenine server: %v", err) + } + if err = connection.InsertMode(); err != nil { + logger.Log.Panicf("Insert mode call failed: %v", err) } - connection.InsertMode() disableOASValidation := false ctx := context.Background() @@ -148,7 +151,9 @@ func startReadingChannel(outputItems <-chan *tapApi.OutputChannelItem, extension providers.EntryAdded(len(data)) - connection.SendText(string(data)) + if err = connection.SendText(string(data)); err != nil { + logger.Log.Panicf("An error occured while inserting a new record to database: %v", err) + } serviceMapGenerator := dependency.GetInstance(dependency.ServiceMapGeneratorDependency).(servicemap.ServiceMapSink) serviceMapGenerator.NewTCPEntry(mizuEntry.Source, mizuEntry.Destination, &item.Protocol) diff --git a/agent/pkg/api/socket_data_streamer.go b/agent/pkg/api/socket_data_streamer.go index 0fde336d5..a981b5449 100644 --- a/agent/pkg/api/socket_data_streamer.go +++ b/agent/pkg/api/socket_data_streamer.go @@ -49,7 +49,7 @@ func (e *BasenineEntryStreamer) Get(ctx context.Context, socketId int, params *W var entry *tapApi.Entry err = json.Unmarshal(bytes, &entry) if err != nil { - logger.Log.Debugf("error unmarshalling entry: %v", err.Error()) + logger.Log.Debugf("Error unmarshalling entry: %v", err.Error()) continue } @@ -79,7 +79,9 @@ func (e *BasenineEntryStreamer) Get(ctx context.Context, socketId int, params *W go handleDataChannel(connection, data) go handleMetaChannel(connection, meta) - connection.Query(query, data, meta) + if err = connection.Query(query, data, meta); err != nil { + logger.Log.Panicf("Query mode call failed: %v", err) + } go func() { <-ctx.Done() diff --git a/agent/pkg/app/main.go b/agent/pkg/app/main.go index b712fd7de..f7cbea9b4 100644 --- a/agent/pkg/app/main.go +++ b/agent/pkg/app/main.go @@ -67,7 +67,7 @@ func ConfigureBasenineServer(host string, port string, dbSize int64, logLevel lo wait.WithProto("tcp"), wait.WithWait(200*time.Millisecond), wait.WithBreak(50*time.Millisecond), - wait.WithDeadline(5*time.Second), + wait.WithDeadline(20*time.Second), wait.WithDebug(logLevel == logging.DEBUG), ).Do([]string{fmt.Sprintf("%s:%s", host, port)}) { logger.Log.Panicf("Basenine is not available!") diff --git a/agent/pkg/controllers/entries_controller.go b/agent/pkg/controllers/entries_controller.go index 8fbd9a328..ec41f18d2 100644 --- a/agent/pkg/controllers/entries_controller.go +++ b/agent/pkg/controllers/entries_controller.go @@ -2,7 +2,6 @@ package controllers import ( "net/http" - "strconv" "github.com/up9inc/mizu/agent/pkg/dependency" "github.com/up9inc/mizu/agent/pkg/entries" @@ -69,7 +68,7 @@ func GetEntry(c *gin.Context) { c.JSON(http.StatusBadRequest, validationError) } - id, _ := strconv.Atoi(c.Param("id")) + id := c.Param("id") entriesProvider := dependency.GetInstance(dependency.EntriesProvider).(entries.EntriesProvider) entry, err := entriesProvider.GetEntry(singleEntryRequest, id) diff --git a/agent/pkg/entries/entries_provider.go b/agent/pkg/entries/entries_provider.go index 61140d004..cb3afc1b5 100644 --- a/agent/pkg/entries/entries_provider.go +++ b/agent/pkg/entries/entries_provider.go @@ -15,7 +15,7 @@ import ( type EntriesProvider interface { GetEntries(entriesRequest *models.EntriesRequest) ([]*tapApi.EntryWrapper, *basenine.Metadata, error) - GetEntry(singleEntryRequest *models.SingleEntryRequest, entryId int) (*tapApi.EntryWrapper, error) + GetEntry(singleEntryRequest *models.SingleEntryRequest, entryId string) (*tapApi.EntryWrapper, error) } type BasenineEntriesProvider struct{} @@ -56,7 +56,7 @@ func (e *BasenineEntriesProvider) GetEntries(entriesRequest *models.EntriesReque return dataSlice, metadata, nil } -func (e *BasenineEntriesProvider) GetEntry(singleEntryRequest *models.SingleEntryRequest, entryId int) (*tapApi.EntryWrapper, error) { +func (e *BasenineEntriesProvider) GetEntry(singleEntryRequest *models.SingleEntryRequest, entryId string) (*tapApi.EntryWrapper, error) { var entry *tapApi.Entry bytes, err := basenine.Single(shared.BasenineHost, shared.BaseninePort, entryId, singleEntryRequest.Query) if err != nil { diff --git a/agent/pkg/models/models.go b/agent/pkg/models/models.go index 2dc428f7a..ef7153101 100644 --- a/agent/pkg/models/models.go +++ b/agent/pkg/models/models.go @@ -13,7 +13,7 @@ import ( ) type EntriesRequest struct { - LeftOff int `form:"leftOff" validate:"required,min=-1"` + LeftOff string `form:"leftOff" validate:"required"` Direction int `form:"direction" validate:"required,oneof='1' '-1'"` Query string `form:"query"` Limit int `form:"limit" validate:"required,min=1"` diff --git a/agent/pkg/oas/feeder_test.go b/agent/pkg/oas/feeder_test.go index f5611e5a6..616e1e1d1 100644 --- a/agent/pkg/oas/feeder_test.go +++ b/agent/pkg/oas/feeder_test.go @@ -4,6 +4,7 @@ import ( "bufio" "encoding/json" "errors" + "fmt" "io" "io/ioutil" "net/url" @@ -124,13 +125,13 @@ func feedFromHAR(file string, isSync bool, gen *defaultOasGenerator) (uint, erro cnt := uint(0) for _, entry := range harDoc.Log.Entries { cnt += 1 - feedEntry(&entry, "", file, gen, cnt) + feedEntry(&entry, "", file, gen, fmt.Sprintf("%024d", cnt)) } return cnt, nil } -func feedEntry(entry *har.Entry, source string, file string, gen *defaultOasGenerator, cnt uint) { +func feedEntry(entry *har.Entry, source string, file string, gen *defaultOasGenerator, cnt string) { entry.Comment = file if entry.Response.Status == 302 { logger.Log.Debugf("Dropped traffic entry due to permanent redirect status: %s", entry.StartedDateTime) @@ -192,7 +193,7 @@ func feedFromLDJSON(file string, isSync bool, gen *defaultOasGenerator) (uint, e logger.Log.Warningf("Failed decoding entry: %s", line) } else { cnt += 1 - feedEntry(&entry, source, file, gen, cnt) + feedEntry(&entry, source, file, gen, fmt.Sprintf("%024d", cnt)) } } } diff --git a/agent/pkg/oas/oas-samples/carts.json b/agent/pkg/oas/oas-samples/carts.json new file mode 100644 index 000000000..bf8768ff5 --- /dev/null +++ b/agent/pkg/oas/oas-samples/carts.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "http://carts", + "description": "Mizu observed 3 entries (0 failed), at 2.287 hits/s, average response time is 0.017 seconds", + "version": "1.0" + }, + "servers": [ + { + "url": "http://carts" + } + ], + "paths": { + "/carts/{cartId}/items": { + "get": { + "summary": "/carts/{cartId}/items", + "description": "Mizu observed 3 entries (0 failed), at 2.287 hits/s, average response time is 0.017 seconds", + "operationId": "84c9b926-1f73-4ab4-b381-3c124528959f", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [ + { + "id": "60fe98fb86c0fc000869a90c", + "itemId": "3395a43e-2d88-40de-b95f-e00e1502085b", + "quantity": 1, + "unitPrice": 18 + } + ], + "x-sample-entry": "000000000000000000000010" + } + }, + "x-sample-entry": "000000000000000000000010" + } + }, + "x-counters-per-source": { + "some-source": { + "entries": 3, + "failures": 0, + "firstSeen": 1627298058.3798368, + "lastSeen": 1627298065.2397773, + "sumRT": 0.05, + "sumDuration": 6.859940528869629 + } + }, + "x-counters-total": { + "entries": 3, + "failures": 0, + "firstSeen": 1627298058.3798368, + "lastSeen": 1627298065.2397773, + "sumRT": 0.05, + "sumDuration": 6.859940528869629 + }, + "x-last-seen-ts": 1627298065.2397773, + "x-sample-entry": "000000000000000000000010" + }, + "parameters": [ + { + "name": "cartId", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "mHK0P7zTktmV1zv57iWAvCTd43FFMHap" + } + }, + "x-sample-entry": "000000000000000000000010" + } + ] + } + }, + "x-counters-per-source": { + "some-source": { + "entries": 3, + "failures": 0, + "firstSeen": 1627298058.3798368, + "lastSeen": 1627298065.2397773, + "sumRT": 0.05, + "sumDuration": 6.859940528869629 + } + }, + "x-counters-total": { + "entries": 3, + "failures": 0, + "firstSeen": 1627298058.3798368, + "lastSeen": 1627298065.2397773, + "sumRT": 0.05, + "sumDuration": 6.859940528869629 + } +} \ No newline at end of file diff --git a/agent/pkg/oas/oas-samples/catalogue.json b/agent/pkg/oas/oas-samples/catalogue.json new file mode 100644 index 000000000..c64b2335e --- /dev/null +++ b/agent/pkg/oas/oas-samples/catalogue.json @@ -0,0 +1,485 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Preloaded", + "description": "Test file for loading pre-existing OAS", + "version": "0.1" + }, + "paths": { + "/catalogue": { + "get": { + "tags": [ + "catalogue" + ], + "summary": "/catalogue", + "description": "Mizu observed 3 entries (0 failed), at 2.647 hits/s, average response time is 0.008 seconds", + "operationId": "dd6c3dbe-6b6b-4ddd-baed-757e237ddb8a", + "parameters": [ + { + "name": "page", + "in": "query", + "required": false, + "style": "form", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "1" + } + }, + "x-sample-entry": "000000000000000000000002" + }, + { + "name": "size", + "in": "query", + "required": true, + "style": "form", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "6" + }, + "example #1": { + "value": "3" + }, + "example #2": { + "value": "5" + } + }, + "x-sample-entry": "000000000000000000000011" + }, + { + "name": "tags", + "in": "query", + "required": false, + "style": "form", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "" + }, + "example #1": { + "value": "blue" + } + }, + "x-sample-entry": "000000000000000000000007" + }, + { + "name": "sort", + "in": "query", + "required": false, + "style": "form", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "id" + } + }, + "x-sample-entry": "000000000000000000000007" + } + ], + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [ + { + "count": 1, + "description": "Socks fit for a Messiah. You too can experience walking in water with these special edition beauties. Each hole is lovingly proggled to leave smooth edges. The only sock approved by a higher power.", + "id": "03fef6ac-1896-4ce8-bd69-b798f85c6e0b", + "imageUrl": [ + "/catalogue/images/holy_1.jpeg", + "/catalogue/images/holy_2.jpeg" + ], + "name": "Holy", + "price": 99.99, + "tag": [ + "action", + "magic" + ] + }, + { + "count": 438, + "description": "proident occaecat irure et excepteur labore minim nisi amet irure", + "id": "3395a43e-2d88-40de-b95f-e00e1502085b", + "imageUrl": [ + "/catalogue/images/colourful_socks.jpg", + "/catalogue/images/colourful_socks.jpg" + ], + "name": "Colourful", + "price": 18, + "tag": [ + "brown", + "blue" + ] + }, + { + "count": 820, + "description": "Ready for action. Engineers: be ready to smash that next bug! Be ready, with these super-action-sport-masterpieces. This particular engineer was chased away from the office with a stick.", + "id": "510a0d7e-8e83-4193-b483-e27e09ddc34d", + "imageUrl": [ + "/catalogue/images/puma_1.jpeg", + "/catalogue/images/puma_2.jpeg" + ], + "name": "SuperSport XL", + "price": 15, + "tag": [ + "sport", + "formal", + "black" + ] + }, + { + "count": 738, + "description": "A mature sock, crossed, with an air of nonchalance.", + "id": "808a2de1-1aaa-4c25-a9b9-6612e8f29a38", + "imageUrl": [ + "/catalogue/images/cross_1.jpeg", + "/catalogue/images/cross_2.jpeg" + ], + "name": "Crossed", + "price": 17.32, + "tag": [ + "blue", + "action", + "red", + "formal" + ] + }, + { + "count": 808, + "description": "enim officia aliqua excepteur esse deserunt quis aliquip nostrud anim", + "id": "819e1fbf-8b7e-4f6d-811f-693534916a8b", + "imageUrl": [ + "/catalogue/images/WAT.jpg", + "/catalogue/images/WAT2.jpg" + ], + "name": "Figueroa", + "price": 14, + "tag": [ + "green", + "formal", + "blue" + ] + }, + { + "count": 175, + "description": "consequat amet cupidatat minim laborum tempor elit ex consequat in", + "id": "837ab141-399e-4c1f-9abc-bace40296bac", + "imageUrl": [ + "/catalogue/images/catsocks.jpg", + "/catalogue/images/catsocks2.jpg" + ], + "name": "Cat socks", + "price": 15, + "tag": [ + "brown", + "formal", + "green" + ] + } + ], + "x-sample-entry": "000000000000000000000011" + } + }, + "x-sample-entry": "000000000000000000000011" + } + }, + "x-counters-per-source": { + "some-source": { + "entries": 3, + "failures": 0, + "firstSeen": 1627298057.7849188, + "lastSeen": 1627298065.7258668, + "sumRT": 0.024999999999999998, + "sumDuration": 7.940948009490967 + } + }, + "x-counters-total": { + "entries": 3, + "failures": 0, + "firstSeen": 1627298057.7849188, + "lastSeen": 1627298065.7258668, + "sumRT": 0.024999999999999998, + "sumDuration": 7.940948009490967 + }, + "x-last-seen-ts": 1627298065.7258668, + "x-sample-entry": "000000000000000000000011" + } + }, + "/catalogue/size": { + "get": { + "tags": [ + "catalogue" + ], + "summary": "/catalogue/size", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.013 seconds", + "operationId": "2315e69d-9d66-48cf-b3d3-fec9c30bd28b", + "parameters": [ + { + "name": "tags", + "in": "query", + "required": true, + "style": "form", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "" + } + }, + "x-sample-entry": "000000000000000000000001" + }, + { + "name": "x-some", + "in": "header", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "demo val" + } + }, + "x-sample-entry": "000000000000000000000001" + } + ], + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": { + "err": null, + "size": 9 + }, + "x-sample-entry": "000000000000000000000001" + } + }, + "x-sample-entry": "000000000000000000000001" + } + }, + "x-counters-per-source": { + "some-source": { + "entries": 1, + "failures": 0, + "firstSeen": 1627298057.7841518, + "lastSeen": 1627298057.7841518, + "sumRT": 0.013, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1627298057.7841518, + "lastSeen": 1627298057.7841518, + "sumRT": 0.013, + "sumDuration": 0 + }, + "x-last-seen-ts": 1627298057.7841518, + "x-sample-entry": "000000000000000000000001" + } + }, + "/catalogue/{id}": { + "get": { + "tags": [ + "catalogue" + ], + "summary": "/catalogue/{id}", + "description": "Mizu observed 4 entries (0 failed), at 1.899 hits/s, average response time is 0.003 seconds", + "parameters": [ + { + "name": "non-required-header", + "in": "header", + "required": false, + "style": "simple", + "schema": { + "type": "string" + }, + "example": "some-uuid-maybe" + }, + { + "name": "x-some", + "in": "header", + "required": false, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "demoval" + } + }, + "x-sample-entry": "000000000000000000000004" + } + ], + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": { + "count": 438, + "description": "proident occaecat irure et excepteur labore minim nisi amet irure", + "id": "3395a43e-2d88-40de-b95f-e00e1502085b", + "imageUrl": [ + "/catalogue/images/colourful_socks.jpg", + "/catalogue/images/colourful_socks.jpg" + ], + "name": "Colourful", + "price": 18, + "tag": [ + "brown", + "blue" + ] + }, + "x-sample-entry": "000000000000000000000012" + } + }, + "x-sample-entry": "000000000000000000000012" + } + }, + "x-counters-per-source": { + "some-source": { + "entries": 4, + "failures": 0, + "firstSeen": 1627298058.1315014, + "lastSeen": 1627298065.7293031, + "sumRT": 0.013999999999999999, + "sumDuration": 7.597801685333252 + } + }, + "x-counters-total": { + "entries": 4, + "failures": 0, + "firstSeen": 1627298058.1315014, + "lastSeen": 1627298065.7293031, + "sumRT": 0.013999999999999999, + "sumDuration": 7.597801685333252 + }, + "x-last-seen-ts": 1627298065.7293031, + "x-sample-entry": "000000000000000000000012" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "3395a43e-2d88-40de-b95f-e00e1502085b" + }, + "example #1": { + "value": "808a2de1-1aaa-4c25-a9b9-6612e8f29a38" + } + }, + "example": "some-uuid-maybe", + "x-sample-entry": "000000000000000000000012" + } + ] + }, + "/catalogue/{id}/details": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "example": "some-uuid-maybe" + } + ] + }, + "/tags": { + "get": { + "summary": "/tags", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.007 seconds", + "operationId": "c4d7d0ed-1a78-4370-a049-efe3abc631a6", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": { + "err": null, + "tags": [ + "brown", + "geek", + "formal", + "blue", + "skin", + "red", + "action", + "sport", + "black", + "magic", + "green" + ] + }, + "x-sample-entry": "000000000000000000000003" + } + }, + "x-sample-entry": "000000000000000000000003" + } + }, + "x-counters-per-source": { + "some-source": { + "entries": 1, + "failures": 0, + "firstSeen": 1627298057.7841816, + "lastSeen": 1627298057.7841816, + "sumRT": 0.007, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1627298057.7841816, + "lastSeen": 1627298057.7841816, + "sumRT": 0.007, + "sumDuration": 0 + }, + "x-last-seen-ts": 1627298057.7841816, + "x-sample-entry": "000000000000000000000003" + } + } + }, + "x-counters-per-source": { + "some-source": { + "entries": 9, + "failures": 0, + "firstSeen": 1627298057.7841518, + "lastSeen": 1627298065.7293031, + "sumRT": 0.05899999999999999, + "sumDuration": 15.538749694824219 + } + }, + "x-counters-total": { + "entries": 9, + "failures": 0, + "firstSeen": 1627298057.7841518, + "lastSeen": 1627298065.7293031, + "sumRT": 0.05899999999999999, + "sumDuration": 15.538749694824219 + } +} \ No newline at end of file diff --git a/agent/pkg/oas/oas-samples/httpbin.org.json b/agent/pkg/oas/oas-samples/httpbin.org.json new file mode 100644 index 000000000..b6b6ece19 --- /dev/null +++ b/agent/pkg/oas/oas-samples/httpbin.org.json @@ -0,0 +1,897 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "https://httpbin.org", + "description": "Mizu observed 19 entries (0 failed), at 0.106 hits/s, average response time is 0.172 seconds", + "version": "1.0" + }, + "servers": [ + { + "url": "https://httpbin.org" + } + ], + "paths": { + "/appears-once": { + "get": { + "summary": "/appears-once", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", + "operationId": "2d34623e-fde8-4720-8390-9a7439051755", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": null, + "x-sample-entry": "000000000000000000000004" + } + }, + "x-sample-entry": "000000000000000000000004" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750580.0471218, + "lastSeen": 1567750580.0471218, + "sumRT": 0.63, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750580.0471218, + "lastSeen": 1567750580.0471218, + "sumRT": 0.63, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750580.0471218, + "x-sample-entry": "000000000000000000000004" + } + }, + "/appears-twice": { + "get": { + "summary": "/appears-twice", + "description": "Mizu observed 2 entries (0 failed), at 0.500 hits/s, average response time is 0.630 seconds", + "operationId": "9c5330f3-8062-468b-b5a3-df1ad82b4846", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": null, + "x-sample-entry": "000000000000000000000006" + } + }, + "x-sample-entry": "000000000000000000000006" + } + }, + "x-counters-per-source": { + "": { + "entries": 2, + "failures": 0, + "firstSeen": 1567750580.7471218, + "lastSeen": 1567750581.7471218, + "sumRT": 1.26, + "sumDuration": 1 + } + }, + "x-counters-total": { + "entries": 2, + "failures": 0, + "firstSeen": 1567750580.7471218, + "lastSeen": 1567750581.7471218, + "sumRT": 1.26, + "sumDuration": 1 + }, + "x-last-seen-ts": 1567750581.7471218, + "x-sample-entry": "000000000000000000000006" + } + }, + "/body-optional": { + "post": { + "summary": "/body-optional", + "description": "Mizu observed 3 entries (0 failed), at 0.003 hits/s, average response time is 0.001 seconds", + "operationId": "34f3d66c-b1f7-4dca-9cab-987fcc8ae472", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000012" + } + }, + "x-sample-entry": "000000000000000000000012" + } + }, + "x-counters-per-source": { + "": { + "entries": 3, + "failures": 0, + "firstSeen": 1567750581.7471218, + "lastSeen": 1567750581.757122, + "sumRT": 0.003, + "sumDuration": 0.010000228881835938 + } + }, + "x-counters-total": { + "entries": 3, + "failures": 0, + "firstSeen": 1567750581.7471218, + "lastSeen": 1567750581.757122, + "sumRT": 0.003, + "sumDuration": 0.010000228881835938 + }, + "x-last-seen-ts": 1567750581.757122, + "x-sample-entry": "000000000000000000000012", + "requestBody": { + "description": "Generic request body", + "content": { + "application/json": { + "example": "{\"key\", \"val\"}", + "x-sample-entry": "000000000000000000000011" + } + }, + "x-sample-entry": "000000000000000000000012" + } + } + }, + "/body-required": { + "post": { + "summary": "/body-required", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "ff6add53-ab1c-4d4e-b590-0835fa318276", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000013" + } + }, + "x-sample-entry": "000000000000000000000013" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750581.757122, + "lastSeen": 1567750581.757122, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750581.757122, + "lastSeen": 1567750581.757122, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750581.757122, + "x-sample-entry": "000000000000000000000013", + "requestBody": { + "description": "Generic request body", + "content": { + "": { + "example": "body exists", + "x-sample-entry": "000000000000000000000013" + } + }, + "required": true, + "x-sample-entry": "000000000000000000000013" + } + } + }, + "/form-multipart": { + "post": { + "summary": "/form-multipart", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "153f0925-9fc7-4e9f-9d33-f1470f25f0f7", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "example": {}, + "x-sample-entry": "000000000000000000000009" + } + }, + "x-sample-entry": "000000000000000000000009" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.7471218, + "lastSeen": 1567750582.7471218, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.7471218, + "lastSeen": 1567750582.7471218, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750582.7471218, + "x-sample-entry": "000000000000000000000009", + "requestBody": { + "description": "Generic request body", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "required": [ + "file", + "path" + ], + "properties": { + "file": { + "type": "string", + "contentMediaType": "application/json", + "examples": [ + "{\"functions\": 123}" + ] + }, + "path": { + "type": "string", + "examples": [ + "/content/components" + ] + } + } + }, + "example": "--BOUNDARY\r\nContent-Disposition: form-data; name=\"file\"; filename=\"metadata.json\"\r\nContent-Type: application/json\r\n\r\n{\"functions\": 123}\r\n--BOUNDARY\r\nContent-Disposition: form-data; name=\"path\"\r\n\r\n/content/components\r\n--BOUNDARY--\r\n", + "x-sample-entry": "000000000000000000000009" + } + }, + "required": true, + "x-sample-entry": "000000000000000000000009" + } + } + }, + "/form-urlencoded": { + "post": { + "summary": "/form-urlencoded", + "description": "Mizu observed 2 entries (0 failed), at 0.500 hits/s, average response time is 0.001 seconds", + "operationId": "c92189f5-5636-46eb-ac71-92b17941a568", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000008" + } + }, + "x-sample-entry": "000000000000000000000008" + } + }, + "x-counters-per-source": { + "": { + "entries": 2, + "failures": 0, + "firstSeen": 1567750580.7471218, + "lastSeen": 1567750581.7471218, + "sumRT": 0.002, + "sumDuration": 1 + } + }, + "x-counters-total": { + "entries": 2, + "failures": 0, + "firstSeen": 1567750580.7471218, + "lastSeen": 1567750581.7471218, + "sumRT": 0.002, + "sumDuration": 1 + }, + "x-last-seen-ts": 1567750581.7471218, + "x-sample-entry": "000000000000000000000008", + "requestBody": { + "description": "Generic request body", + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": [ + "agent-id", + "callback-url", + "token" + ], + "properties": { + "agent-id": { + "type": "string", + "examples": [ + "ade" + ] + }, + "callback-url": { + "type": "string", + "examples": [ + "" + ] + }, + "optional": { + "type": "string", + "examples": [ + "another" + ] + }, + "token": { + "type": "string", + "examples": [ + "sometoken", + "sometoken-second-val" + ] + } + } + }, + "example": "agent-id=ade\u0026callback-url=\u0026token=sometoken", + "x-sample-entry": "000000000000000000000008" + } + }, + "required": true, + "x-sample-entry": "000000000000000000000008" + } + } + }, + "/param-patterns/prefix-gibberish-fine/{prefixgibberishfineId}": { + "get": { + "tags": [ + "param-patterns" + ], + "summary": "/param-patterns/prefix-gibberish-fine/{prefixgibberishfineId}", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "85270437-7aae-4a5b-b988-3662092463d0", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000014" + } + }, + "x-sample-entry": "000000000000000000000014" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582, + "lastSeen": 1567750582, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582, + "lastSeen": 1567750582, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750582, + "x-sample-entry": "000000000000000000000014" + }, + "parameters": [ + { + "name": "prefixgibberishfineId", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "234324" + } + }, + "x-sample-entry": "000000000000000000000014" + } + ] + }, + "/param-patterns/{parampatternId}": { + "get": { + "tags": [ + "param-patterns" + ], + "summary": "/param-patterns/{parampatternId}", + "description": "Mizu observed 2 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "da597734-1cf5-4d3b-917b-6b02dacf7b7b", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000018" + } + }, + "x-sample-entry": "000000000000000000000018" + } + }, + "x-counters-per-source": { + "": { + "entries": 2, + "failures": 0, + "firstSeen": 1567750582.000003, + "lastSeen": 1567750582.000004, + "sumRT": 0.002, + "sumDuration": 9.5367431640625e-7 + } + }, + "x-counters-total": { + "entries": 2, + "failures": 0, + "firstSeen": 1567750582.000003, + "lastSeen": 1567750582.000004, + "sumRT": 0.002, + "sumDuration": 9.5367431640625e-7 + }, + "x-last-seen-ts": 1567750582.000004, + "x-sample-entry": "000000000000000000000018" + }, + "parameters": [ + { + "name": "parampatternId", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": "^prefix-gibberish-.+" + }, + "examples": { + "example #0": { + "value": "prefix-gibberish-sfdlasdfkadf87sd93284q24r" + }, + "example #1": { + "value": "prefix-gibberish-adslkfasdf89sa7dfasddafa8a98sd7kansdf" + }, + "example #2": { + "value": "prefix-gibberish-4jk5l2345h2452l4352435jlk45" + }, + "example #3": { + "value": "prefix-gibberish-84395h2j4k35hj243j5h2kl34h54k" + }, + "example #4": { + "value": "prefix-gibberish-afterwards" + } + }, + "x-sample-entry": "000000000000000000000019" + } + ] + }, + "/param-patterns/{parampatternId}/1": { + "get": { + "tags": [ + "param-patterns" + ], + "summary": "/param-patterns/{parampatternId}/1", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "e965a245-9cfc-48ed-94e1-f765eadb3960", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000015" + } + }, + "x-sample-entry": "000000000000000000000015" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.000001, + "lastSeen": 1567750582.000001, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.000001, + "lastSeen": 1567750582.000001, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750582.000001, + "x-sample-entry": "000000000000000000000015" + }, + "parameters": [ + { + "name": "parampatternId", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": "^prefix-gibberish-.+" + }, + "examples": { + "example #0": { + "value": "prefix-gibberish-sfdlasdfkadf87sd93284q24r" + }, + "example #1": { + "value": "prefix-gibberish-adslkfasdf89sa7dfasddafa8a98sd7kansdf" + }, + "example #2": { + "value": "prefix-gibberish-4jk5l2345h2452l4352435jlk45" + }, + "example #3": { + "value": "prefix-gibberish-84395h2j4k35hj243j5h2kl34h54k" + }, + "example #4": { + "value": "prefix-gibberish-afterwards" + } + }, + "x-sample-entry": "000000000000000000000019" + } + ] + }, + "/param-patterns/{parampatternId}/static": { + "get": { + "tags": [ + "param-patterns" + ], + "summary": "/param-patterns/{parampatternId}/static", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "7af420dc-f8b7-450f-8f6f-18b039aa3cde", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000016" + } + }, + "x-sample-entry": "000000000000000000000016" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.000002, + "lastSeen": 1567750582.000002, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.000002, + "lastSeen": 1567750582.000002, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750582.000002, + "x-sample-entry": "000000000000000000000016" + }, + "parameters": [ + { + "name": "parampatternId", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": "^prefix-gibberish-.+" + }, + "examples": { + "example #0": { + "value": "prefix-gibberish-sfdlasdfkadf87sd93284q24r" + }, + "example #1": { + "value": "prefix-gibberish-adslkfasdf89sa7dfasddafa8a98sd7kansdf" + }, + "example #2": { + "value": "prefix-gibberish-4jk5l2345h2452l4352435jlk45" + }, + "example #3": { + "value": "prefix-gibberish-84395h2j4k35hj243j5h2kl34h54k" + }, + "example #4": { + "value": "prefix-gibberish-afterwards" + } + }, + "x-sample-entry": "000000000000000000000019" + } + ] + }, + "/param-patterns/{parampatternId}/{param1}": { + "get": { + "tags": [ + "param-patterns" + ], + "summary": "/param-patterns/{parampatternId}/{param1}", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "02a1771d-2d50-4a8c-8be2-29c7e59b8435", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "": { + "x-sample-entry": "000000000000000000000019" + } + }, + "x-sample-entry": "000000000000000000000019" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.000002, + "lastSeen": 1567750582.000002, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750582.000002, + "lastSeen": 1567750582.000002, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750582.000002, + "x-sample-entry": "000000000000000000000019" + }, + "parameters": [ + { + "name": "param1", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "23421" + } + }, + "x-sample-entry": "000000000000000000000019" + }, + { + "name": "parampatternId", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": "^prefix-gibberish-.+" + }, + "examples": { + "example #0": { + "value": "prefix-gibberish-sfdlasdfkadf87sd93284q24r" + }, + "example #1": { + "value": "prefix-gibberish-adslkfasdf89sa7dfasddafa8a98sd7kansdf" + }, + "example #2": { + "value": "prefix-gibberish-4jk5l2345h2452l4352435jlk45" + }, + "example #3": { + "value": "prefix-gibberish-84395h2j4k35hj243j5h2kl34h54k" + }, + "example #4": { + "value": "prefix-gibberish-afterwards" + } + }, + "x-sample-entry": "000000000000000000000019" + } + ] + }, + "/{Id}": { + "get": { + "summary": "/{Id}", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", + "operationId": "77ec4910-d47a-46a5-8234-fb80a11034b4", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": null, + "x-sample-entry": "000000000000000000000003" + } + }, + "x-sample-entry": "000000000000000000000003" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750579.7471218, + "lastSeen": 1567750579.7471218, + "sumRT": 0.63, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750579.7471218, + "lastSeen": 1567750579.7471218, + "sumRT": 0.63, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750579.7471218, + "x-sample-entry": "000000000000000000000003" + }, + "parameters": [ + { + "name": "Id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "e21f7112-3d3b-4632-9da3-a4af2e0e9166" + }, + "example #1": { + "value": "952bea17-3776-11ea-9341-42010a84012a" + } + }, + "x-sample-entry": "000000000000000000000003" + } + ] + }, + "/{Id}/sub1": { + "get": { + "summary": "/{Id}/sub1", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.111 seconds", + "operationId": "198675eb-9faf-407b-83fa-0483a730bbbe", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "text/html": { + "x-sample-entry": "000000000000000000000001" + } + }, + "x-sample-entry": "000000000000000000000001" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750483.864529, + "lastSeen": 1567750483.864529, + "sumRT": 0.111, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750483.864529, + "lastSeen": 1567750483.864529, + "sumRT": 0.111, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750483.864529, + "x-sample-entry": "000000000000000000000001" + }, + "parameters": [ + { + "name": "Id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "e21f7112-3d3b-4632-9da3-a4af2e0e9166" + }, + "example #1": { + "value": "952bea17-3776-11ea-9341-42010a84012a" + } + }, + "x-sample-entry": "000000000000000000000003" + } + ] + }, + "/{Id}/sub2": { + "get": { + "summary": "/{Id}/sub2", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", + "operationId": "31d880f1-152f-4dd6-84a7-463e13b694a5", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": null, + "x-sample-entry": "000000000000000000000002" + } + }, + "x-sample-entry": "000000000000000000000002" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750578.7471218, + "lastSeen": 1567750578.7471218, + "sumRT": 0.63, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1567750578.7471218, + "lastSeen": 1567750578.7471218, + "sumRT": 0.63, + "sumDuration": 0 + }, + "x-last-seen-ts": 1567750578.7471218, + "x-sample-entry": "000000000000000000000002" + }, + "parameters": [ + { + "name": "Id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "e21f7112-3d3b-4632-9da3-a4af2e0e9166" + }, + "example #1": { + "value": "952bea17-3776-11ea-9341-42010a84012a" + } + }, + "x-sample-entry": "000000000000000000000003" + } + ] + } + }, + "x-counters-per-source": { + "": { + "entries": 19, + "failures": 0, + "firstSeen": 1567750483.864529, + "lastSeen": 1567750582.7471218, + "sumRT": 3.273999999999999, + "sumDuration": 2.0100011825561523 + } + }, + "x-counters-total": { + "entries": 19, + "failures": 0, + "firstSeen": 1567750483.864529, + "lastSeen": 1567750582.7471218, + "sumRT": 3.273999999999999, + "sumDuration": 2.0100011825561523 + } +} \ No newline at end of file diff --git a/agent/pkg/oas/oas-samples/trcc-api-service.json b/agent/pkg/oas/oas-samples/trcc-api-service.json new file mode 100644 index 000000000..982e95fec --- /dev/null +++ b/agent/pkg/oas/oas-samples/trcc-api-service.json @@ -0,0 +1,1787 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Preloaded TRCC", + "description": "Test file for loading pre-existing OAS", + "version": "0.1" + }, + "paths": { + "/hc": { + "get": { + "summary": "/hc", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "c9fdb168-cd8a-48d2-ac37-887ddadb810c", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "text/html": { + "example": "healthy", + "x-sample-entry": "000000000000000000000035" + } + }, + "x-sample-entry": "000000000000000000000035" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058951.273, + "lastSeen": 1590058951.273, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058951.273, + "lastSeen": 1590058951.273, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1590058951.273, + "x-sample-entry": "000000000000000000000035" + } + }, + "/models/aaa/blacklist": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/aaa/blacklist", + "description": "Mizu observed 2 entries (0 failed), at 0.420 hits/s, average response time is 0.002 seconds", + "operationId": "aa04b7c2-11fc-49bd-86b5-fec0a336216d", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [], + "x-sample-entry": "000000000000000000000121" + } + }, + "x-sample-entry": "000000000000000000000121" + } + }, + "x-counters-per-source": { + "": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058951.864, + "lastSeen": 1590058952.705, + "sumRT": 0.003, + "sumDuration": 0.8409998416900635 + } + }, + "x-counters-total": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058951.864, + "lastSeen": 1590058952.705, + "sumRT": 0.003, + "sumDuration": 0.8409998416900635 + }, + "x-last-seen-ts": 1590058952.705, + "x-sample-entry": "000000000000000000000121" + } + }, + "/models/andrey2/blacklist": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/andrey2/blacklist", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "a61a1b56-7205-4246-99de-baec013a53d9", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [], + "x-sample-entry": "000000000000000000000127" + } + }, + "x-sample-entry": "000000000000000000000127" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058953.215, + "lastSeen": 1590058953.215, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058953.215, + "lastSeen": 1590058953.215, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1590058953.215, + "x-sample-entry": "000000000000000000000127" + } + }, + "/models/default/blacklist": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/default/blacklist", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "371ca033-3863-4546-bc7e-03b291a7a188", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [], + "x-sample-entry": "000000000000000000000107" + } + }, + "x-sample-entry": "000000000000000000000107" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058952.452, + "lastSeen": 1590058952.452, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058952.452, + "lastSeen": 1590058952.452, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1590058952.452, + "x-sample-entry": "000000000000000000000107" + } + }, + "/models/roee/blacklist": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/roee/blacklist", + "description": "Mizu observed 2 entries (0 failed), at 0.211 hits/s, average response time is 0.001 seconds", + "operationId": "fba33b70-58d1-43e4-9223-38e854e78a77", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [], + "x-sample-entry": "000000000000000000000101" + } + }, + "x-sample-entry": "000000000000000000000101" + } + }, + "x-counters-per-source": { + "": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058952.027, + "lastSeen": 1590058952.4499998, + "sumRT": 0.002, + "sumDuration": 0.42299985885620117 + } + }, + "x-counters-total": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058952.027, + "lastSeen": 1590058952.4499998, + "sumRT": 0.002, + "sumDuration": 0.42299985885620117 + }, + "x-last-seen-ts": 1590058952.4499998, + "x-sample-entry": "000000000000000000000101" + } + }, + "/models/roee/status": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/roee/status", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "operationId": "0653c2af-ef3f-43cd-b7e1-48f951d34fa2", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": { + "errorCount": 0, + "lastMajorGeneration": 1589448081.392, + "lastSuccessfulGeneration": 1589448081.392 + }, + "x-sample-entry": "000000000000000000000133" + } + }, + "x-sample-entry": "000000000000000000000133" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058953.303, + "lastSeen": 1590058953.303, + "sumRT": 0.001, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058953.303, + "lastSeen": 1590058953.303, + "sumRT": 0.001, + "sumDuration": 0 + }, + "x-last-seen-ts": 1590058953.303, + "x-sample-entry": "000000000000000000000133" + } + }, + "/models/{id}": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": ".+(_|-|\\.).+" + }, + "examples": { + "example #0": { + "value": "aws_kong5" + }, + "example #1": { + "value": "liraz_test_2105" + }, + "example #2": { + "value": "ah.trdemo.0511" + }, + "example #3": { + "value": "ngm-1205-aws-no-tapper-04" + }, + "example #4": { + "value": "rami-endpoints" + } + }, + "example": "some-uuid-maybe", + "x-sample-entry": "000000000000000000000148" + } + ] + }, + "/models/{id}/blacklist": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/{id}/blacklist", + "description": "Mizu observed 39 entries (0 failed), at 0.078 hits/s, average response time is 0.001 seconds", + "operationId": "ce1b76bc-9bff-4438-a21d-0a7a6e5be503", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [], + "x-sample-entry": "000000000000000000000124" + } + }, + "x-sample-entry": "000000000000000000000124" + } + }, + "x-counters-per-source": { + "": { + "entries": 39, + "failures": 0, + "firstSeen": 1590058950.313, + "lastSeen": 1590058953.212, + "sumRT": 0.052000000000000025, + "sumDuration": 3.057999849319458 + } + }, + "x-counters-total": { + "entries": 39, + "failures": 0, + "firstSeen": 1590058950.313, + "lastSeen": 1590058953.212, + "sumRT": 0.052000000000000025, + "sumDuration": 3.057999849319458 + }, + "x-last-seen-ts": 1590058953.212, + "x-sample-entry": "000000000000000000000124" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": ".+(_|-|\\.).+" + }, + "examples": { + "example #0": { + "value": "aws_kong5" + }, + "example #1": { + "value": "liraz_test_2105" + }, + "example #2": { + "value": "ah.trdemo.0511" + }, + "example #3": { + "value": "ngm-1205-aws-no-tapper-04" + }, + "example #4": { + "value": "rami-endpoints" + } + }, + "example": "some-uuid-maybe", + "x-sample-entry": "000000000000000000000148" + } + ] + }, + "/models/{id}/status": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/{id}/status", + "description": "Mizu observed 7 entries (0 failed), at 0.543 hits/s, average response time is 0.193 seconds", + "operationId": "2c46cc41-1ec7-4636-b97e-13e4a7296c65", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [], + "x-sample-entry": "000000000000000000000146" + } + }, + "x-sample-entry": "000000000000000000000146" + } + }, + "x-counters-per-source": { + "": { + "entries": 7, + "failures": 0, + "firstSeen": 1590058950.3100002, + "lastSeen": 1590058953.9500003, + "sumRT": 1.3519999999999996, + "sumDuration": 3.8000001907348633 + } + }, + "x-counters-total": { + "entries": 7, + "failures": 0, + "firstSeen": 1590058950.3100002, + "lastSeen": 1590058953.9500003, + "sumRT": 1.3519999999999996, + "sumDuration": 3.8000001907348633 + }, + "x-last-seen-ts": 1590058953.9500003, + "x-sample-entry": "000000000000000000000146" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": ".+(_|-|\\.).+" + }, + "examples": { + "example #0": { + "value": "aws_kong5" + }, + "example #1": { + "value": "liraz_test_2105" + }, + "example #2": { + "value": "ah.trdemo.0511" + }, + "example #3": { + "value": "ngm-1205-aws-no-tapper-04" + }, + "example #4": { + "value": "rami-endpoints" + } + }, + "example": "some-uuid-maybe", + "x-sample-entry": "000000000000000000000148" + } + ] + }, + "/models/{id}/suites/all/runs": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/{id}/suites/all/runs", + "description": "Mizu observed 69 entries (0 failed), at 0.093 hits/s, average response time is 0.029 seconds", + "operationId": "6776caf3-87e7-4515-899d-4d4d6cfc0bb8", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [], + "x-sample-entry": "000000000000000000000148" + }, + "text/html": { + "x-sample-entry": "000000000000000000000104" + } + }, + "x-sample-entry": "000000000000000000000148" + } + }, + "x-counters-per-source": { + "": { + "entries": 69, + "failures": 0, + "firstSeen": 1590058949.277, + "lastSeen": 1590058953.952, + "sumRT": 2.013999999999998, + "sumDuration": 6.393998861312866 + } + }, + "x-counters-total": { + "entries": 69, + "failures": 0, + "firstSeen": 1590058949.277, + "lastSeen": 1590058953.952, + "sumRT": 2.013999999999998, + "sumDuration": 6.393998861312866 + }, + "x-last-seen-ts": 1590058953.952, + "x-sample-entry": "000000000000000000000148" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": ".+(_|-|\\.).+" + }, + "examples": { + "example #0": { + "value": "aws_kong5" + }, + "example #1": { + "value": "liraz_test_2105" + }, + "example #2": { + "value": "ah.trdemo.0511" + }, + "example #3": { + "value": "ngm-1205-aws-no-tapper-04" + }, + "example #4": { + "value": "rami-endpoints" + } + }, + "example": "some-uuid-maybe", + "x-sample-entry": "000000000000000000000148" + } + ] + }, + "/models/{id}/suites/all/runs/state": { + "get": { + "tags": [ + "models" + ], + "summary": "/models/{id}/suites/all/runs/state", + "description": "Mizu observed 2 entries (0 failed), at 0.997 hits/s, average response time is 0.514 seconds", + "operationId": "fe8186fa-b221-46e1-8130-9be1f00a7c2d", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": { + "errorCount": 0, + "lastMajorGeneration": -1, + "lastSuccessfulGeneration": -1 + }, + "x-sample-entry": "000000000000000000000042" + } + }, + "x-sample-entry": "000000000000000000000042" + } + }, + "x-counters-per-source": { + "": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058949.2819998, + "lastSeen": 1590058951.275, + "sumRT": 1.029, + "sumDuration": 1.9930002689361572 + } + }, + "x-counters-total": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058949.2819998, + "lastSeen": 1590058951.275, + "sumRT": 1.029, + "sumDuration": 1.9930002689361572 + }, + "x-last-seen-ts": 1590058951.275, + "x-sample-entry": "000000000000000000000042" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": ".+(_|-|\\.).+" + }, + "examples": { + "example #0": { + "value": "aws_kong5" + }, + "example #1": { + "value": "liraz_test_2105" + }, + "example #2": { + "value": "ah.trdemo.0511" + }, + "example #3": { + "value": "ngm-1205-aws-no-tapper-04" + }, + "example #4": { + "value": "rami-endpoints" + } + }, + "example": "some-uuid-maybe", + "x-sample-entry": "000000000000000000000148" + } + ] + }, + "/models/{id}/{id2}": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": ".+(_|-|\\.).+" + }, + "example": "some-uuid-maybe" + }, + { + "name": "id2", + "in": "path", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "pattern": "\\d+" + } + } + ] + }, + "/proxies": { + "get": { + "tags": [ + "proxies" + ], + "summary": "/proxies", + "description": "Mizu observed 2 entries (0 failed), at 1.587 hits/s, average response time is 0.386 seconds", + "operationId": "bff7bf3e-effa-43ad-8fce-bab2847a77aa", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": { + "createDate": "2020-05-21T10:45:02+00:00", + "idleSince": "2020-05-21T10:51:26.131837", + "modelId": null, + "orgId": "someOrgId123", + "password": "anna", + "proxyId": "lirazyup9com-prx1", + "status": "idle", + "urls": {}, + "userName": "proxy" + }, + "x-sample-entry": "000000000000000000000140" + } + }, + "x-sample-entry": "000000000000000000000140" + } + }, + "x-counters-per-source": { + "": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058949.2780004, + "lastSeen": 1590058952.452, + "sumRT": 0.771, + "sumDuration": 3.173999547958374 + } + }, + "x-counters-total": { + "entries": 2, + "failures": 0, + "firstSeen": 1590058949.2780004, + "lastSeen": 1590058952.452, + "sumRT": 0.771, + "sumDuration": 3.173999547958374 + }, + "x-last-seen-ts": 1590058952.452, + "x-sample-entry": "000000000000000000000140" + } + }, + "/proxies/": { + "get": { + "tags": [ + "proxies" + ], + "summary": "/proxies/", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 1.022 seconds", + "operationId": "9c12fbeb-b4cd-40a7-8962-5b9b01619a8e", + "parameters": [ + { + "name": "x-custom-demo-header", + "in": "header", + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "demo" + } + }, + "x-sample-entry": "000000000000000000000001" + } + ], + "responses": { + "200": { + "description": "Successful call with status 200", + "headers": { + "x-custom-demo-header2": { + "required": true, + "style": "simple", + "schema": { + "type": "string" + }, + "examples": { + "example #0": { + "value": "demo2" + } + }, + "x-sample-entry": "000000000000000000000001" + } + }, + "content": { + "application/json": { + "example": "null\n", + "x-sample-entry": "000000000000000000000001" + } + }, + "x-sample-entry": "000000000000000000000001" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058948.255, + "lastSeen": 1590058948.255, + "sumRT": 1.022, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058948.255, + "lastSeen": 1590058948.255, + "sumRT": 1.022, + "sumDuration": 0 + }, + "x-last-seen-ts": 1590058948.255, + "x-sample-entry": "000000000000000000000001" + } + }, + "/proxies/local": { + "get": { + "tags": [ + "proxies" + ], + "summary": "/proxies/local", + "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.610 seconds", + "operationId": "0f676cec-87ba-4a03-ac72-f48c3e90d5b8", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [ + { + "agentName": "ag6-minikube", + "creationTime": "Sun, 22 Mar 2020 22:11:55 GMT", + "id": "057573f3-c207-4d56-9512-3e1ff9190f53_trdemo_trdemo-client", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 22:45:55 GMT", + "model": "ag_trdemo_040701", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "ag6-minikube", + "creationTime": "Sun, 22 Mar 2020 22:11:55 GMT", + "id": "057573f3-c207-4d56-9512-3e1ff9190f53_trdemo_trdemo-flights", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 22:45:55 GMT", + "model": "ag_trdemo_040701", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "ag6-minikube", + "creationTime": "Sun, 22 Mar 2020 22:11:55 GMT", + "id": "057573f3-c207-4d56-9512-3e1ff9190f53_trdemo_trdemo-shoppingcart", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 22:45:55 GMT", + "model": "ag_trdemo_040701", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "ag6-minikube", + "creationTime": "Sun, 22 Mar 2020 22:11:55 GMT", + "id": "057573f3-c207-4d56-9512-3e1ff9190f53_trdemo_trdemo-users", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 22:45:55 GMT", + "model": "ag_trdemo_040701", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-gcloud-mycluster", + "creationTime": "Sun, 19 Apr 2020 17:46:09 GMT", + "id": "0c484f93-5987-4e16-ac5d-ee838b8c7b65_tradmin_frontend-deployment", + "instancesCount": 0, + "lastSeen": "Mon, 20 Apr 2020 09:29:13 GMT", + "model": "default", + "shouldTap": false, + "type": "envoy" + }, + { + "agentName": "nimrod-gcloud-mycluster", + "creationTime": "Mon, 06 Apr 2020 06:50:47 GMT", + "id": "0c484f93-5987-4e16-ac5d-ee838b8c7b65_tradmin_trcc-api-deployment", + "instancesCount": 0, + "lastSeen": "Mon, 20 Apr 2020 09:29:13 GMT", + "model": "default", + "shouldTap": false, + "type": "envoy" + }, + { + "agentName": "nimrod-gcloud-mycluster", + "creationTime": null, + "id": "0c484f93-5987-4e16-ac5d-ee838b8c7b65_trdemo_trdemo-client", + "instancesCount": 0, + "lastSeen": "Mon, 20 Apr 2020 09:29:53 GMT", + "model": "ngm-0704-gcloud-05", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-gcloud-mycluster", + "creationTime": null, + "id": "0c484f93-5987-4e16-ac5d-ee838b8c7b65_trdemo_trdemo-flights", + "instancesCount": 0, + "lastSeen": "Mon, 20 Apr 2020 09:29:53 GMT", + "model": "ngm-0704-gcloud-05", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-gcloud-mycluster", + "creationTime": null, + "id": "0c484f93-5987-4e16-ac5d-ee838b8c7b65_trdemo_trdemo-shoppingcart", + "instancesCount": 0, + "lastSeen": "Tue, 07 Apr 2020 17:12:48 GMT", + "model": "ngm-0704-gcloud-05", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-gcloud-mycluster", + "creationTime": null, + "id": "0c484f93-5987-4e16-ac5d-ee838b8c7b65_trdemo_trdemo-users", + "instancesCount": 0, + "lastSeen": "Tue, 07 Apr 2020 17:12:48 GMT", + "model": "ngm-0704-gcloud-05", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-samcust1105", + "creationTime": "Thu, 23 Apr 2020 13:44:42 GMT", + "id": "2a45b7bd-3615-11ea-b692-42010a8400bd_trdemo_trdemo-client", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:32 GMT", + "model": "ah.trdemo.0513", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-samcust1105", + "creationTime": "Thu, 23 Apr 2020 13:44:42 GMT", + "id": "2a45b7bd-3615-11ea-b692-42010a8400bd_trdemo_trdemo-flights", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:32 GMT", + "model": "ah.trdemo.0513", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-samcust1105", + "creationTime": "Thu, 23 Apr 2020 13:44:42 GMT", + "id": "2a45b7bd-3615-11ea-b692-42010a8400bd_trdemo_trdemo-shoppingcart", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:32 GMT", + "model": "ah.trdemo.0513", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-samcust1105", + "creationTime": "Thu, 23 Apr 2020 13:44:35 GMT", + "id": "2a45b7bd-3615-11ea-b692-42010a8400bd_trdemo_trdemo-users", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:32 GMT", + "model": "ah.trdemo.0513", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "rami-aws-agent2", + "creationTime": "Thu, 14 May 2020 14:54:45 GMT", + "id": "6edcaf1b-f7f9-4dd7-ae4d-2443ab489213_trdemo_trdemo-client", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:28 GMT", + "model": "aws_services_envoy", + "shouldTap": true, + "type": "envoy" + }, + { + "agentName": "rami-aws-agent2", + "creationTime": "Thu, 14 May 2020 14:54:45 GMT", + "id": "6edcaf1b-f7f9-4dd7-ae4d-2443ab489213_trdemo_trdemo-flights", + "instancesCount": 2, + "lastSeen": "Thu, 21 May 2020 11:02:30 GMT", + "model": "aws_services_envoy", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "rami-aws-agent2", + "creationTime": "Thu, 14 May 2020 14:54:45 GMT", + "id": "6edcaf1b-f7f9-4dd7-ae4d-2443ab489213_trdemo_trdemo-shoppingcart", + "instancesCount": 2, + "lastSeen": "Thu, 21 May 2020 11:02:30 GMT", + "model": "aws_services_envoy", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "rami-aws-agent2", + "creationTime": "Thu, 14 May 2020 14:54:45 GMT", + "id": "6edcaf1b-f7f9-4dd7-ae4d-2443ab489213_trdemo_trdemo-users", + "instancesCount": 2, + "lastSeen": "Thu, 21 May 2020 11:02:30 GMT", + "model": "aws_services_envoy", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": null, + "creationTime": null, + "id": "alextestrio-prx1", + "instancesCount": 0, + "lastSeen": "Thu, 19 Mar 2020 13:10:36 GMT", + "model": "ah-0319", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Fri, 17 Apr 2020 16:17:58 GMT", + "id": "alexup9com-prx1", + "instancesCount": 0, + "lastSeen": "Sat, 18 Apr 2020 14:12:41 GMT", + "model": "ah-test-1704-01", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": null, + "id": "alontestrio-prx1", + "instancesCount": 0, + "lastSeen": "Mon, 23 Mar 2020 17:45:49 GMT", + "model": "ag_nectar_032301", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Tue, 31 Mar 2020 23:45:34 GMT", + "id": "alonup9com-prx1", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 10:58:30 GMT", + "model": "ag.proxy.050801", + "shouldTap": true, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Mon, 06 Apr 2020 07:51:20 GMT", + "id": "andrewpetrovup9com-prx1", + "instancesCount": 0, + "lastSeen": "Tue, 07 Apr 2020 08:15:56 GMT", + "model": "ap_test", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": null, + "id": "andreytestrio-prx1", + "instancesCount": 0, + "lastSeen": "Thu, 26 Mar 2020 11:09:27 GMT", + "model": "andrey2", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": "haiut-mk04", + "creationTime": null, + "id": "c59d834b-00cd-4650-b114-a9da537c56d7_trdemo_trdemo-client", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 10:19:27 GMT", + "model": "ah-0329-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-mk04", + "creationTime": null, + "id": "c59d834b-00cd-4650-b114-a9da537c56d7_trdemo_trdemo-flights", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 10:19:27 GMT", + "model": "ah-0329-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-mk04", + "creationTime": null, + "id": "c59d834b-00cd-4650-b114-a9da537c56d7_trdemo_trdemo-shoppingcart", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 10:19:27 GMT", + "model": "ah-0329-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-mk04", + "creationTime": null, + "id": "c59d834b-00cd-4650-b114-a9da537c56d7_trdemo_trdemo-users", + "instancesCount": 0, + "lastSeen": "Thu, 09 Apr 2020 10:19:27 GMT", + "model": "ah-0329-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Mon, 13 Apr 2020 14:32:47 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoClientTaskDefinition-51AGMDOUMFOS", + "instancesCount": 0, + "lastSeen": "Thu, 23 Apr 2020 17:01:37 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 12:18:27 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoClientTaskDefinition-ZSUR7XY24R3X", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 14:40:11 GMT", + "model": "ngm-1204-aws-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Mon, 13 Apr 2020 14:31:31 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoFlightsTaskDefinition-1GQ6KPSBBH2CG", + "instancesCount": 0, + "lastSeen": "Thu, 23 Apr 2020 17:01:37 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 12:18:27 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoFlightsTaskDefinition-1P92C5J4BMAJ", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 14:40:11 GMT", + "model": "ngm-1204-aws-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 12:18:26 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoShoppingcartTaskDefinition-8LVIGNH5OGR5", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 14:40:09 GMT", + "model": "ngm-1204-aws-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Mon, 13 Apr 2020 14:31:29 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoShoppingcartTaskDefinition-EF79FKMGB0S5", + "instancesCount": 0, + "lastSeen": "Thu, 23 Apr 2020 17:01:59 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Mon, 13 Apr 2020 14:31:36 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoUsersTaskDefinition-1SOGKLV12R6VX", + "instancesCount": 0, + "lastSeen": "Thu, 23 Apr 2020 17:01:53 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 12:18:26 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-01-TrdemoUsersTaskDefinition-IA4ZUEXN3VPX", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 14:40:09 GMT", + "model": "ngm-1204-aws-01", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 14:51:10 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-02-TrdemoClientTaskDefinition-19SVXVU4US12S", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 15:59:02 GMT", + "model": "ngm-1204-aws-02", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 14:49:24 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-02-TrdemoFlightsTaskDefinition-2P1PRCG5UHC3", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 15:59:04 GMT", + "model": "ngm-1204-aws-02", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 14:48:48 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-02-TrdemoShoppingcartTaskDefinition-1TLHJW9NH2B5A", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 15:59:00 GMT", + "model": "ngm-1204-aws-02", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Sun, 12 Apr 2020 14:48:43 GMT", + "id": "cluster-01-ECSCluster-ZldlPWdD1B9z_trdemo-02-TrdemoUsersTaskDefinition-1W5X329FWGXZ3", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 15:59:00 GMT", + "model": "ngm-1204-aws-02", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-aws-fra-03", + "creationTime": "Sun, 26 Apr 2020 20:09:14 GMT", + "id": "d2d6c435-eaf5-48f6-8e61-1e7c57251fbd_trdemo_trdemo-client", + "instancesCount": 0, + "lastSeen": "Sun, 10 May 2020 13:31:29 GMT", + "model": "aws_new_resolving2", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-aws-fra-03", + "creationTime": "Sun, 26 Apr 2020 20:09:09 GMT", + "id": "d2d6c435-eaf5-48f6-8e61-1e7c57251fbd_trdemo_trdemo-flights", + "instancesCount": 0, + "lastSeen": "Sun, 10 May 2020 13:31:31 GMT", + "model": "aws_new_resolving2", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-aws-fra-03", + "creationTime": "Sun, 26 Apr 2020 20:09:14 GMT", + "id": "d2d6c435-eaf5-48f6-8e61-1e7c57251fbd_trdemo_trdemo-shoppingcart", + "instancesCount": 0, + "lastSeen": "Sun, 10 May 2020 13:31:29 GMT", + "model": "aws_new_resolving2", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "haiut-aws-fra-03", + "creationTime": "Sun, 26 Apr 2020 20:09:09 GMT", + "id": "d2d6c435-eaf5-48f6-8e61-1e7c57251fbd_trdemo_trdemo-users", + "instancesCount": 0, + "lastSeen": "Sun, 10 May 2020 13:31:31 GMT", + "model": "aws_new_resolving2", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": null, + "creationTime": null, + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_tradmin_frontend-deployment", + "instancesCount": 0, + "lastSeen": "Sun, 10 May 2020 13:31:31 GMT", + "model": "default", + "shouldTap": false, + "type": "envoy" + }, + { + "agentName": null, + "creationTime": "Fri, 03 Apr 2020 08:00:08 GMT", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_tradmin_trcc-api-deployme-f9aaef0a8d6f47bab4894c055aa72533-67c7fc5czfxr", + "instancesCount": 0, + "lastSeen": "Fri, 03 Apr 2020 05:04:11 GMT", + "model": "default", + "shouldTap": false, + "type": "envoy" + }, + { + "agentName": null, + "creationTime": null, + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_tradmin_trcc-api-deployment", + "instancesCount": 0, + "lastSeen": "Thu, 23 Apr 2020 08:12:03 GMT", + "model": "sy-trcc-dogfood-3", + "shouldTap": false, + "type": "envoy" + }, + { + "agentName": "stg-cloud-agent", + "creationTime": "Thu, 23 Apr 2020 08:11:52 GMT", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_tradmin_trcc-api-deployment-stable", + "instancesCount": 2, + "lastSeen": "Thu, 21 May 2020 11:02:31 GMT", + "model": "sy-trcc-dogfood-10", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "stg-cloud-agent", + "creationTime": null, + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-client", + "instancesCount": 0, + "lastSeen": "Thu, 21 May 2020 11:02:29 GMT", + "model": "up9_011401", + "shouldTap": false, + "type": "envoy" + }, + { + "agentName": "stg-cloud-agent", + "creationTime": null, + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-flights", + "instancesCount": 0, + "lastSeen": "Thu, 21 May 2020 11:02:29 GMT", + "model": "up9_011401", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": null, + "creationTime": null, + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-shoppingcart", + "instancesCount": 0, + "lastSeen": "Sun, 10 May 2020 13:31:30 GMT", + "model": "bookstack-remote", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "stg-cloud-agent", + "creationTime": null, + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-users", + "instancesCount": 0, + "lastSeen": "Thu, 21 May 2020 11:02:29 GMT", + "model": "up9_011401", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": null, + "creationTime": null, + "id": "lirazyup9com-prx1", + "instancesCount": 0, + "lastSeen": "Thu, 21 May 2020 10:51:01 GMT", + "model": "liraz_test_2105", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Thu, 21 May 2020 10:58:05 GMT", + "id": "london-01-ECSCluster-27iuIYva8nO4_trdemo-01-TrdemoClientTaskDefinition-4TTVATDRY0CJ", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:31 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Thu, 21 May 2020 10:51:53 GMT", + "id": "london-01-ECSCluster-27iuIYva8nO4_trdemo-01-TrdemoFlightsTaskDefinition-HBBUAO47D2VT", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:30 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Thu, 21 May 2020 10:57:09 GMT", + "id": "london-01-ECSCluster-27iuIYva8nO4_trdemo-01-TrdemoShoppingcartTaskDefinition-1UAMK7WTR1SWE", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:32 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-london-aws", + "creationTime": "Thu, 21 May 2020 10:56:49 GMT", + "id": "london-01-ECSCluster-27iuIYva8nO4_trdemo-01-TrdemoUsersTaskDefinition-1HEEGJCBNB4PB", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:31 GMT", + "model": "default", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 14:14:42 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoClientTaskDefinition-1HQRZT31KSGK0", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:29 GMT", + "model": "ngm-1305-aws-01", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Mon, 06 Apr 2020 08:37:02 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoClientTaskDefinition-PCTOAFN3NUUL", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 12:36:48 GMT", + "model": "default", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Mon, 06 Apr 2020 10:46:50 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoFlightsTaskDefinition-1RP81I0ETBSRA", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 12:34:26 GMT", + "model": "default", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 14:13:16 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoFlightsTaskDefinition-6MATLSTUSK15", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:30 GMT", + "model": "ngm-1305-aws-01", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 14:13:05 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoShoppingcartTaskDefinition-1NSJ45NVQ46VV", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:30 GMT", + "model": "ngm-1305-aws-01", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Mon, 06 Apr 2020 08:37:02 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoShoppingcartTaskDefinition-VAY9IULBYL27", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 12:34:12 GMT", + "model": "default", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 14:13:05 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoUsersTaskDefinition-1KSLKXSKQ0YGI", + "instancesCount": 1, + "lastSeen": "Thu, 21 May 2020 11:02:31 GMT", + "model": "ngm-1305-aws-01", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Mon, 06 Apr 2020 10:47:04 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-01-TrdemoUsersTaskDefinition-A4VERGQEE2C9", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 12:34:26 GMT", + "model": "default", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 16:03:37 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-no-tapper-TrdemoClientTaskDefinition-1SP9ZUN1LZE3N", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 21:58:09 GMT", + "model": "ngm-1205-aws-no-tapper-04", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 16:04:39 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-no-tapper-TrdemoFlightsTaskDefinition-1U2E8ONADR65S", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 21:56:39 GMT", + "model": "ngm-1205-aws-no-tapper-04", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 16:01:49 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-no-tapper-TrdemoShoppingcartTaskDefinition-PFB3IL2KQWE3", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 21:56:34 GMT", + "model": "ngm-1205-aws-no-tapper-04", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": "nimrod-01-paris-aws", + "creationTime": "Tue, 12 May 2020 16:01:54 GMT", + "id": "nimrod-01-ECSCluster-1ENCWB3MDFEUQ_trdemo-no-tapper-TrdemoUsersTaskDefinition-CXOR2F6JGPNY", + "instancesCount": 0, + "lastSeen": "Tue, 12 May 2020 21:56:54 GMT", + "model": "ngm-1205-aws-no-tapper-04", + "shouldTap": true, + "type": "passive" + }, + { + "agentName": null, + "creationTime": null, + "id": "nimrodup9com-prx1", + "instancesCount": 0, + "lastSeen": "Sun, 29 Mar 2020 12:59:27 GMT", + "model": "ngm-2020-03-29-00", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Sun, 29 Mar 2020 14:09:23 GMT", + "id": "nimrodup9com-someorgid123-prx1-local", + "instancesCount": 0, + "lastSeen": "Sun, 29 Mar 2020 14:15:05 GMT", + "model": "ngm-2020-03-29-01", + "shouldTap": true, + "type": "local_proxy" + }, + { + "agentName": null, + "creationTime": null, + "id": "ofriup9com-prx1", + "instancesCount": 0, + "lastSeen": "Wed, 04 Mar 2020 08:04:47 GMT", + "model": "aaa", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Thu, 19 Mar 2020 16:03:38 GMT", + "id": "rami-prx1", + "instancesCount": 0, + "lastSeen": "Thu, 19 Mar 2020 16:03:38 GMT", + "model": "default", + "shouldTap": true, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Thu, 02 Apr 2020 06:31:20 GMT", + "id": "ramibermanup9com-prx1", + "instancesCount": 0, + "lastSeen": "Thu, 23 Apr 2020 06:26:18 GMT", + "model": "rami-endpoints", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Mon, 04 May 2020 11:25:30 GMT", + "id": "ramibrn1gmailcom-prx1", + "instancesCount": 0, + "lastSeen": "Mon, 04 May 2020 11:26:11 GMT", + "model": "regression-04-05-20", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Sun, 12 Apr 2020 12:50:24 GMT", + "id": "ramibrngmailcom-prx1", + "instancesCount": 0, + "lastSeen": "Sun, 12 Apr 2020 12:51:00 GMT", + "model": "rami-proxy-test", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Mon, 16 Mar 2020 14:14:37 GMT", + "id": "roeegadottestrio-prx1", + "instancesCount": 0, + "lastSeen": "Thu, 19 Mar 2020 07:02:30 GMT", + "model": "roee", + "shouldTap": false, + "type": "proxy" + }, + { + "agentName": null, + "creationTime": "Tue, 31 Mar 2020 09:31:42 GMT", + "id": "roeegadotup9com-someorgid123-prx1-local", + "instancesCount": 0, + "lastSeen": "Mon, 13 Apr 2020 06:29:10 GMT", + "model": "rg_local_proxy_5", + "shouldTap": false, + "type": "local_proxy" + } + ], + "x-sample-entry": "000000000000000000000144" + } + }, + "x-sample-entry": "000000000000000000000144" + } + }, + "x-counters-per-source": { + "": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058952.707, + "lastSeen": 1590058952.707, + "sumRT": 0.61, + "sumDuration": 0 + } + }, + "x-counters-total": { + "entries": 1, + "failures": 0, + "firstSeen": 1590058952.707, + "lastSeen": 1590058952.707, + "sumRT": 0.61, + "sumDuration": 0 + }, + "x-last-seen-ts": 1590058952.707, + "x-sample-entry": "000000000000000000000144" + } + }, + "/tapping/state": { + "get": { + "summary": "/tapping/state", + "description": "Mizu observed 8 entries (0 failed), at 0.760 hits/s, average response time is 0.258 seconds", + "operationId": "b0c1e867-43ee-4f94-bcf8-58cd0ba0f5c8", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [ + { + "runId": "fpfrlibnwy", + "status": "COMPLETED" + }, + { + "runId": "huuonvenvp", + "status": "COMPLETED" + }, + { + "runId": "lbtcxllqvg", + "status": "COMPLETED" + }, + { + "runId": "tycbfylptk", + "status": "COMPLETED" + }, + { + "runId": "zlzddvtcaa", + "status": "COMPLETED" + } + ], + "x-sample-entry": "000000000000000000000136" + }, + "text/html": { + "example": "Ok", + "x-sample-entry": "000000000000000000000021" + } + }, + "x-sample-entry": "000000000000000000000136" + } + }, + "x-counters-per-source": { + "": { + "entries": 8, + "failures": 0, + "firstSeen": 1590058948.2540002, + "lastSeen": 1590058953.307, + "sumRT": 2.0629999999999993, + "sumDuration": 6.0829997062683105 + } + }, + "x-counters-total": { + "entries": 8, + "failures": 0, + "firstSeen": 1590058948.2540002, + "lastSeen": 1590058953.307, + "sumRT": 2.0629999999999993, + "sumDuration": 6.0829997062683105 + }, + "x-last-seen-ts": 1590058953.221, + "x-sample-entry": "000000000000000000000136" + }, + "post": { + "summary": "/tapping/state", + "description": "Mizu observed 6 entries (1 failed), at 0.570 hits/s, average response time is 0.431 seconds", + "operationId": "4245a3e5-ebff-4a5b-a7d7-a7fbae4b0fce", + "responses": { + "200": { + "description": "Successful call with status 200", + "content": { + "application/json": { + "example": [ + { + "agentName": "stg-cloud-agent", + "creationTime": "Mon, 18 May 2020 08:34:05 GMT", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_tradmin_trcc-api-deployment-stable", + "instancesCount": 2, + "lastSeen": "Mon, 18 May 2020 14:48:04 GMT", + "model": "default", + "shouldTap": false, + "type": "envoy" + }, + { + "agentName": "stg-cloud-agent", + "creationTime": "Wed, 20 May 2020 09:33:35 GMT", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-client", + "instancesCount": 1, + "lastSeen": "Wed, 20 May 2020 10:23:57 GMT", + "model": "default", + "shouldTap": true, + "type": "envoy" + }, + { + "agentName": "stg-cloud-agent", + "creationTime": "Mon, 18 May 2020 07:45:09 GMT", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-flights", + "instancesCount": 1, + "lastSeen": "Wed, 20 May 2020 10:23:57 GMT", + "model": "default", + "shouldTap": false, + "type": "passive" + }, + { + "agentName": "stg-cloud-agent", + "creationTime": "Mon, 18 May 2020 07:45:09 GMT", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-users", + "instancesCount": 1, + "lastSeen": "Wed, 20 May 2020 10:23:57 GMT", + "model": "default", + "shouldTap": false, + "type": "passive" + } + ], + "x-sample-entry": "000000000000000000000111" + }, + "text/html": { + "example": "Ok", + "x-sample-entry": "000000000000000000000128" + } + }, + "x-sample-entry": "000000000000000000000128" + }, + "404": { + "description": "Failed call with status 404", + "content": { + "application/json": { + "example": { + "message": "404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again." + }, + "x-sample-entry": "000000000000000000000043" + } + }, + "x-sample-entry": "000000000000000000000043" + } + }, + "x-counters-per-source": { + "": { + "entries": 6, + "failures": 1, + "firstSeen": 1590058949.283, + "lastSeen": 1590058952.7059999, + "sumRT": 2.5849999999999995, + "sumDuration": 3.422999858856201 + } + }, + "x-counters-total": { + "entries": 6, + "failures": 1, + "firstSeen": 1590058949.283, + "lastSeen": 1590058952.7059999, + "sumRT": 2.5849999999999995, + "sumDuration": 3.422999858856201 + }, + "x-last-seen-ts": 1590058952.7059999, + "x-sample-entry": "000000000000000000000128", + "requestBody": { + "description": "Generic request body", + "content": { + "application/json": { + "example": { + "data": [ + { + "agentName": "stg-cloud-agent", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_tradmin_trcc-api-deployment-stable", + "instance_id": "trcc-api-deployment-stable-559db9f988-sj52h", + "ip": "10.48.0.155", + "type": "passive" + }, + { + "agentName": "stg-cloud-agent", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-client", + "instance_id": "trdemo-client-6db5b5684-srtdd", + "ip": "10.48.0.139", + "type": "envoy" + }, + { + "agentName": "stg-cloud-agent", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-flights", + "instance_id": "trdemo-flights-5679bd4b49-r489r", + "ip": "10.48.0.51", + "type": "passive" + }, + { + "agentName": "stg-cloud-agent", + "id": "e677a5bc-0542-11ea-a607-42010a8400ce_trdemo_trdemo-users", + "instance_id": "trdemo-users-77f6546dbc-k8rxr", + "ip": "10.48.0.50", + "type": "passive" + } + ] + }, + "x-sample-entry": "000000000000000000000128" + } + }, + "required": true, + "x-sample-entry": "000000000000000000000128" + } + } + } + }, + "x-counters-per-source": { + "": { + "entries": 143, + "failures": 1, + "firstSeen": 1590058948.2540002, + "lastSeen": 1590058953.952, + "sumRT": 11.506999999999994, + "sumDuration": 29.188997983932495 + } + }, + "x-counters-total": { + "entries": 143, + "failures": 1, + "firstSeen": 1590058948.2540002, + "lastSeen": 1590058953.952, + "sumRT": 11.506999999999994, + "sumDuration": 29.188997983932495 + } +} \ No newline at end of file diff --git a/agent/pkg/oas/oas_generator.go b/agent/pkg/oas/oas_generator.go index 96db713cd..2d39e1722 100644 --- a/agent/pkg/oas/oas_generator.go +++ b/agent/pkg/oas/oas_generator.go @@ -3,12 +3,13 @@ package oas import ( "context" "encoding/json" + "net/url" + "sync" + basenine "github.com/up9inc/basenine/client/go" "github.com/up9inc/mizu/agent/pkg/har" "github.com/up9inc/mizu/shared" "github.com/up9inc/mizu/tap/api" - "net/url" - "sync" "github.com/up9inc/mizu/shared/logger" ) @@ -27,11 +28,12 @@ type OasGenerator interface { } type defaultOasGenerator struct { - started bool - ctx context.Context - cancel context.CancelFunc - serviceSpecs *sync.Map - dbConn *basenine.Connection + started bool + ctx context.Context + cancel context.CancelFunc + serviceSpecs *sync.Map + dbConn *basenine.Connection + dbMutex sync.Mutex entriesQuery string } @@ -77,16 +79,17 @@ func (g *defaultOasGenerator) Stop() { if !g.started { return } - - if g.dbConn != nil { - g.dbConn.Close() - g.dbConn = nil - } + g.started = false g.cancel() g.reset() - g.started = false + g.dbMutex.Lock() + defer g.dbMutex.Unlock() + if g.dbConn != nil { + g.dbConn.Close() + g.dbConn = nil + } } func (g *defaultOasGenerator) IsStarted() bool { @@ -98,8 +101,12 @@ func (g *defaultOasGenerator) runGenerator() { dataChan := make(chan []byte) metaChan := make(chan []byte) + g.dbMutex.Lock() + defer g.dbMutex.Unlock() logger.Log.Infof("Querying DB for OAS generator with query '%s'", g.entriesQuery) - g.dbConn.Query(g.entriesQuery, dataChan, metaChan) + if err := g.dbConn.Query(g.entriesQuery, dataChan, metaChan); err != nil { + logger.Log.Errorf("Query mode call failed: %v", err) + } for { select { @@ -174,7 +181,7 @@ func (g *defaultOasGenerator) handleHARWithSource(entryWSource *EntryWithSource) return } - logger.Log.Debugf("Handled entry %d as opId: %s", entryWSource.Id, opId) // TODO: set opId back to entry? + logger.Log.Debugf("Handled entry %s as opId: %s", entryWSource.Id, opId) // TODO: set opId back to entry? } func (g *defaultOasGenerator) getGen(dest string, urlStr string) *SpecGen { diff --git a/agent/pkg/oas/oas_generator_test.go b/agent/pkg/oas/oas_generator_test.go index c7255bf9d..9728286de 100644 --- a/agent/pkg/oas/oas_generator_test.go +++ b/agent/pkg/oas/oas_generator_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "github.com/up9inc/mizu/agent/pkg/har" "testing" + "time" ) func TestOASGen(t *testing.T) { @@ -38,5 +39,8 @@ func TestOASGen(t *testing.T) { if !gen.IsStarted() { t.Errorf("Should be started") } + + time.Sleep(100 * time.Millisecond) + gen.Stop() } diff --git a/agent/pkg/oas/specgen.go b/agent/pkg/oas/specgen.go index 4bd4cec91..b86561e2c 100644 --- a/agent/pkg/oas/specgen.go +++ b/agent/pkg/oas/specgen.go @@ -3,10 +3,6 @@ package oas import ( "encoding/json" "errors" - "github.com/chanced/openapi" - "github.com/google/uuid" - "github.com/nav-inc/datetime" - "github.com/up9inc/mizu/shared/logger" "io" "io/ioutil" "mime" @@ -18,6 +14,11 @@ import ( "strings" "sync" + "github.com/chanced/openapi" + "github.com/google/uuid" + "github.com/nav-inc/datetime" + "github.com/up9inc/mizu/shared/logger" + "github.com/up9inc/mizu/agent/pkg/har" "time" @@ -32,7 +33,7 @@ type EntryWithSource struct { Source string Destination string Entry har.Entry - Id uint + Id string } type reqResp struct { // hello, generics in Go @@ -67,7 +68,7 @@ func (g *SpecGen) StartFromSpec(oas *openapi.OpenAPI) { g.tree = new(Node) for pathStr, pathObj := range oas.Paths.Items { pathSplit := strings.Split(string(pathStr), "/") - g.tree.getOrSet(pathSplit, pathObj, 0) + g.tree.getOrSet(pathSplit, pathObj, "") // clean "last entry timestamp" markers from the past for _, pathAndOp := range g.tree.listOps() { @@ -341,7 +342,7 @@ func handleCounters(opObj *openapi.Operation, success bool, entryWithSource *Ent return nil } -func handleRequest(req *har.Request, opObj *openapi.Operation, isSuccess bool, sampleId uint) error { +func handleRequest(req *har.Request, opObj *openapi.Operation, isSuccess bool, sampleId string) error { // TODO: we don't handle the situation when header/qstr param can be defined on pathObj level. Also the path param defined on opObj urlParsed, err := url.Parse(req.URL) if err != nil { @@ -401,7 +402,7 @@ func handleRequest(req *har.Request, opObj *openapi.Operation, isSuccess bool, s return nil } -func handleResponse(resp *har.Response, opObj *openapi.Operation, isSuccess bool, sampleId uint) error { +func handleResponse(resp *har.Response, opObj *openapi.Operation, isSuccess bool, sampleId string) error { // TODO: we don't support "default" response respObj, err := getResponseObj(resp, opObj, isSuccess) if err != nil { @@ -422,7 +423,7 @@ func handleResponse(resp *har.Response, opObj *openapi.Operation, isSuccess bool return nil } -func handleRespHeaders(reqHeaders []har.Header, respObj *openapi.ResponseObj, sampleId uint) { +func handleRespHeaders(reqHeaders []har.Header, respObj *openapi.ResponseObj, sampleId string) { visited := map[string]*openapi.HeaderObj{} for _, pair := range reqHeaders { if isHeaderIgnored(pair.Name) { @@ -466,7 +467,7 @@ func handleRespHeaders(reqHeaders []har.Header, respObj *openapi.ResponseObj, sa } } -func fillContent(reqResp reqResp, respContent openapi.Content, ctype string, sampleId uint) (*openapi.MediaType, error) { +func fillContent(reqResp reqResp, respContent openapi.Content, ctype string, sampleId string) (*openapi.MediaType, error) { content, found := respContent[ctype] if !found { respContent[ctype] = &openapi.MediaType{} diff --git a/agent/pkg/oas/test_artifacts/params.har.spec.json b/agent/pkg/oas/test_artifacts/params.har.spec.json index a777bc583..4b5dcfd6e 100644 --- a/agent/pkg/oas/test_artifacts/params.har.spec.json +++ b/agent/pkg/oas/test_artifacts/params.har.spec.json @@ -22,10 +22,10 @@ "content": { "application/json": { "example": null, - "x-sample-entry": 4 + "x-sample-entry": "000000000000000000000004" } }, - "x-sample-entry": 4 + "x-sample-entry": "000000000000000000000004" } }, "x-counters-per-source": { @@ -47,7 +47,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750580.04, - "x-sample-entry": 4 + "x-sample-entry": "000000000000000000000004" } }, "/appears-twice": { @@ -61,10 +61,10 @@ "content": { "application/json": { "example": null, - "x-sample-entry": 6 + "x-sample-entry": "000000000000000000000006" } }, - "x-sample-entry": 6 + "x-sample-entry": "000000000000000000000006" } }, "x-counters-per-source": { @@ -86,7 +86,7 @@ "sumDuration": 1 }, "x-last-seen-ts": 1567750581.74, - "x-sample-entry": 6 + "x-sample-entry": "000000000000000000000006" } }, "/body-optional": { @@ -99,10 +99,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 12 + "x-sample-entry": "000000000000000000000012" } }, - "x-sample-entry": 12 + "x-sample-entry": "000000000000000000000012" } }, "x-counters-per-source": { @@ -124,16 +124,16 @@ "sumDuration": 0.01 }, "x-last-seen-ts": 1567750581.75, - "x-sample-entry": 12, + "x-sample-entry": "000000000000000000000012", "requestBody": { "description": "Generic request body", "content": { "application/json": { "example": "{\"key\", \"val\"}", - "x-sample-entry": 11 + "x-sample-entry": "000000000000000000000011" } }, - "x-sample-entry": 12 + "x-sample-entry": "000000000000000000000012" } } }, @@ -147,10 +147,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 13 + "x-sample-entry": "000000000000000000000013" } }, - "x-sample-entry": 13 + "x-sample-entry": "000000000000000000000013" } }, "x-counters-per-source": { @@ -172,17 +172,17 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750581.75, - "x-sample-entry": 13, + "x-sample-entry": "000000000000000000000013", "requestBody": { "description": "Generic request body", "content": { "": { "example": "body exists", - "x-sample-entry": 13 + "x-sample-entry": "000000000000000000000013" } }, "required": true, - "x-sample-entry": 13 + "x-sample-entry": "000000000000000000000013" } } }, @@ -197,10 +197,10 @@ "content": { "": { "example": {}, - "x-sample-entry": 9 + "x-sample-entry": "000000000000000000000009" } }, - "x-sample-entry": 9 + "x-sample-entry": "000000000000000000000009" } }, "x-counters-per-source": { @@ -222,7 +222,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750582.74, - "x-sample-entry": 9, + "x-sample-entry": "000000000000000000000009", "requestBody": { "description": "Generic request body", "content": { @@ -250,11 +250,11 @@ } }, "example": "--BOUNDARY\r\nContent-Disposition: form-data; name=\"file\"; filename=\"metadata.json\"\r\nContent-Type: application/json\r\n\r\n{\"functions\": 123}\r\n--BOUNDARY\r\nContent-Disposition: form-data; name=\"path\"\r\n\r\n/content/components\r\n--BOUNDARY--\r\n", - "x-sample-entry": 9 + "x-sample-entry": "000000000000000000000009" } }, "required": true, - "x-sample-entry": 9 + "x-sample-entry": "000000000000000000000009" } } }, @@ -268,10 +268,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 8 + "x-sample-entry": "000000000000000000000008" } }, - "x-sample-entry": 8 + "x-sample-entry": "000000000000000000000008" } }, "x-counters-per-source": { @@ -293,7 +293,7 @@ "sumDuration": 1 }, "x-last-seen-ts": 1567750581.74, - "x-sample-entry": 8, + "x-sample-entry": "000000000000000000000008", "requestBody": { "description": "Generic request body", "content": { @@ -334,11 +334,11 @@ } }, "example": "agent-id=ade\u0026callback-url=\u0026token=sometoken", - "x-sample-entry": 8 + "x-sample-entry": "000000000000000000000008" } }, "required": true, - "x-sample-entry": 8 + "x-sample-entry": "000000000000000000000008" } } }, @@ -355,10 +355,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 14 + "x-sample-entry": "000000000000000000000014" } }, - "x-sample-entry": 14 + "x-sample-entry": "000000000000000000000014" } }, "x-counters-per-source": { @@ -380,7 +380,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750582, - "x-sample-entry": 14 + "x-sample-entry": "000000000000000000000014" }, "parameters": [ { @@ -396,7 +396,7 @@ "value": "234324" } }, - "x-sample-entry": 14 + "x-sample-entry": "000000000000000000000014" } ] }, @@ -413,10 +413,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 18 + "x-sample-entry": "000000000000000000000018" } }, - "x-sample-entry": 18 + "x-sample-entry": "000000000000000000000018" } }, "x-counters-per-source": { @@ -438,7 +438,7 @@ "sumDuration": 9.53e-7 }, "x-last-seen-ts": 1567750582.00, - "x-sample-entry": 18 + "x-sample-entry": "000000000000000000000018" }, "parameters": [ { @@ -467,7 +467,7 @@ "value": "prefix-gibberish-afterwards" } }, - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" } ] }, @@ -484,10 +484,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 15 + "x-sample-entry": "000000000000000000000015" } }, - "x-sample-entry": 15 + "x-sample-entry": "000000000000000000000015" } }, "x-counters-per-source": { @@ -509,7 +509,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750582.00, - "x-sample-entry": 15 + "x-sample-entry": "000000000000000000000015" }, "parameters": [ { @@ -538,7 +538,7 @@ "value": "prefix-gibberish-afterwards" } }, - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" } ] }, @@ -555,10 +555,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 16 + "x-sample-entry": "000000000000000000000016" } }, - "x-sample-entry": 16 + "x-sample-entry": "000000000000000000000016" } }, "x-counters-per-source": { @@ -580,7 +580,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750582.00, - "x-sample-entry": 16 + "x-sample-entry": "000000000000000000000016" }, "parameters": [ { @@ -609,7 +609,7 @@ "value": "prefix-gibberish-afterwards" } }, - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" } ] }, @@ -626,10 +626,10 @@ "description": "Successful call with status 200", "content": { "": { - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" } }, - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" } }, "x-counters-per-source": { @@ -651,7 +651,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750582.00, - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" }, "parameters": [ { @@ -667,7 +667,7 @@ "value": "23421" } }, - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" }, { "name": "parampatternId", @@ -695,7 +695,7 @@ "value": "prefix-gibberish-afterwards" } }, - "x-sample-entry": 19 + "x-sample-entry": "000000000000000000000019" } ] }, @@ -710,10 +710,10 @@ "content": { "application/json": { "example": null, - "x-sample-entry": 3 + "x-sample-entry": "000000000000000000000003" } }, - "x-sample-entry": 3 + "x-sample-entry": "000000000000000000000003" } }, "x-counters-per-source": { @@ -735,7 +735,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750579.74, - "x-sample-entry": 3 + "x-sample-entry": "000000000000000000000003" }, "parameters": [ { @@ -754,7 +754,7 @@ "value": "" } }, - "x-sample-entry": 3 + "x-sample-entry": "000000000000000000000003" } ] }, @@ -768,10 +768,10 @@ "description": "Successful call with status 200", "content": { "text/html": { - "x-sample-entry": 1 + "x-sample-entry": "000000000000000000000001" } }, - "x-sample-entry": 1 + "x-sample-entry": "000000000000000000000001" } }, "x-counters-per-source": { @@ -793,7 +793,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750483.86, - "x-sample-entry": 1 + "x-sample-entry": "000000000000000000000001" }, "parameters": [ { @@ -812,7 +812,7 @@ "value": "" } }, - "x-sample-entry": 3 + "x-sample-entry": "000000000000000000000003" } ] }, @@ -827,10 +827,10 @@ "content": { "application/json": { "example": null, - "x-sample-entry": 2 + "x-sample-entry": "000000000000000000000002" } }, - "x-sample-entry": 2 + "x-sample-entry": "000000000000000000000002" } }, "x-counters-per-source": { @@ -852,7 +852,7 @@ "sumDuration": 0 }, "x-last-seen-ts": 1567750578.74, - "x-sample-entry": 2 + "x-sample-entry": "000000000000000000000002" }, "parameters": [ { @@ -871,7 +871,7 @@ "value": "" } }, - "x-sample-entry": 3 + "x-sample-entry": "000000000000000000000003" } ] } diff --git a/agent/pkg/oas/tree.go b/agent/pkg/oas/tree.go index dfbd99e59..03d21c907 100644 --- a/agent/pkg/oas/tree.go +++ b/agent/pkg/oas/tree.go @@ -2,12 +2,13 @@ package oas import ( "encoding/json" - "github.com/chanced/openapi" - "github.com/up9inc/mizu/shared/logger" "net/url" "regexp" "strconv" "strings" + + "github.com/chanced/openapi" + "github.com/up9inc/mizu/shared/logger" ) type NodePath = []string @@ -20,7 +21,7 @@ type Node struct { children []*Node } -func (n *Node) getOrSet(path NodePath, existingPathObj *openapi.PathObj, sampleId uint) (node *Node) { +func (n *Node) getOrSet(path NodePath, existingPathObj *openapi.PathObj, sampleId string) (node *Node) { if existingPathObj == nil { panic("Invalid function call") } diff --git a/agent/pkg/oas/tree_test.go b/agent/pkg/oas/tree_test.go index 10bdef24d..c516b42b7 100644 --- a/agent/pkg/oas/tree_test.go +++ b/agent/pkg/oas/tree_test.go @@ -1,6 +1,7 @@ package oas import ( + "fmt" "strings" "testing" @@ -23,7 +24,7 @@ func TestTree(t *testing.T) { for i, tc := range testCases { split := strings.Split(tc.inp, "/") pathObj := new(openapi.PathObj) - node := tree.getOrSet(split, pathObj, uint(i)) + node := tree.getOrSet(split, pathObj, fmt.Sprintf("%024d", i)) fillPathParams(node, pathObj) diff --git a/agent/pkg/oas/utils.go b/agent/pkg/oas/utils.go index 23c10ed6a..e7312949d 100644 --- a/agent/pkg/oas/utils.go +++ b/agent/pkg/oas/utils.go @@ -115,7 +115,7 @@ type nvParams struct { GeneralizeName func(name string) string } -func handleNameVals(gw nvParams, params **openapi.ParameterList, checkIgnore bool, sampleId uint) { +func handleNameVals(gw nvParams, params **openapi.ParameterList, checkIgnore bool, sampleId string) { visited := map[string]*openapi.ParameterObj{} for _, pair := range gw.Pairs { if (checkIgnore && gw.IsIgnored(pair.Name)) || pair.Name == "" { @@ -477,8 +477,8 @@ func intersectSliceWithMap(required []string, names map[string]struct{}) []strin return required } -func setSampleID(extensions *openapi.Extensions, id uint) { - if id > 0 { +func setSampleID(extensions *openapi.Extensions, id string) { + if id != "" { if *extensions == nil { *extensions = openapi.Extensions{} } diff --git a/agent/pkg/oas/utils_test.go b/agent/pkg/oas/utils_test.go index ae4b21ef3..5c72a2b4c 100644 --- a/agent/pkg/oas/utils_test.go +++ b/agent/pkg/oas/utils_test.go @@ -29,7 +29,7 @@ func TestAnyJSON(t *testing.T) { } else if tc.inp == "null" && any != nil { t.Errorf("null has to parse as nil (but got %s)", any) } else { - t.Logf("%s => %s", tc.inp, any) + t.Logf("%s => %v", tc.inp, any) } } } diff --git a/agent/pkg/up9/main.go b/agent/pkg/up9/main.go index 043c00838..badd67183 100644 --- a/agent/pkg/up9/main.go +++ b/agent/pkg/up9/main.go @@ -323,7 +323,9 @@ func syncEntriesImpl(token string, model string, envPrefix string, uploadInterva go handleMetaChannel(&wg, connection, meta) wg.Add(2) - connection.Query(query, data, meta) + if err = connection.Query(query, data, meta); err != nil { + logger.Log.Panicf("Query mode call failed: %v", err) + } wg.Wait() } diff --git a/cli/go.mod b/cli/go.mod index 6788ed1ac..6b22d4f2e 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -11,7 +11,7 @@ require ( github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/spf13/cobra v1.3.0 github.com/spf13/pflag v1.0.5 - github.com/up9inc/basenine/server/lib v0.0.0-20220326121918-785f3061c8ce + github.com/up9inc/basenine/server/lib v0.0.0-20220413023528-c741e4aa1cf2 github.com/up9inc/mizu/shared v0.0.0 github.com/up9inc/mizu/tap/api v0.0.0 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 @@ -72,7 +72,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect - github.com/ohler55/ojg v1.12.13 // indirect + github.com/ohler55/ojg v1.14.0 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/cli/go.sum b/cli/go.sum index b0dbaa9a3..a1df3ab40 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -487,8 +487,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/ohler55/ojg v1.12.13 h1:FvfVpYzLgMraLcg3rrXiRXaihOP6fnzQNEU9YyZ/AmM= -github.com/ohler55/ojg v1.12.13/go.mod h1:LBbIVRAgoFbYBXQhRhuEpaJIqq+goSO63/FQ+nyJU88= +github.com/ohler55/ojg v1.14.0 h1:DyHomsCwofNswmKj7BLMdx51xnKbXxgIo1rVWCaBcNk= +github.com/ohler55/ojg v1.14.0/go.mod h1:3+GH+0PggMKocQtbZCrFifal3yRpHiBT4QUkxFJI6e8= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -600,8 +600,8 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/up9inc/basenine/server/lib v0.0.0-20220326121918-785f3061c8ce h1:PypqybjmuxftGkX4NmP4JAUyEykZj2r6W4r9lnRZ/kE= -github.com/up9inc/basenine/server/lib v0.0.0-20220326121918-785f3061c8ce/go.mod h1:ZIkxWiJm65jYQIso9k+OZKhR7gQ1we2jNyE2kQX9IQI= +github.com/up9inc/basenine/server/lib v0.0.0-20220413023528-c741e4aa1cf2 h1:rgm5a2ALbYKbItaSXx25K8vavZpeF0HN1Pk0qmOqy50= +github.com/up9inc/basenine/server/lib v0.0.0-20220413023528-c741e4aa1cf2/go.mod h1:v0hIh31iwDGbkkdeSSppdMNm1oIigfCA2mG2XajKnf8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= diff --git a/tap/api/api.go b/tap/api/api.go index a9e32f0ae..4cc495aa3 100644 --- a/tap/api/api.go +++ b/tap/api/api.go @@ -156,7 +156,7 @@ func (e *Emitting) Emit(item *OutputChannelItem) { } type Entry struct { - Id uint `json:"id"` + Id string `json:"id"` Protocol Protocol `json:"proto"` Capture Capture `json:"capture"` Source *TCP `json:"src"` @@ -188,7 +188,7 @@ type EntryWrapper struct { } type BaseEntry struct { - Id uint `json:"id"` + Id string `json:"id"` Protocol Protocol `json:"proto,omitempty"` Capture Capture `json:"capture"` Summary string `json:"summary,omitempty"` diff --git a/ui-common/src/components/TrafficViewer/EntriesList.tsx b/ui-common/src/components/TrafficViewer/EntriesList.tsx index 9df325d46..73105dd21 100644 --- a/ui-common/src/components/TrafficViewer/EntriesList.tsx +++ b/ui-common/src/components/TrafficViewer/EntriesList.tsx @@ -55,7 +55,7 @@ export const EntriesList: React.FC = ({ const [startTime, setStartTime] = useState(0); const [truncatedTimestamp, setTruncatedTimestamp] = useState(0); - const leftOffBottom = entries.length > 0 ? entries[entries.length - 1].id + 1 : -1; + const leftOffBottom = entries.length > 0 ? entries[entries.length - 1].id : "latest"; useEffect(() => { const list = document.getElementById('list').firstElementChild; @@ -76,7 +76,7 @@ export const EntriesList: React.FC = ({ const getOldEntries = useCallback(async () => { setLoadMoreTop(false); - if (leftOffTop === null || leftOffTop <= 0) { + if (leftOffTop === "") { return; } setIsLoadingTop(true); @@ -127,7 +127,7 @@ export const EntriesList: React.FC = ({ switch (message.messageType) { case "entry": const entry = message.data; - if (!focusedEntryId) setFocusedEntryId(entry.id.toString()); + if (!focusedEntryId) setFocusedEntryId(entry.id); const newEntries = [...entries, entry]; if (newEntries.length > 10000) { setLeftOffTop(newEntries[0].id); @@ -151,14 +151,14 @@ export const EntriesList: React.FC = ({ case "queryMetadata": setTruncatedTimestamp(message.data.truncatedTimestamp); setQueriedTotal(message.data.total); - if (leftOffTop === null) { - setLeftOffTop(message.data.leftOff - 1); + if (leftOffTop === "") { + setLeftOffTop(message.data.leftOff); } break; case "startTime": setStartTime(message.data); break; - }; + } } } @@ -180,7 +180,7 @@ export const EntriesList: React.FC = ({