From da3f4353fd13bd8b73595b481276c752cf5b3165 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Wed, 11 Sep 2024 11:07:37 -0700 Subject: [PATCH] httpstats: fix spelling error in metric tag Version numbers are cheap, so let's just bump to version 5.0.0 to make clear to people who may be affected that something is changing. Fixes #168. --- HISTORY.md | 8 ++++++++ datadog/client_test.go | 20 ++++++++++---------- httpstats/metrics.go | 4 ++-- 3 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 HISTORY.md diff --git a/HISTORY.md b/HISTORY.md new file mode 100644 index 0000000..319c3cd --- /dev/null +++ b/HISTORY.md @@ -0,0 +1,8 @@ +# History + +### v5.0.0 (Released on September 11, 2024) + +In the `httpstats` package, replace misspelled `http_req_content_endoing` +and `http_res_content_endoing` with `http_req_content_encoding` and +`http_res_content_encoding`, respectively. This is a breaking change; any +dashboards or queries that filter on this tag must be updated. diff --git a/datadog/client_test.go b/datadog/client_test.go index e3dd9af..daca79a 100644 --- a/datadog/client_test.go +++ b/datadog/client_test.go @@ -102,16 +102,16 @@ func TestClientWithUseDistributions(t *testing.T) { } func TestClientWriteLargeMetrics(t *testing.T) { - const data = `main.http.error.count:0|c|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity -main.http.message.count:1|c|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request -main.http.message.header.size:2|h|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request -main.http.message.header.bytes:240|h|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request -main.http.message.body.bytes:0|h|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request -main.http.message.count:1|c|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_endoing:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response -main.http.message.header.size:1|h|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_endoing:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response -main.http.message.header.bytes:70|h|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_endoing:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response -main.http.message.body.bytes:839|h|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_endoing:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response -main.http.rtt.seconds:0.001215296|h|#http_req_content_charset:,http_req_content_endoing:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_endoing:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response + const data = `main.http.error.count:0|c|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity +main.http.message.count:1|c|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request +main.http.message.header.size:2|h|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request +main.http.message.header.bytes:240|h|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request +main.http.message.body.bytes:0|h|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,operation:read,type:request +main.http.message.count:1|c|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_encoding:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response +main.http.message.header.size:1|h|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_encoding:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response +main.http.message.header.bytes:70|h|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_encoding:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response +main.http.message.body.bytes:839|h|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_encoding:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response +main.http.rtt.seconds:0.001215296|h|#http_req_content_charset:,http_req_content_encoding:,http_req_content_type:,http_req_host:localhost:3011,http_req_method:GET,http_req_protocol:HTTP/1.1,http_req_transfer_encoding:identity,http_res_content_charset:,http_res_content_encoding:,http_res_content_type:application/json,http_res_protocol:HTTP/1.1,http_res_server:,http_res_transfer_encoding:identity,http_res_upgrade:,http_status:200,http_status_bucket:2xx,operation:write,type:response ` count := int32(0) diff --git a/httpstats/metrics.go b/httpstats/metrics.go index 7051125..83c8b66 100644 --- a/httpstats/metrics.go +++ b/httpstats/metrics.go @@ -156,7 +156,7 @@ type metrics struct { msgtype string `tag:"type"` contentCharset string `tag:"http_res_content_charset"` - contentEncoding string `tag:"http_res_content_endoing"` + contentEncoding string `tag:"http_res_content_encoding"` contentType string `tag:"http_res_content_type"` protocol string `tag:"http_res_protocol"` server string `tag:"http_res_server"` @@ -167,7 +167,7 @@ type metrics struct { } contentCharset string `tag:"http_req_content_charset"` - contentEncoding string `tag:"http_req_content_endoing"` + contentEncoding string `tag:"http_req_content_encoding"` contentType string `tag:"http_req_content_type"` host string `tag:"http_req_host"` method string `tag:"http_req_method"`