Add prometheus exporter on :9100
This commit is contained in:
@@ -18,10 +18,13 @@ func TestParseLine(t *testing.T) {
|
||||
line: good,
|
||||
wantOK: true,
|
||||
want: LogRecord{
|
||||
Website: "www.example.com",
|
||||
ClientPrefix: "1.2.3.0/24",
|
||||
URI: "/api/v1/search",
|
||||
Status: "200",
|
||||
Website: "www.example.com",
|
||||
ClientPrefix: "1.2.3.0/24",
|
||||
URI: "/api/v1/search",
|
||||
Status: "200",
|
||||
Method: "GET",
|
||||
BodyBytesSent: 1452,
|
||||
RequestTime: 0.043,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -33,6 +36,8 @@ func TestParseLine(t *testing.T) {
|
||||
ClientPrefix: "10.0.0.0/24",
|
||||
URI: "/submit",
|
||||
Status: "201",
|
||||
Method: "POST",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -44,6 +49,8 @@ func TestParseLine(t *testing.T) {
|
||||
ClientPrefix: "2001:db8:cafe::/48", // /48 = 3 full 16-bit groups intact
|
||||
URI: "/",
|
||||
Status: "200",
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -70,6 +77,8 @@ func TestParseLine(t *testing.T) {
|
||||
ClientPrefix: "5.6.7.0/24",
|
||||
URI: "/rate-limited",
|
||||
Status: "429",
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -82,6 +91,8 @@ func TestParseLine(t *testing.T) {
|
||||
URI: "/",
|
||||
Status: "200",
|
||||
IsTor: true,
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -94,6 +105,8 @@ func TestParseLine(t *testing.T) {
|
||||
URI: "/",
|
||||
Status: "200",
|
||||
IsTor: false,
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -106,6 +119,8 @@ func TestParseLine(t *testing.T) {
|
||||
URI: "/",
|
||||
Status: "200",
|
||||
IsTor: false,
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -119,6 +134,8 @@ func TestParseLine(t *testing.T) {
|
||||
Status: "200",
|
||||
IsTor: false,
|
||||
ASN: 12345,
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -132,6 +149,8 @@ func TestParseLine(t *testing.T) {
|
||||
Status: "200",
|
||||
IsTor: true,
|
||||
ASN: 65535,
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -145,6 +164,8 @@ func TestParseLine(t *testing.T) {
|
||||
Status: "200",
|
||||
IsTor: true,
|
||||
ASN: 0,
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -158,6 +179,8 @@ func TestParseLine(t *testing.T) {
|
||||
Status: "200",
|
||||
IsTor: false,
|
||||
ASN: 0,
|
||||
Method: "GET",
|
||||
RequestTime: 0.001,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user