Skip to content

Feature suggestion: Configuration for translating non float values into float64 #298

Open
@delley123

Description

@delley123

Sometimes a JSON result is not float value. And thus can not be parsed to an float64.
Example error: (msg="Failed to convert extracted value to float64" path={.state} value=GREEN err="strconv.ParseFloat: parsing "GREEN": invalid syntax; strconv.ParseFloat: parsing "GREEN")

It could be great to be able to configure a "translator" value.
Example:

  • name: example_global_value
    path: '{ .counter }'
    help: Example of a top-level global value scrape in the json
    labels:
    environment: beta # static label
    location: 'planet-{.location}' # dynamic label
    translate:
    GREEN: "0"
    AMBER: "1"
    RED: "2"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions