Git Product home page Git Product logo

promql_java_client's Introduction

Prometheus Query API Java Client Usage


Build API URL


RangeQuery

	RangeQueryBuilder rangeQueryBuilder =  QueryBuilderType.RangeQuery.newInstance(TARGET_SERVER);
	URI targetUri = rangeQueryBuilder.withQuery("irate(received_api_call_total[60s])")
		                 .withStartEpochTime(System.currentTimeMillis() / 1000 - 60*10)
		                 .withEndEpochTime(System.currentTimeMillis() / 1000)
		                 .withStepTime("60s")
		                 .build();

InstantQuery

	InstantQueryBuilder iqb = QueryBuilderType.InstantQuery.newInstance(TARGET_SERVER);
	URI targetUri = iqb.withQuery("irate(received_api_call_total[60s])").build();

LabelQuery

	LabelMetaQueryBuilder lmqb = QueryBuilderType.LabelMetadaQuery.newInstance(TARGET_SERVER);
	URI targetUri = lmqb.withLabel("pod").build();

Statuc(Config)Query

	StatusMetaQueryBuilder smqb = QueryBuilderType.StatusMetadaQuery.newInstance(TARGET_SERVER);
	URI targetUri = smqb.build();

TargetQuery

	TargetMetaQueryBuilder tmqb = QueryBuilderType.TargetMetadaQuery.newInstance(TARGET_SERVER);
	URI targetUri = tmqb.build();

AlertManagerQuery

	AlertManagerMetaQueryBuilder ammqb = QueryBuilderType.AlertManagerMetadaQuery.newInstance(TARGET_SERVER);
	URI targetUri = ammqb.build();

Parse Result


Parse Matrix Type Query Result

       DefaultQueryResult<MatrixData> result = ConvertUtil.convertQueryResultString(rtVal);

Parse Vector Type Query Result

       DefaultQueryResult<VectorData> result = ConvertUtil.convertQueryResultString(rtVal);

Parse Scalar Type Query Result

       DefaultQueryResult<ScalaData> result = ConvertUtil.convertQueryResultString(rtVal);

Parse Label API Result

       DefaultLabelResult result = ConvertUtil.convertLabelResultString(rtVal);

Parse Status(Config) API Result

       DefaultConfigResult result = ConvertUtil.convertConfigResultString(rtVal);

Parse Targets API Result

       DefaultTargetResult result = ConvertUtil.convertTargetResultString(rtVal);

Parse AlertManager API Result

       DefaultAlertManagerResult result = ConvertUtil.convertAlertManagerResultString(rtVal);

promql_java_client's People

Contributors

mckang avatar

Watchers

James Cloos 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.