chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

Raw query editor for kapacitor

Open adityacs opened this issue 9 years ago • 19 comments

I don't see the following features in chronograf currently. Adding this would be very helpful.

  1. Raw query editor for writing Kapacitor scripts.
  2. UI for writing script to take action on alert. ".exec" integration.

Thanks

adityacs avatar Jan 23 '17 11:01 adityacs

Hi @adityacs 2) should be handled with #782. We have plans for a raw query editor, but I don't think there is a proper ticket yet. I am editing 2) out of the title and I will use this issue as a starting point for 1).

nhaugo avatar Jan 24 '17 17:01 nhaugo

@nhaugo Thanks

adityacs avatar Jan 24 '17 18:01 adityacs

@adityacs Hey I am working on the design of Chronograf, wondering if you would be willing to hop on a google hangout and I could pick your brain about the Kapacitor Raw Editor idea?

alexpaxton avatar Jan 25 '17 23:01 alexpaxton

@alexpaxton Let me know what time is suitable for you. I can join

adityacs avatar Jan 27 '17 05:01 adityacs

+1 on raw query editor. Also, It would be great if you could just straight up edit/manage tick scripts in chronograph via a dumb text editor. Tick scripts are so expressive that it would be difficult to create a UI that maps to all of the features.

allen13 avatar Feb 06 '17 15:02 allen13

@allen13 you are totally right. TICKscripts are really expressive. @alexpaxton has been working on a raw editor. @allen13, what sorts of features would you like in that type of editor? I'm thinking at least it would "validate" the TICKscript before sending it to kapacitor.

goller avatar Feb 06 '17 16:02 goller

All I need is . Anything else is just icing on the cake. Validation and syntax highlighting would be at the top of my list after that.

allen13 avatar Feb 06 '17 16:02 allen13

+1 for @allen13 idea. Currently we can't write queries like this "select 100 - mean($x) + mean($y)". A simple editor should allow me to do this. Also, adding validation to this would be good feature.

adityacs avatar Feb 07 '17 07:02 adityacs

+1 for validation

smetroid avatar Feb 07 '17 20:02 smetroid

Notes for later for syntax coloring: https://github.com/nathanielc/vim-tickscript https://github.com/bubba-h57/language-tick https://marketplace.visualstudio.com/items?itemName=mattyjones.vscode-tickscript

goller avatar Feb 07 '17 22:02 goller

@alyan2008 Wouldn't it be better if we focused our efforts on Chronograph? The react code powering it is pretty straightforward to work with and all of the groundwork for a kapacitor ui has been done. I do understand that you may have custom needs though.

allen13 avatar Feb 08 '17 20:02 allen13

@alyan2008 @allen13 I'm hoping we'll do this in our next sprint, although, I suspect we'll be working on our dashboard solution.

However, if you wanted to help contribute this feature that would be awesome!

goller avatar Feb 09 '17 03:02 goller

However, if you wanted to help contribute this feature that would be awesome!

Does this statement still hold? This is would be a meaty one to take on, but I'm somewhat interested in contributing this (if I can find the time). Don't want to step on someone's toes if this is already in flight.

mpchadwick avatar May 25 '17 16:05 mpchadwick

Hey @mpchadwick , it's not yet in flight, no. We'd love that kind of contribution!

In the broadest outline the chronograf server's Generate function would need to either use the QueryConfig structure or if it is nil use TICKScript (https://github.com/influxdata/chronograf/blob/master/chronograf.go#L236-L237 & https://github.com/influxdata/chronograf/blob/master/kapacitor/tickscripts.go#L15)

For the javascript, we'd need a new component that edited the raw tick script. Here is where tickscripts without queries are handled today: https://github.com/influxdata/chronograf/blob/master/ui/src/kapacitor/components/KapacitorRulesTable.js#L64

goller avatar May 25 '17 18:05 goller

@mpchadwick It'd be awesome if you want to take this on. You might refer to https://github.com/influxdata/chronograf/pull/1537 (once it's approved, finalized, and merged) for how this could be implemented.

jaredscheib avatar May 25 '17 21:05 jaredscheib

@mpchadwick I have a UI design for this feature put together already, I can walk you through it via hangout or screenshare

alexpaxton avatar May 25 '17 21:05 alexpaxton

@alexpaxton is it in a form that would allow upload to this issue? not sure when I can schedule a screenshare, but if you have PDF of something i can try to start from that.

mpchadwick avatar May 26 '17 16:05 mpchadwick

This feature is an urgent requirement for us. How early can we expect this to be done?

adityacs avatar Jun 27 '17 11:06 adityacs

See #1663.

jaredscheib avatar Jun 27 '17 17:06 jaredscheib