Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert string format to timestamp #315

Open
turalmirza opened this issue Jul 4, 2024 · 0 comments
Open

convert string format to timestamp #315

turalmirza opened this issue Jul 4, 2024 · 0 comments

Comments

@turalmirza
Copy link

{
"id": 329,
"username": "demo",
"last_activity_on": "2024-06-29"
}
hi , I have a json output like this.i use last_activity as label in my metrics. but in promtheus side when i want to list last_activiy users more than 30 day promtheus cant understant it. beacuse date format writing in label as a string format. how can i solve this problem?
here is my config file

modules:
gitlab:
metrics:
- name: user_info
type: object
help: "User ID fetched from JSON"
path: '{ [*] }'
labels:
username: '{.name}'
last_activity: '{.last_activity_on}'
values:
user_id: '{.id}'
http_client_config:
tls_config:
insecure_skip_verify: true

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

No branches or pull requests

1 participant