Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/haproxy] failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; #30252

Closed
andrzej-stencel opened this issue Jan 2, 2024 · 4 comments · Fixed by #30269
Assignees
Labels
bug Something isn't working receiver/haproxy

Comments

@andrzej-stencel
Copy link
Member

Component(s)

receiver/haproxy

What happened?

Description

My client has a HAProxy instance and is using the HAProxy receiver to scrape metrics from the HAProxy v2.8 stats endpoint. The receiver scrapes most metrics correctly, but it throws errors for rows that don't have values set for the following columns: hrsp_1xx, hrsp_2xx, hrsp_3xx, hrsp_4xx, hrsp_5xx, hrsp_other.

Upon closer inspection of the stats dump file (see below), I noticed that the rows that don't have values set for these columns have mode column set to tcp and not http, which probably explains the lack of HTTP status code stats.

I would expect the receiver to not throw errors in this case, as it seems to be an expected behavior of the HAProxy stats page to not provide HTTP status stats for non-HTTP services.

Steps to Reproduce

  1. Expose the following stats file at URL http://localhost:8000/hapee-stats-redacted;csv for example by running python3 -m http.server in the directory where the file named hapee-stats-redacted;csv exists (note the ";csv" suffix).
hapee-stats-redacted;csv
# pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate_lim,rate_max,check_status,check_code,check_duration,hrsp_1xx,hrsp_2xx,hrsp_3xx,hrsp_4xx,hrsp_5xx,hrsp_other,hanafail,req_rate,req_rate_max,req_tot,cli_abrt,srv_abrt,comp_in,comp_out,comp_byp,comp_rsp,lastsess,last_chk,last_agt,qtime,ctime,rtime,ttime,agent_status,agent_code,agent_duration,check_desc,agent_desc,check_rise,check_fall,check_health,agent_rise,agent_fall,agent_health,addr,cookie,mode,algo,conn_rate,conn_rate_max,conn_tot,intercepted,dcon,dses,wrew,connect,reuse,cache_lookups,cache_hits,srv_icur,src_ilim,qtime_max,ctime_max,rtime_max,ttime_max,eint,idle_conn_cur,safe_conn_cur,used_conn_cur,need_conn_est,uweight,agg_server_status,agg_server_check_status,agg_check_status,srid,sess_other,h1sess,h2sess,h3sess,req_other,h1req,h2req,h3req,proto,-,h2_headers_rcvd,h2_data_rcvd,h2_settings_rcvd,h2_rst_stream_rcvd,h2_goaway_rcvd,h2_detected_conn_protocol_errors,h2_detected_strm_protocol_errors,h2_rst_stream_resp,h2_goaway_resp,h2_open_connections,h2_backend_open_streams,h2_total_connections,h2_backend_total_streams,h1_open_connections,h1_open_streams,h1_total_connections,h1_total_streams,h1_bytes_in,h1_bytes_out,h1_spliced_bytes_in,h1_spliced_bytes_out,ssl_sess,ssl_reused_sess,ssl_failed_handshake,quic_rxbuf_full,quic_dropped_pkt,quic_dropped_pkt_bufoverrun,quic_dropped_parsing_pkt,quic_socket_full,quic_sendto_err,quic_sendto_err_unknwn,quic_sent_pkt,quic_lost_pkt,quic_too_short_dgram,quic_retry_sent,quic_retry_validated,quic_retry_error,quic_half_open_conn,quic_hdshk_fail,quic_stless_rst_sent,quic_conn_migration_done,quic_transp_err_no_error,quic_transp_err_internal_error,quic_transp_err_connection_refused,quic_transp_err_flow_control_error,quic_transp_err_stream_limit_error,quic_transp_err_stream_state_error,quic_transp_err_final_size_error,quic_transp_err_frame_encoding_error,quic_transp_err_transport_parameter_error,quic_transp_err_connection_id_limit,quic_transp_err_protocol_violation_error,quic_transp_err_invalid_token,quic_transp_err_application_error,quic_transp_err_crypto_buffer_exceeded,quic_transp_err_key_update_error,quic_transp_err_aead_limit_reached,quic_transp_err_no_viable_path,quic_transp_err_crypto_error,quic_transp_err_unknown_error,quic_data_blocked,quic_stream_data_blocked,quic_streams_blocked_bidi,quic_streams_blocked_uni,h3_data,h3_headers,h3_cancel_push,h3_push_promise,h3_max_push_id,h3_goaway,h3_settings,h3_no_error,h3_general_protocol_error,h3_internal_error,h3_stream_creation_error,h3_closed_critical_stream,h3_frame_unexpected,h3_frame_error,h3_excessive_load,h3_id_error,h3_settings_error,h3_missing_settings,h3_request_rejected,h3_request_cancelled,h3_request_incomplete,h3_message_error,h3_connect_error,h3_version_fallback,pack_decompression_failed,qpack_encoder_stream_error,qpack_decoder_stream_error,
fe_main,FRONTEND,,,0,0,5000,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,2,0,,,,0,0,0,0,,,,0,0,0,0,0,0,,0,0,0,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,http,,0,0,0,0,0,0,0,,,0,0,,,,,,,0,,,,,,,,,,0,0,0,0,0,0,0,0,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
fe_hapee-stats,FRONTEND,,,2,3,5000,7,324334,148652767,0,0,0,,,,,OPEN,,,,,,,,,1,3,0,,,,0,1,0,1,,,,0,1440,0,0,1303,0,,1,1,2744,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,http,,1,1,7,0,0,0,0,,,0,0,,,,,,,0,,,,,,,,,,0,7,0,0,0,2744,0,0,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,7,2744,316345,148755037,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
be_hapee-stats,BACKEND,0,0,1,1,500,2744,324334,148652767,0,0,,1303,0,0,0,UP,0,0,0,,0,164386,,,1,4,0,,0,,1,1,,1,,,,0,1440,0,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,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,67,1,,0,,2,0,,0,L4OK,,2,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com-31090,uw1vmmykf102d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,67,2,,0,,2,0,,0,L4OK,,2,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com-31090,uw1vmmykf103d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,67,3,,0,,2,0,,0,L4OK,,2,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com-31090,uw1vmmykf104d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,67,4,,0,,2,0,,0,L4OK,,2,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com-31090,uw1vmmykf105d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,67,5,,0,,2,0,,0,L4OK,,1,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com-31090,uw1vmmykf106d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,67,6,,0,,2,0,,0,L4OK,,1,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com-31090,BACKEND,0,0,0,0,500,0,0,0,0,0,,0,0,0,0,UP,6,6,0,,0,164386,0,,1,67,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,0,0,0,0,0,0,0,-1,,,0,0,0,0,,,,,,,,,,,,,,http,,,,,,,,0,0,0,0,0,,,0,0,0,0,0,,,,,6,0,0,0,,,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com,uw1vmmykf101d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,68,1,,0,,2,0,,0,L4OK,,2,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com,uw1vmmykf102d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,68,2,,0,,2,0,,0,L4OK,,2,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com,uw1vmmykf103d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,68,3,,0,,2,0,,0,L4OK,,9,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com,uw1vmmykf104d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,68,4,,0,,2,0,,0,L4OK,,2,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com,uw1vmmykf105d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,68,5,,0,,2,0,,0,L4OK,,1,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com,uw1vmmykf106d,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,164386,0,,1,68,6,,0,,2,0,,0,L4OK,,3,0,0,0,0,0,0,,,,0,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 check passed,,2,3,4,,,,,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_kafkadev-my.example.com,BACKEND,0,0,0,0,500,0,0,0,0,0,,0,0,0,0,UP,6,6,0,,0,164386,0,,1,68,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,0,0,0,0,0,0,0,-1,,,0,0,0,0,,,,,,,,,,,,,,http,,,,,,,,0,0,0,0,0,,,0,0,0,0,0,,,,,6,0,0,0,,,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_navclientappqa.example.com_7147,uw1vmnvap002q,0,0,1,2,200,27357,0,0,,0,,0,27355,1,0,UP,1,1,0,4,0,164386,0,,1,69,1,,27356,,2,1,,1,L4OK,,1,,,,,,,,,,,0,27355,,,,,2,,,0,1,0,6009,,,,Layer4 check passed,,2,3,4,,,,,,tcp,,,,,,,,0,27357,0,,,0,,0,1003,0,6227,0,0,0,0,2,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_navclientappqa.example.com_7147,BACKEND,0,0,1,2,500,27356,0,0,0,0,,0,27355,1,0,UP,1,1,0,,0,164386,0,,1,69,0,,27356,,1,1,,1,,,,,,,,,,,,,,0,27355,0,0,0,0,2,,,0,1,0,6009,,,,,,,,,,,,,,tcp,,,,,,,,0,27357,0,,,,,0,1003,0,6227,0,,,,,1,0,0,0,,,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_navclientappqa.example.com_7148,uw1vmnvap002q,0,0,1,2,200,27357,0,0,,0,,0,27355,1,0,UP,1,1,0,2,0,164386,0,,1,70,1,,27356,,2,1,,1,L4OK,,1,,,,,,,,,,,0,27355,,,,,1,,,0,1,0,6009,,,,Layer4 check passed,,2,3,4,,,,,,tcp,,,,,,,,0,27357,0,,,0,,0,1004,0,6680,0,0,0,0,2,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_navclientappqa.example.com_7148,BACKEND,0,0,1,2,500,27356,0,0,0,0,,0,27355,1,0,UP,1,1,0,,0,164386,0,,1,70,0,,27356,,1,1,,1,,,,,,,,,,,,,,0,27355,0,0,0,0,1,,,0,1,0,6009,,,,,,,,,,,,,,tcp,,,,,,,,0,27357,0,,,,,0,1004,0,6680,0,,,,,1,0,0,0,,,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
fe_staging_sitecoredbV10,FRONTEND,,,0,0,5000,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,119,0,,,,0,0,0,0,,,,,,,,,,,0,0,0,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,tcp,,0,0,0,,0,0,0,,,,,,,,,,,0,,,,,,,,,,0,0,0,0,0,0,0,0,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
be_staging_sitecoredbV10,uw1vmscdb201s,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,1,1,164377,164377,,1,128,1,,0,,2,0,,0,L4CON,,1,,,,,,,,,,,0,0,,,,,-1,No route to host,,0,0,0,0,,,,Layer4 connection problem,,99999999,3,0,,,,,,tcp,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_staging_sitecoredbV10,uw1vmscdb231s,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,0,1,1,1,164377,164377,,1,128,2,,0,,2,0,,0,L4CON,,1,,,,,,,,,,,0,0,,,,,-1,No route to host,,0,0,0,0,,,,Layer4 connection problem,,2,3,0,,,,,,tcp,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_staging_sitecoredbV10,uw1vmscdb261s,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,0,1,1,1,164377,164377,,1,128,3,,0,,2,0,,0,L4CON,,1,,,,,,,,,,,0,0,,,,,-1,No route to host,,0,0,0,0,,,,Layer4 connection problem,,2,3,0,,,,,,tcp,,,,,,,,0,0,0,,,0,,0,0,0,0,0,0,0,0,1,1,,,,0,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
be_staging_sitecoredbV10,BACKEND,0,0,0,0,500,0,0,0,0,0,,0,0,0,0,DOWN,0,0,0,,1,164377,164377,,1,128,0,,0,,1,0,,0,,,,,,,,,,,,,,0,0,0,0,0,0,-1,,,0,0,0,0,,,,,,,,,,,,,,tcp,,,,,,,,0,0,0,,,,,0,0,0,0,0,,,,,0,0,0,0,,,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  1. Run the collector with the below configuration.

The above stats file is a dump of an actual stats page from my client's HAProxy, only slightly redacted for clarity - removed a bunch of irrelevant services (rows) and changed the client's domain name to "example.com".

The above stats file contains eleven non-HTTP (TCP) services. This results with one error message per every scrape, containing 66 = 11 * 6 errors complaining about not being able to parse an empty string into an integer value.

Expected Result

No errors are reported by the receiver.

Actual Result

An error is reported on every scrape, see below for the log output.

Collector version

v0.91.0

Environment information

No response

OpenTelemetry Collector configuration

exporters:
  debug:
receivers:
  haproxy:
    endpoint: http://localhost:8000/hapee-stats-redacted
service:
  pipelines:
    metrics:
      exporters:
      - debug
      receivers:
      - haproxy

Log output

Errors in systemd (time in UTC)
Dec 28 18:20:19 uw1vmlbha101t otelcol-sumo[2552579]: 2023-12-28T18:20:19.857Z        error        scraperhelper/scrapercontroller.go:200        Error scraping metrics        {"kind": "receiver", "name": "haproxy", "data_type": "metrics", "error": "failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax; failed to parse int64 for HaproxyRequestsTotal, value was : strconv.ParseInt: parsing \"\": invalid syntax", "scraper": ""}
Dec 28 18:20:19 uw1vmlbha101t otelcol-sumo[2552579]: go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport
Dec 28 18:20:19 uw1vmlbha101t otelcol-sumo[2552579]:         go.opentelemetry.io/collector/receiver@v0.89.0/scraperhelper/scrapercontroller.go:200
Dec 28 18:20:19 uw1vmlbha101t otelcol-sumo[2552579]: go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1
Dec 28 18:20:19 uw1vmlbha101t otelcol-sumo[2552579]:         go.opentelemetry.io/collector/receiver@v0.89.0/scraperhelper/scrapercontroller.go:172

Additional context

No response

@andrzej-stencel andrzej-stencel added bug Something isn't working needs triage New item requiring triage labels Jan 2, 2024
Copy link
Contributor

github-actions bot commented Jan 2, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme atoulme removed the needs triage New item requiring triage label Jan 2, 2024
@atoulme atoulme self-assigned this Jan 2, 2024
@atoulme
Copy link
Contributor

atoulme commented Jan 2, 2024

I have tried to run with your CSV but I get errors that the number of fields on line 4 doesn't match. I will use an other approach to reproduce.

@andrzej-stencel
Copy link
Member Author

andrzej-stencel commented Jan 3, 2024

I have tried to run with your CSV but I get errors that the number of fields on line 4 doesn't match. I will use an other approach to reproduce.

@atoulme Just remember that the HAProxy receiver appends that ;csv suffix to the endpoint you specify in the configuration. So if you specify the endpoint as http://localhost:8000/stats, you need to make sure that the stats are actually reachable at http://localhost:8000/stats;csv. At least this is where I had my issues. I originally exposed the stats file at http://localhost:8000/stats.csv, but the receiver was actually getting http://localhost:8000/stats.csv;csv and getting a 404 page from the Python server. The receiver then tried to parse that 404 page and complained with a similar nonspecific parse error.

I just tried again and the above specified stats file works fine "on my machine" ™️ 😉

@atoulme
Copy link
Contributor

atoulme commented Jan 3, 2024

No such luck for me. Please review my fix: #30269

dmitryax pushed a commit that referenced this issue Jan 4, 2024
**Description:** 
support haproxy stats displaying empty values.

**Link to tracking Issue:**
Fixes #30252 

**Testing:**
Add an integration test with a record with empty values.
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Jan 10, 2024
**Description:** 
support haproxy stats displaying empty values.

**Link to tracking Issue:**
Fixes open-telemetry#30252 

**Testing:**
Add an integration test with a record with empty values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/haproxy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants