Skip to content

very small change to fix errors when handling datetime object from aws#422

Closed
wuarthur wants to merge 1 commit intoprometheus:masterfrom
wuarthur:master
Closed

very small change to fix errors when handling datetime object from aws#422
wuarthur wants to merge 1 commit intoprometheus:masterfrom
wuarthur:master

Conversation

@wuarthur
Copy link
Copy Markdown

@wuarthur wuarthur commented Jun 5, 2019

Hi, I am trying to export CreateDate using the aws-prometheus-exporter the exporter fails because of an error in [exposition.py ]

there seems to be an type error in this function, when v is expected to be a string, however sometimes aws return datas as an datetime object, which cause v.replace('\\', r'\\') errors out.
image

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

@wuarthur wuarthur force-pushed the master branch 2 times, most recently from c4272c5 to dba69f0 Compare June 5, 2019 18:08
@brian-brazil
Copy link
Copy Markdown
Contributor

Can you add a unittest for this?

@brian-brazil
Copy link
Copy Markdown
Contributor

This has gone stale, let us know if you still want to work on this.

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.

2 participants