Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit 7f7ea8b

Browse files
author
Chris Wiechmann
authored
Merge pull request #16 from mpentzek/master
Added getinfo endpoint
2 parents 657bd3f + 7dacaca commit 7f7ea8b

File tree

9 files changed

+586
-83
lines changed

9 files changed

+586
-83
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"debug.node.autoAttach": "on"
3+
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ For the following steps, please open the ANM configuration in Policy-Studio. You
7676

7777
- The `Compare Attribute` filter checks if the requested API can be handled by the API-Builder project.
7878
As a basis for decision-making a criteria for each endpoint needs to be added to the filter configuration.
79-
_At this point in time three endpoints are supported by the API Builder based Traffic-Monitor API.
80-
The **search** endpoint which provides the data for the HTTP Traffic overview, the **circuitpath** endpoint which provides the data for the Filter Execution Path as part of the detailed view of a transaction and the **trace** endpoint which returns the trace information. Currently the API Builder Project does not cover all endpoints to completely replace the existing Traffic Monitor API yet, but more endpoints will be added soon!_
79+
_The following endpoints are supported by the API Builder based Traffic-Monitor API.
80+
The **search** endpoint which provides the data for the HTTP Traffic overview, the **circuitpath** endpoint which provides the data for the Filter Execution Path as part of the detailed view of a transaction, the **trace** endpoint which returns the trace information and the **getinfo** endpoint which returns the request detail information including the http header of each leg._
8181
For search endpoint add: `http.request.path` matches regular expression `^\/api\/router\/service\/[A-Za-z0-9-.]+\/ops\/search$`
8282
For circuitpath endpoint add: `http.request.path` matches regular expression `^\/api\/router\/service\/[A-Za-z0-9-.]+\/ops\/stream\/[A-Za-z0-9]+\/[^\/]+\/circuitpath$`
8383
For trace endpoint add: `http.request.path` matches regular expression `^\/api\/router\/service\/[A-Za-z0-9-.]+\/ops\/trace\/[A-Za-z0-9]+[\?]?.*$`
84-
_The list of requests will be extended once the API-Builder project can serve more (e.g. the Request-Detail view)._
84+
For getinfo endpoint add: `http.request.path` matches regular expression `^\/api\/router\/service\/[A-Za-z0-9-.]+\/ops\/[A-Za-z0-9]+\/[A-Za-z0-9]+\/[\*0-9]{1}\/getinfo[\?]?.*$`
8585
![Is API Managed][img6]
8686
- Adjust the URL of the Connect to URL filter to your running API-Builder docker container and port - **default is 8889**. Sample: `http://api-env:8889/api/elk/v1${http.request.rawURI}`
8787
![Connect to ES API][img7]

elk-traffic-monitor-api/flows/trafficMonitorApi-getinfo.json

Lines changed: 233 additions & 14 deletions
Large diffs are not rendered by default.

elk-traffic-monitor-api/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"test": "mocha --exit --colors ./test --recursive -R spec",
4848
"test:search": "mocha --exit --colors ./test/test_search_endpoint.js -R spec",
4949
"test:circuitpath": "mocha --exit --colors ./test/test_circuitpath.js -R spec",
50-
"test:trace": "mocha --exit --colors ./test/test_trace_endpoint.js -R spec",
50+
"test:trace": "mocha --inspect-brk --exit --colors ./test/test_trace_endpoint.js -R spec",
51+
"test:getinfo": "mocha --inspect-brk --exit --colors ./test/test_getinfo_endpoint.js -R spec",
5152
"test:debug": "mocha --inspect-brk --exit --colors ./test --recursive -R spec --timeout 10000"
5253
}
5354
}
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
const getDate = require('../../util');
2+
3+
module.exports = [
4+
{
5+
"timestampOriginal": "2020-07-03T15:55:48.333Z",
6+
"transactionSummaryContext": {
7+
"monitor": true,
8+
"service": "ARS ToDo API",
9+
"client": "Pass Through",
10+
"status": "success",
11+
"duration": 383,
12+
"method": "Get-all-todo-items"
13+
},
14+
"@version": "1",
15+
"@timestamp": "2020-07-03T15:56:11.597Z",
16+
"transactionElements": {
17+
"leg1": {
18+
"duration": 176,
19+
"operation": "Get-all-todo-items",
20+
"protocolInfo": {
21+
"recvHeader": "HTTP/1.1 200 OK\r\nserver: API Builder/4.27.29\r\nrequest-id: e923342a-cf72-4c93-a774-78d1fa80c002\r\nx-xss-protection: 1; mode=block\r\nx-frame-options: DENY\r\nsurrogate-control: no-store\r\ncache-control: no-store, no-cache, must-revalidate, proxy-revalidate\r\npragma: no-cache\r\nexpires: 0\r\nx-content-type-options: nosniff\r\nstart-time: 1593791748423\r\ncontent-type: application/json; charset=utf-8\r\nresponse-time: 1\r\ncontent-md5: 0c682d056c69de8e90bbdf0a677891d8\r\ncontent-length: 281\r\netag: W/\"119-iMSR0WMPy7z6deRjls2eUuMCX5I\"\r\nVary: Accept-Encoding\r\nDate: Fri, 03 Jul 2020 15:55:48 GMT\r\nConnection: close\r\n\r\n",
22+
"sentHeader": "GET /api/todos HTTP/1.1\r\nHost: 79f6a7dbf03ba9dc3fcdda2486d26adfab68584e.cloudapp-enterprise.appcelerator.com\r\nMax-Forwards: 20\r\nVia: 1.0 api-env (Gateway)\r\naccept: */*\r\nuser-agent: loadtest/5.0.3\r\nConnection: close\r\nX-CorrelationID: Id-0455ff5e82267be8182a553d 1\r\n\r\n",
23+
"http": {
24+
"bytesReceived": 879,
25+
"uri": "/api/todos",
26+
"remoteAddr": "52.43.33.149",
27+
"authSubjectId": "Pass Through",
28+
"localAddr": "192.168.233.137",
29+
"remotePort": "80",
30+
"bytesSent": 266,
31+
"wafStatus": 0,
32+
"status": 200,
33+
"localPort": "43580",
34+
"statusText": "OK",
35+
"method": "GET",
36+
"remoteName": "79f6a7dbf03ba9dc3fcdda2486d26adfab68584e.cloudapp-enterprise.appcelerator.com"
37+
},
38+
"recvPayload": "file:///opt/Axway/APIM/apigateway/logs/payloads/2020-07-03/08.55/0455ff5e82267be8182a553d-1-received"
39+
},
40+
"leg": 1,
41+
"serviceName": "ARS ToDo API"
42+
},
43+
"leg0": {
44+
"finalStatus": "Pass",
45+
"operation": "Get-all-todo-items",
46+
"protocolInfo": {
47+
"recvHeader": "GET /ars/api/todos HTTP/1.1\r\nhost: api-env.demo.axway.com:8065\r\nuser-agent: loadtest/5.0.3\r\naccept: */*\r\nConnection: keep-alive\r\n\r\n",
48+
"sentHeader": "HTTP/1.1 200 OK\r\nMax-Forwards: 20\r\nVia: 1.0 api-env (Gateway)\r\nConnection: close\r\nX-CorrelationID: Id-0455ff5e82267be8182a553d 0\r\ncache-control: no-store, no-cache, must-revalidate, proxy-revalidate\r\nDate: Fri, 03 Jul 2020 15:55:48 GMT\r\netag: W/\"119-iMSR0WMPy7z6deRjls2eUuMCX5I\"\r\nexpires: 0\r\npragma: no-cache\r\nrequest-id: e923342a-cf72-4c93-a774-78d1fa80c002\r\nresponse-time: 1\r\nserver: API Builder/4.27.29\r\nstart-time: 1593791748423\r\nsurrogate-control: no-store\r\nVary: Accept-Encoding\r\nx-content-type-options: nosniff\r\nx-frame-options: DENY\r\nx-xss-protection: 1; mode=block\r\ncontent-md5: 0c682d056c69de8e90bbdf0a677891d8\r\ncontent-type: application/json; charset=utf-8\r\n\r\n",
49+
"http": {
50+
"bytesReceived": 131,
51+
"uri": "/ars/api/todos",
52+
"remoteAddr": "192.168.233.1",
53+
"authSubjectId": "Pass Through",
54+
"localAddr": "192.168.233.137",
55+
"remotePort": "55783",
56+
"bytesSent": 952,
57+
"wafStatus": 0,
58+
"status": 200,
59+
"localPort": "8065",
60+
"statusText": "OK",
61+
"method": "GET",
62+
"remoteName": "192.168.233.1"
63+
},
64+
"sentPayload": "file:///opt/Axway/APIM/apigateway/logs/payloads/2020-07-03/08.55/0455ff5e82267be8182a553d-0-sent"
65+
},
66+
"serviceName": "ARS ToDo API",
67+
"duration": 384,
68+
"leg": 0
69+
}
70+
},
71+
"circuitPath": [
72+
{
73+
"filters": [
74+
{
75+
"class": "com.vordel.circuit.vapi.VApiServiceContextFilter",
76+
"type": "VApiServiceContextFilter",
77+
"name": "Set service context",
78+
"filterTime": 1593791748127,
79+
"status": "Pass",
80+
"execTime": 0
81+
},
82+
{
83+
"class": "com.vordel.circuit.CircuitDelegateFilter",
84+
"status": "Pass",
85+
"name": "Global Request Policy",
86+
"filterTime": 1593791748141,
87+
"type": "CircuitDelegateFilter",
88+
"subPaths": [
89+
{
90+
"filters": [
91+
{
92+
"class": "com.vordel.circuit.basic.TraceFilter",
93+
"type": "TraceFilter",
94+
"name": "Trace Filter",
95+
"filterTime": 1593791748141,
96+
"status": "Pass",
97+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:-2330724604838128298",
98+
"execTime": 14
99+
}
100+
],
101+
"policy": "Trace",
102+
"execTime": 14
103+
}
104+
],
105+
"execTime": 14
106+
},
107+
{
108+
"class": "com.vordel.apiportal.runtime.virtualized.VApiCircuitDelegateFilter",
109+
"type": "VApiCircuitDelegateFilter",
110+
"status": "Pass",
111+
"filterTime": 1593791748510,
112+
"name": "Custom Routing",
113+
"subPaths": [
114+
{
115+
"filters": [
116+
{
117+
"execTime": 369,
118+
"class": "com.vordel.circuit.switchcase.SwitchFilter",
119+
"type": "SwitchFilter",
120+
"name": "Default Routing",
121+
"filterTime": 1593791748510,
122+
"status": "Pass",
123+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:4323849261363416160",
124+
"subPaths": [
125+
{
126+
"filters": [
127+
{
128+
"class": "com.vordel.circuit.CircuitDelegateFilter",
129+
"type": "CircuitDelegateFilter",
130+
"name": "not-required-here",
131+
"status": "Pass",
132+
"filterTime": 1593791748510,
133+
"subPaths": [
134+
{
135+
"filters": [
136+
{
137+
"class": "com.vordel.circuit.net.ConnectToURLFilter",
138+
"type": "ConnectToURLFilter",
139+
"name": "Connect to URL",
140+
"status": "Pass",
141+
"filterTime": 1593791748510,
142+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:5735607394361826155",
143+
"execTime": 369
144+
}
145+
],
146+
"policy": "Default Profile-based Routing",
147+
"execTime": 369
148+
}
149+
],
150+
"execTime": 369
151+
}
152+
],
153+
"policy": "Default API Proxy Routing",
154+
"execTime": 369
155+
}
156+
]
157+
}
158+
],
159+
"policy": "Default API Proxy Routing",
160+
"execTime": 369
161+
}
162+
],
163+
"execTime": 369
164+
}
165+
],
166+
"policy": "API Broker",
167+
"execTime": 383
168+
}
169+
],
170+
"transactionSummary": {
171+
"status": "success",
172+
"protocol": "https",
173+
"serviceContexts": [
174+
{
175+
"monitor": true,
176+
"service": "ARS ToDo API",
177+
"client": "Pass Through",
178+
"status": "success",
179+
"duration": 383,
180+
"method": "Get-all-todo-items"
181+
}
182+
],
183+
"protocolSrc": "8065",
184+
"path": "/ars/api/todos"
185+
},
186+
"correlationId": "0455ff5e82267be8182a553d",
187+
"tags": [
188+
"openlog"
189+
],
190+
"processInfo": {
191+
"hostname": "api-env",
192+
"serviceId": "instance-1",
193+
"groupId": "group-2",
194+
"serviceName": "QuickStart Server",
195+
"version": "7.7.20200130",
196+
"domainId": "ed992442-c363-4d36-963a-9e6314b0f421",
197+
"groupName": "QuickStart Group"
198+
}
199+
}
200+
]

elk-traffic-monitor-api/test/test_getinfo.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)