Skip to content
This repository was archived by the owner on Sep 23, 2019. It is now read-only.
This repository was archived by the owner on Sep 23, 2019. It is now read-only.

Errors out when scraping CreateDate #3

@wuarthur

Description

@wuarthur

when I'm trying to export CreateDate the exporter fails because of an error in exposition.py in prometheus/client_python

More specifically when i have this line in my metrics.yaml
Users[].{create_date: CreateDate, value: 1}

The error is in this function, when v is expected to be a string, however CreateDate is returned as an datetime object, which cause v.replace('\\', r'\\') errors out.
image

this can be fixed by changing line 78 in exposition.py to k, str(v).replace('\\', r'\\').replace('\n', r'\n').replace('"', r'\"'))

I have made a fork here with the changes

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