Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

how to remove stopped task from metrics #45

Closed
mxlxm opened this issue Feb 13, 2019 · 7 comments
Closed

how to remove stopped task from metrics #45

mxlxm opened this issue Feb 13, 2019 · 7 comments
Labels
question This issue is a question

Comments

@mxlxm
Copy link

mxlxm commented Feb 13, 2019

Question

Before asking a question, make sure you have:

how to remove stopped task(some test tasks) from dm-worker metrics?

@mxlxm mxlxm added the question This issue is a question label Feb 13, 2019
@csuzhangxc
Copy link
Member

csuzhangxc commented Feb 14, 2019

@mxlxm DM's metrics are stored in Prometheus, you can try https://prometheus.io/docs/prometheus/latest/querying/api/#delete-series.

@mxlxm
Copy link
Author

mxlxm commented Feb 14, 2019

@mxlxm DM's metrics are stored in Prometheus, you can try https://prometheus.io/docs/prometheus/latest/querying/api/#delete-series.

no, I mean some stopped task's metric info still present on dm-worker's metric page

@csuzhangxc
Copy link
Member

stopped task's metrics already stored in Prometheus, then Grafana still presents them.
so, you should delete them in Prometheus.

@mxlxm
Copy link
Author

mxlxm commented Feb 14, 2019

no, there's nothing about prometheus.
I created some test task, and then stopped them, query-status shows empty, but on dm-worker's x.x.x.x:8262/metrics page, those test task's metric still present. is there any possible way to remove them?

@csuzhangxc
Copy link
Member

@mxlxm I understand your question now.
This is because when stopping the task, metrics with task-name label were not removed. Maybe we should call some functions like DeleteLabelValues for metrics.

Now, I think you should restart the DM-worker to remove these metrics, and we can remove them automatically when stopping the task later. Or, you can open a PR to do that if you want. 😁

@mxlxm
Copy link
Author

mxlxm commented Feb 14, 2019

😅 haven't read the code, I'll try to do this this weekend.

@csuzhangxc
Copy link
Member

fixed in #575.

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

No branches or pull requests

2 participants