haproxytech / client-native

Go client for HAProxy configuration and runtime API
Apache License 2.0
123 stars 54 forks source link

Some table field names are incorrect #47

Open aryantaheri opened 3 years ago

aryantaheri commented 3 years ago

According to documentation [1] and the dataplane spec [2] General Purpose Counter 0 field name is gpc0. There is an extra _ in the expected field name in [3] that breaks parsing stick table entries.

Here is an example:

Exec output:  0x7f80783a1750: key=<redacted> use=0 exp=86395752 gpt0=0 gpc0=484 gpc0_rate(30000)=5 http_err_rate(300000)=59
Parsed entry: &{BytesInCnt:<nil> BytesInRate:<nil> BytesOutCnt:<nil> BytesOutRate:<nil> ConnCnt:<nil> ConnCur:<nil> ConnRate:<nil> Exp:0xc000482d88 Gpc0:0xc000482d90 Gpc0Rate:<nil> Gpc1:<nil> Gpc1Rate:<nil> HTTPErrCnt:<nil> HTTPErrRate:0xc000482d98 HTTPReqCnt:<nil> HTTPReqRate:<nil> ID:0x7f80783a1750 Key:<redacted> ServerID:<nil> SessCnt:<nil> SessRate:<nil> Use:false}

The same applies to gpc0_rate, gpc1, and gpc1_rate.

The General Purpose Tag 0 gpt0 is not covered in the parser.

[1] https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4.2-stick-table%20type [2] https://github.com/haproxytech/dataplaneapi-specification/blob/5d0b7ffcb38214efeb6c7ba03c310223083c7138/models/runtime.yaml#L272 [3] https://github.com/haproxytech/client-native/blob/51acd2ab5fe3142974c16a87073cb87763047f77/runtime/stick_tables.go#L133-L134

aryantaheri commented 3 years ago

Should I open a separate issue for the missing gpt0 in the dataplaneapi-specification repository?

oktalz commented 3 years ago

hi @aryantaheri it seems this is a bug, thx for reporting this.

and regarding gpt0, we can track it here also, no need to open different issue. But if you prefer, you can also open new issue on specification.