feat: clickhouse logger#6215
Conversation
|
Hi, @spacewander |
Sorry, it is the bug in our lint script. Fixed in #6239 |
6d728a2 to
c47613a
Compare
c47613a to
74d59b5
Compare
|
hi @zhendongcmss CI is broken |
@spacewander @tzssangglass |
My comments above solved the 401 problem with test 4, you can continue to see the problem with test 5, which is related to the code and configuration. |
cfdc24f to
22c3fb0
Compare
d8ef45b to
daedfd1
Compare
daedfd1 to
34f3dcb
Compare
b8852fa to
bc00ad3
Compare
| "clickhouse body: INSERT INTO t FORMAT JSONEachRow" | ||
| "clickhouse headers: X-ClickHouse-Key:a" | ||
| "clickhouse headers: X-ClickHouse-User:default" | ||
| "clickhouse headers: X-ClickHouse-Database:default" |
There was a problem hiding this comment.
I have reconsidered the test.
What about using error_log like
Lines 572 to 574 in 537a8da
There was a problem hiding this comment.
It doesn't work.
There was a problem hiding this comment.
It doesn't work. I don't know why. I think --- grep_error_log_out is easier to use.
There was a problem hiding this comment.
bc00ad3 to
9118fb0
Compare
| }, | ||
| "plugins":{ | ||
| "clickhouse-logger":{ | ||
| "batch_max_size":1000, |
There was a problem hiding this comment.
| "batch_max_size":1000, | |
| "batch_max_size":1, |
So the report can be triggered in the CI
There was a problem hiding this comment.
I thought there was a timer that called this callback function periodically and also if the batch_max_size value was reached. But I added a wait of --- wait: 5 below, it seem doesn'twork.
041d8b3 to
4ad14a0
Compare
spacewander
left a comment
There was a problem hiding this comment.
Could you apply this patch:
--- t/plugin/clickhouse-logger.t
+++ t/plugin/clickhouse-logger.t
@@ -149,7 +149,9 @@ property "endpoint_addr" is required
"password": "a",
"database": "default",
"logtable": "t",
- "endpoint_addr": "http://127.0.0.1:10420/clickhouse-logger/test"
+ "endpoint_addr": "http://127.0.0.1:10420/clickhouse-logger/test",
+ "batch_max_size":1,
+ "inactive_timeout":1
}
},
"upstream": {
@@ -173,7 +175,7 @@ property "endpoint_addr" is required
},
"plugins":{
"clickhouse-logger":{
- "batch_max_size":1000,
+ "batch_max_size":1,
"max_retry_count":0,
"retry_delay":1,
"ssl_verify":true,
@@ -185,7 +187,7 @@ property "endpoint_addr" is required
"name":"clickhouse-logger",
"database":"default",
"logtable":"t",
- "inactive_timeout":5
+ "inactive_timeout":1
}
},
"id":"1"
@@ -213,7 +215,7 @@ GET /opentracing
opentracing
--- error_log
clickhouse body: INSERT INTO t FORMAT JSONEachRow
-clickhouse headers: X-ClickHouse-Key:a
-clickhouse headers: X-ClickHouse-User:default
-clickhouse headers: X-ClickHouse-Database:default
---- wait: 5
+clickhouse headers: x-clickhouse-key:a
+clickhouse headers: x-clickhouse-user:default
+clickhouse headers: x-clickhouse-database:default
+--- wait: 2Now the test should pass.
There is another issue, the headers we get are all lowercase.
7f67ae3
4ad14a0 to
7f67ae3
Compare
7f67ae3 to
14e29f5
Compare
14e29f5 to
cede016
Compare
|
@zhendongcmss |
|
|
||
| ## Attributes | ||
|
|
||
| | 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 | |
There was a problem hiding this comment.
Hi @zhendongcmss, here have some Chinese 😄 Would you like to translate them?
What this PR does / why we need it:
feat: push access log to clickhouse DB
Pre-submission checklist: