databendlabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.85k stars 750 forks source link

feat(query): add table function udf_echo && expose more metrics of udf client #16696

Closed sundy-li closed 2 weeks ago

sundy-li commented 2 weeks ago

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

feat: add udf_echo table function && expose more metrics of udf client

after https://github.com/databendlabs/databend-udf/pull/11

  1. udf_echo table function

example:

select * from udf_echo('http://m1:8815', 'abc');
┌────────┐
│ result │
│ String │
├────────┤
│ abc    │
└────────┘
  1. add more metrics of udf client, now udf client has metrics as below.
| external_requests_total                 | counter   | {"function_name":"wait"}  |
│ external_running_requests_total  │ counter   │ {"function_name":"wait"}  |

│ external_connect_duration_sum     │ untyped    │ {"function_name":"wait"}  |
│ external_connect_duration_count   │ untyped    │ {"function_name":"wait"}  |
│ external_connect_duration_bucket │ histogram │ {"function_name":"wait"}  |

│ external_request_duration_sum    │ untyped   │ {"function_name":"wait"}  |
│ external_request_duration_count  │ untyped   │ {"function_name":"wait"}  |
│ external_request_duration_bucket │ histogram │ {"function_name":"wait"}  |

│ external_retry_total             │ counter   │ {"function_name":"wait","error_kind":"ConnectError"} │
│ external_error_total             │ counter   │ {"function_name":"wait","error_kind":"ConnectError"} │

Tests

Type of change


This change is Reviewable