First pass at flux AST generation from check
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): format call expression
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): cleanup CheckDefinition
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): clean up threshold functions
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): clean up message function
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): misc fixes
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): remove dead code
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): move threshold flux generation to check pkg
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): move base ast generation to its own package
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
fix(notification/check): add comment for GenerateFluxAST
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
docs(notification/flux): add comments to each exported function
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
feat(notification/check): add tests for GenerateFlux
Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>
feat(notification/check): add task options to generated flux
fix(notification/check): use flux compatible duration type
test(notification/check): add task option to task definition
test(http): use check Duration in checks http handlers
feat(check): add TaskID to checks base
fix(notification/check): hack around issue with formatting ast package
wtih multiple files
test(check): create task when check is created
A lot of little changes had to happen as a result of this. This change
was rather painful.
feat(checks): add update and delete of task for check
fix(notifications/check): hack around the alerts package not being
available
test(kv): temporarily skip check tests while we merge the pr above
* adding new templates; removing calls to create templates
* fixing quickstart dashboard creation
* Type dashboard template
* bump templates repo version
* add templateID to template meta in swagger
* Add templateID to document meta type in UI
* add templateID to telegrafPlugin and telegrafplugin info types
* Instantiate templates from static templates
* Get tests to pass
* Fix type conflicts
* Bump templates version
* update changelog
* Use CheckPlot to visualize check view
* Revert to add threshold types
* Disable view type dropdown in checkView
* Add proper equality
* Add errors in default cases
This will only attempt to parse an error as JSON if it has the content
type `application/json` so that it stops trying to parse the result as
JSON when it isn't JSON.
While the real error message is included, the addition of the "could not
parse json" makes it very confusing to read and distracts from the real
issue.
* chore: add new types for NotiicationRules
* build(client): remove client and build each build
* chore: update gitignore to exclude generated client
* fix: allow client dir to be empty
* docs: add README to client dir
* fix(build): add autogen client to eslintignore
* build: gen client for ci js tests
* Add check saving flows and change activeTab type
* Add first pass at alertBuilder
* Change TimeMachineEnum type
* Add xy view properties to checks, and convert to and from check View type
* Add Column Header to checks column
* Add change current check type action
* Access view type through properties
* Load xy view options for check view
* Add orgID to check in createCheck
* Clear current check on close CheckEO
* Create Check Alerting Button
* Create check view on edit and new check EO
* Fix edit check eo action bug
* Update threshold types
* When switch schedule from every to cron change the inputs that are visible
* save Current Check from VEO if view type is check
* Add description component to checks
* TimeMachineIDs to TimeMachineID
* Remove bracketed object decleration
* Remove as Threshold type
* Use ViewType instead of typeof
* Create CheckType type
* Remove time machine reducer tests
* Remove check view properties that come from xyView
* Fix EditCheck hooks
* Move status calculations to body of function
* Update redux store when performing check CRUD
* Create add and remove check actions in timeMachine
* Remove trailing space
* Define new check, edit check and check view routes with VEO
Co-authored-by: Michael Desa <mjdesa@gmail.com>
* Add task status to other task types
* Put editAlerting route behind feature flag
* add action and reducer for update current check
* Add init edit and new check editor overlay
* Split VEO in to two for new and edit view
* get edit and new CheckEO's ready
* Create getViewForTimeMachine action
* current check should be a partial check
* Fix view typing
* Fix linter errors
* Fix equality
* Catch save VEO errors
If client requests with Accept-Encoding: gzip, then
compress response and return with Content-Encoding: gzip.
This increases the server-side load by about 12%, but saves network bandwidth.
benchmark old ns/op new ns/op delta
Benchmark_Query_no_gzip-4 123609 137885 +11.55%
benchmark old allocs new allocs delta
Benchmark_Query_no_gzip-4 149 150 +0.67%
benchmark old bytes new bytes delta
Benchmark_Query_no_gzip-4 14297 15205 +6.35%
* bump to client 0.5.3
* export Query type from client and create alerting mock
* Bump client to 0.5.5
* Merge all status enums to one type
* Fix threshold visualization types
* Add extra underscore to notification rules
* Use check view type from client
* Add description field to checks, notificationrules and endpoints
* Add init check cards
* Add check card actions
* Correct component name
* Add check card context and toggle
* Add id to notification rule base
* Add notification rule cards
* add checks reducer tests
* user immer for checks reducer
* add tests and immer to notification rule reducer
If we handle the flux errors in the query controller, it makes it so we
are handling the errors in the location where the happen rather than at
a layer further up the stack.
This should simplify it so the errors are handled in this single
location instead.
* Add discriminator and enum to check types
* Add threshold discriminators and type enum
* Add notification rule discriminators and type enum
* Remove description field
* Fix reference to threshold base
* Move types to ViewBase type from each View Property
* Fix view properties
* Add monotonex to swagger options
* Add empty to view types
* remove whitespace
* Rename check schema to healthcheck
* add alert schema and endpoints
* Add checkView as a view type
Co-Authored-By: Jade McGough <jademcgough@users.noreply.github.com>
Co-authored-by: Jade McGough <jade@influxdata.com>
* Add session renew option to launcher and use in middlewhere
* pass session options to services
* Update SessionAutoRenew to SessionRenewDisabled
* Add test for service constructor defaults
* Update changelog
The API slightly changed: LoadSwaggerFromYAMLData is now replaced
by LoadSwaggerFromData.
See: https://github.com/getkin/kin-openapi/pull/67
Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
If the error returned was normal text instead of JSON, the JSON parsing
would fail and the JSON error would be returned instead of the actual
error.
This has been modified so that when it fails to parse the text as JSON,
it will construct an error with the actual text and then wrap it using
the JSON error.
When printing out a stacktrace with a logged error message, it is better
to set the `Stack` property on the entry than to include it as a string
within the context fields. It is also better than using `zap.Stack()`
too.
This is because certain encoders will perform a pretty print of the
stacktrace. The default zap-logfmt will read this property and include
it as a field so this code is identical when using that encoder, but the
console encoder, which is commonly used in local development because it
is automatically used with a TTY available, will print out a newline and
pretty print the stacktrace if it is included on the entry itself.
feat(http): add prometheus counters for tracking write/query usage
feat(http/metric): add metric recoder for recording http metrics
feat(prometheus): implement metric.Recorder for prometheus metrics
fix(prometheus): remove erroneous fmt.Printlns
feat(http): add prometheus registry to API backend
This was done as exposing prometheus metrics to a higher level was quite
difficult. It was much simple to simply pass the registry down to
anything that needs it.
feat(cmd/influxd/launcher): pass prom registry in on api backend
feat(http): collect metrics for write and query endpoints
This was much messier than I would have preferred. Future work is
outlined in TODOs.
review(influxdb): rename metric.Metric to metric.Event