GithubHelp home page GithubHelp logo

ovh / tsl Goto Github PK

View Code? Open in Web Editor NEW
56.0 18.0 6.0 322 KB

TSL is a HTTP proxy which generate WarpScript or a PromQl script based on a TSL query.

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.23% Go 92.32% ANTLR 6.43% JavaScript 0.01%
warp10 prometheus warpscript tsl promql golang

tsl's Issues

Implement setLabelFromName & extractLabelFromName() functions

I'd like to be able to set a new label from series names so I can use it in the query (for example with groupBy)

Example :

select(my.awesome.series.name.*.count)
  .where(...)
  .setLabelFromName("verb")
  .groupBy(verb, mean)

select(my.awesome.series.name.*.count)
  .where(...)
  .extractLabelFromName("verb","~MyRegex")
  .groupBy(verb, mean)

ANTLR grammar does not reflect the current state of TSL

It seems the ANTLR grammar file is not used by the project which instead uses a handcrafted parser, as a consequence, the grammar file does not seem to be updated whenever the features of the language evolve thus preventing implementations which rely on the ANTLR4 grammar to be up to date.

As an example, functions such as fill and fillValue are not present in the ANTLR files.

Are there any plans to actually use the grammar file for the go implementation so it would be kept up to date?

TSL implementation on python pandas

This is more a question rather than an issue.

I have seen in the roadmap that an implementation independent from the back-end is foreseen. Has an implementation on top of python pandas been considered? Would it make senses according to you?

Thanks in anticipation for your response.

Rename a series with a custom template

TSL already have .renameBy() function which allow us to rename a series with its labels.

For some use case, it could be interesting have template the name with a very custom string.

Can we extend .renameBy() function with the following behaviour ?

select('os.cpu').renameBy('${this.labels.hostname} (${this.labels.datacenter})' )
// produce a series named: "1.server.front (GRA)"

Ability to create a new series withe defined values

When I draw a graph with the result of a TSL query, I often need to add a custom series which can be for example an upper limit.

Is it possible to do it in TSL to perform the two operations at the same time

Exemple:

create(series('metrics.service.mads').setLabels('service=abcd').addValue(now, 150).addValue(now - 1h, 150)...) 

Sort series by label or name

Hello,

when I get mutiple series, I cannot predict how the list of series will be sorted. I would like to be able to sort the list of series based on the name or a label of the series.
This way I am sure series will always be displayed in the same order in Grafana.

Thank you,
Tristan

Create a npm package for TSL with wasm

Following #43, that could be nice to provide an npm package to integrate this project easily in a frontend project.

According to creating-node-js-modules from npm documentation, creating a package seem to be simple.
The requirements are:

  • Create a package.json file with a main entry
  • Propose a js file that will load the wasm ... but maybe isn't a good idea and we should let people this "custom" task and just provide an empty main.js
  • A TravisCI or whatever to recreate the package after each new version published.

[Bug] "to" keyword parsing seems to be broken

curl -d "select('requests_latency_seconds_count').where('role=0').from('2019-01-31T00:00:00+01:00',to='2019-02-01T00:00:00+01:00').finite().sampleBy(1h,last).group(sum).window(delta, 0, 1)" https://DESC:[email protected]/v0/query

{"error":"Cannot parsed query: Error when parsing "to" in "from" function, this variable isn't declared at line 1, char 91"}

quick fix resolution (removing the to= instruction) see below:
curl -d "select('requests_latency_seconds_count').where('role=0').from('2019-01-31T00:00:00+01:00', '2019-02-01T00:00:00+01:00').finite().sampleBy(1h,last).group(sum).window(delta, 0, 1)" https://DESC:[email protected]/v0/query

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.