Search code examples
hbaseopentsdb

Can i delete a single data point in OpenTSDB


I am using OpenTSDB to store my time series data, but if I want to delete any data point, I am not able to find a right solution, if I go according to their documentation, the data for that whole hour also gets deleted, which is not exactly serving the purpose, Do anyone know of any other way.


Solution

  • I believe you can do so via a /query and instruct OpenTSDB to delete the queried data.

    According to OpenTSDB latest documentation:

    delete  Boolean Optional    Can be passed to the JSON with a POST to delete any data points that match the given query. false       W   true
    

    To do so, either:

    1. query but using verb DELETE
    2. POST with a delete=true in your json body

    Examples

    {
        "start": 1356998400,
        "end": 1356998460,
        "delete": true,
        "queries": [
            {
                "aggregator": "sum",
                "metric": "sys.cpu.0",
                "rate": "true",
                "tags": {
                    "host": "*",
                    "dc": "lga"
                }
            },
        ]
    }
    

    Reference: http://opentsdb.net/docs/build/html/api_http/query/index.html