Git Product home page Git Product logo

vm-patch-metrics's Introduction

vm-patch-metrics

vm-patch-metrics is a helper tool for VictoriaMetrics. I wrote it for removing "bad" points from metrics without losing the rest of the metrics.

What it does:

  1. Exports the matching metrics to a .jsonl file
  2. Removes datapoints from each line that fall within the -remove-start and -remove-end times, writing them to a new .jsonl file
  3. Deletes the matching metrics from VictoriaMetrics. (For all time!)
  4. Imports the metrics without the removed dates back into VictoriaMetrics.

This is a quick project and I won't guarantee you won't lose data in the process. You've been warned!

Usage:

Usage of vm-replace-metrics:
    -export-end string
        End time for the exported metrics (default: current time)
    -export-start string
        Start time for the exported metrics
    -file string
        File path to export metrics to (default "./metrics.jsonl")
    -match string
        Metric expression to export from VM
    -password string
        VM user password to authenticate
    -remove-end string
        End time of the points to remove from exported metrics (default: current time)
    -remove-start string
        Start time of the points to remove from exported metrics
    -url string
        VM url (default "http://localhost:8428")
    -user string
        VM user to authenticate
    -insecure bool
        Ignore server certificate issues

Example of removing December 1-4, 2022 data from data exported since Jan 1, 2020:

-user user -password password
-match 'my_cool_metric{mylabel="a", otherlabel=~"b_.*"}'
-export-start 2020-01-01T00:00:00+05:00
-remove-start 2022-12-01T00:00:00Z05:00
-remove-end 2022-12-05T00:00:00Z05:00

vm-patch-metrics's People

Contributors

tedpearson avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.