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

Errors out when scraping CreateDate #3

Open
wuarthur opened this issue Jun 5, 2019 · 0 comments
Open

Errors out when scraping CreateDate #3

wuarthur opened this issue Jun 5, 2019 · 0 comments

Comments

@wuarthur
Copy link

wuarthur commented Jun 5, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant