我正在使用这个prometheus出口商出口商,我不知道如何使用strftime参数。它需要使用来自https://docs.python.org/3/library/time.html#time.strftime的格式。据我所知,应该定义一个字符串。如果我设置:
strftime: '%Y-%m-%d'并将变量用作
params:
start_date: $strftime我有这个错误
Traceback (most recent call last):
File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/site-packages/json_exporter/main.py", line 257, in run
self.scrape()
File "/usr/local/lib/python2.7/site-packages/json_exporter/main.py", line 279, in scrape
data = render(self.body, variables)
File "/usr/local/lib/python2.7/site-packages/json_exporter/main.py", line 125, in render
return Template(tmpl).safe_substitute(variables)
File "/usr/local/lib/python2.7/string.py", line 207, in safe_substitute
return self.pattern.sub(convert, self.template)
TypeError: expected string or buffer使用这个的正确方法是什么?
谢谢。
https://stackoverflow.com/questions/71022332
复制相似问题