[Python] Retrieve first epoch time of dps from openTSDB

Discussão em 'Python' iniciado por Stack, Março 4, 2025.

  1. Stack

    Stack Membro Participativo

    I need to perform query operation on openTSDB to get the dps points for last 1 year. Suppose opentsdb is having dps only for last 1 month. There will be unnecessary quering happening for 11 more months.

    I tried below approach.

    curl -X POST -H "Content-Type: application/json" -d '{
    "start": "0",
    "queries": [
    {
    "metric": "abc",
    "aggregator": "sum"
    }
    ]
    }' http://localhost:4242/api/query | jq '.[0].dps | keys | .[0]'


    Is there a better/direct way to get the first data point in opentsdb beforehand? Please note, if I query for last 1 year for 1.7 billion dps, opentsdb throttles and terminate in between using the above query. So i need a way which can directly give me the first epoch time present in opentsdb.

    Continue reading...

Compartilhe esta Página