Skip to content

Fix #32: keep driver_version as string (e.g. 460.32.03) to avoid ES f…#41

Open
deepujain wants to merge 1 commit intoeBay:masterfrom
deepujain:issue-32
Open

Fix #32: keep driver_version as string (e.g. 460.32.03) to avoid ES f…#41
deepujain wants to merge 1 commit intoeBay:masterfrom
deepujain:issue-32

Conversation

@deepujain
Copy link
Copy Markdown
Contributor

Summary of fix

Fixes #32. With driver versions like 460.32.03 (two dots), the beat could send driver_version in a way that led Elasticsearch to map it as float. Indexing then failed with mapper_parsing_exception: failed to parse field [driver_version] of type [float] and number_format_exception: multiple points. This change keeps driver_version and other string-only CSV columns as strings so ES no longer tries to parse them as float.

Changes made

  • nvidia/gpu.go
    Added a stringOnlyFields set for CSV columns that must never be parsed as float: driver_version, name, gpu_bus_id, gpu_uuid, process_name, gpu_name.
    In the CSV parsing loop, values for these columns are stored as strings; only other columns are parsed with strconv.ParseFloat (with string fallback on error).

  • nvidia/gpu_test.go
    Added Test_DriverVersion_WithTwoDots: uses a mock that returns CSV with driver_version=460.32.03 and asserts the event stores it as a string.

  • No config or default query changes; behavior is backward compatible.

Request to eBay maintainer
Please review and merge this PR when convenient. Thank you.

…ES float parse error

- Add stringOnlyFields in nvidia/gpu.go for columns that must not be parsed as float
- driver_version, name, gpu_bus_id, gpu_uuid, process_name, gpu_name stored as string
- Add Test_DriverVersion_WithTwoDots to verify driver_version 460.32.03 is string

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incompatible with driver version 460.32.03 (because of the two dots)

1 participant