Menu

#28 njmon hits "invalid field format" writing to InfluxDB v2 due to missing fields for "swaps" data

v1.0 (example)
closed
5
2025-10-30
2022-12-29
No

With the latest "final" version 80 of njmon for amd64 Linux, there appears to be a bug where , when writing to InfluxDB with the line protocol, "swaps" monitoring items lack InfluxDB "field" values.

For example, on a CentOS 7.9 system I have in AWS EC2:

sudo njmon -I -s5 -c 2880 -f

...

grep swaps ip-172-31-4-221_20221229_1709.influxlp
swaps,host=ip-172-31-4-221,os=CentOS,architecture=x86-64,serial_no=ec29021f-842d-388f-7f8e-35d833120959,mtm=HVM-domU
swaps,host=ip-172-31-4-221,os=CentOS,architecture=x86-64,serial_no=ec29021f-842d-388f-7f8e-35d833120959,mtm=HVM-domU
swaps,host=ip-172-31-4-221,os=CentOS,architecture=x86-64,serial_no=ec29021f-842d-388f-7f8e-35d833120959,mtm=HVM-domU

Notice above that there is the measurement (swaps) and tags. However there is no space followed by fields.

When attempting to write this to an InfluxDB v2 instance, we get a 404 due in "invalid field format":

InfluxDB Header buffer size=235 buffer=
==========
<POST /api/v2/write?bucket=spmon&org=IBM&precision=s HTTP/1.1
Host: localhost:8086
Authorization: Token b80cd8b9-2c03-4e3c-ba54-2b240446fe4f
Content-Type: text/plain; charset=utf-8
Accept: application/json
Content-Length: 12882

>
==========
Written=12882 bytes sent=0 total=12882
received bytes=406 data=<HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: 2.0.9
X-Platform-Error-Code: invalid
Date: Thu, 29 Dec 2022 17:13:53 GMT
Content-Length: 191

{"code":"invalid","message":"unable to parse 'swaps,host=ip-172-31-4-221,os=CentOS,architecture=x86-64,serial_no=ec29021f-842d-388f-7f8e-35d833120959,mtm=HVM-domU    ': invalid field format"}>
Code 400 -->HTTP/1.1 400 Bad Request<--
push complete

So it may be that these "swaps" data items are incomplete on this platform or perhaps there should be something that "scrubs" to ensure that InfluxDB measurements are complete before sending to the timer series DB?

Discussion

  • Nigel Griffiths

    Nigel Griffiths - 2025-10-30
    • status: open --> closed
    • assigned_to: Nigel Griffiths
     
  • Nigel Griffiths

    Nigel Griffiths - 2025-10-30

    Sorry, for the delay, this will be working in the next version = v91.
    The code did not cope with /procs/swaps file existing but empty.

     

Log in to post a comment.