Giter Club home page Giter Club logo

grafana-sensu-go-datasource's Introduction

sensu

Build Status Gem Version MIT Licensed Join the chat at https://slack.sensu.io/

⚠️ ANNOUNCEMENT - Sensu 1.x has reached End-Of-Life (December 31st, 2019)

The Sensu 1.x project reached end-of-life on December 31st, 2019. The existing package repositories became unreachable on January 6th, 2020. Please see our blog post for more details: https://blog.sensu.io/announcing-the-sensu-archives

Sensu 1.x has been superseded by Sensu Go.

As always, we want to hear from the Community and please reach out on Slack or Discourse if you have any questions or concerns.

Sensu

A simple, malleable, and scalable framework for composing the monitoring system you need.

Sensu is offered in two flavors:

  • Sensu Core - this open source project
  • Sensu Enterprise - a full-featured commercial implementation, built on Sensu Core

Installation

Sensu supports a number of Unix-like platforms, as well as Windows. Please see the list of supported platforms for installation instructions.

Documentation

Please refer to the online documentation for details on configuring and operating Sensu.

Getting Help

If you have questions not covered by the documentation, the Sensu community is here to help. Please check out our chat on Slack, or the sensu-users discussion list.

Commercial support is also available. See the support section of our website for more detail.

Contributing

Please observe these guidelines on contributing.

License

Sensu Core is released under the MIT license.

grafana-sensu-go-datasource's People

Contributors

apaskulin avatar blufor avatar dependabot[bot] avatar fguimond avatar mariusbrill avatar mariusoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-sensu-go-datasource's Issues

API call using globbed namespace names in a repeating panel/row

Trying to make a simple status dashboard that shows passing/failed checks from multiple namespaces. In the dashboard settings:

Variable Definition
$namespace QUERY API namespaces SELECT name

Variable has 'multi-value' and 'all' enabled.

The row is configured:

  • Title - "health checks - $namespace"
  • Repeat for - namespace

Then, there are singlestat panels in the template row for check statuses 0, 1, 2.
One such panel uses this query:

QUERY API namespaces SELECT name

This works great when there is only one namespace selected at the top of the page, however when we add multiples or All, all the singlestat panels read 0.

Looking at the query inspector gives away the issue:

{
  "xhrStatus": "complete",
  "request": {
    "method": "GET",
    "url": "api/datasources/proxy/9/api/core/v2/namespaces/{default,dev,prod,qa}/events"
  },
  "response": []
}

Aha, the datasource is using all the values globbed together instead of using one at a time like the row does.

So, if there is a workaround please let us know! I'm sure this is a common enough use case for Grafana+Sensu Go.

Thanks for looking into this!

Filtering happens after event LIMIT ?

If this behavior is working as intended then feel free to close this, but I would imagine the LIMIT would apply after any filtering occurs.

In my current sensu-go setup (5.14.1) I have around ~14k events at any given moment according to the web UI.

I have the following filters in place:
image

In the Sensu web UI, if I select 'Status:Incident' as the filter, I get 3 events.
Screenshot from 2019-10-25 10-04-34

In Grafana If I lower the LIMIT value to below the total number of events, I will get 0 events returned.
image

Bring the LIMIT to above the number of events and I get the 3 incidents listed.

Screenshot from 2019-10-25 10-10-45

This possibly has to do with the fact that the checks start with Z and would probably be at the end of that list.

Using sensugo-datasource version 1.0.2 and grafana 6.4.3

# grafana-cli plugins ls
installed plugins:
sensu-sensugo-datasource @ 1.0.2 
# grafana-cli -v
Grafana cli version 6.4.3

Add support for using variables in variable queries

Add support for using variables (e.g. $namespace) in variable queries.

Example:

  1. Create a variable that collects a list of namespaces
  2. Create a second variable (e.g. $entity) that collects a list of entities
  3. Modify the $entity variable to be scoped by $namespace

Error when using IN and NOTIN operators with multiple values

Hi,

Attempting to use in and notin operators with multiple values, it seems to fail based on the expectation that it should be a list.

Object
request:Object
method:"GET"
url:"api/datasources/proxy/1/api_key_auth/api/core/v2/namespaces/engineering/events"
params:Object
fieldSelector:"event.check.status == "2""
labelSelector:"annotations.sample "(ABC|DEF|HIJ)""
hideFromInspector:false
response:Object
message:"could not parse the operations: found '(ABC|DEF|HIJ)', expected '['"
code:1

Plugin signature support

We should sign our plugin to be compatible with Grafana's plugin signature verification:

Plugin signature verification (signing) is a security measure to make sure plugins haven’t been tampered with. Upon loading, Grafana checks to see if a plugin is signed or unsigned when inspecting and verifying its digital signature.

At startup, Grafana verifies the signatures of every plugin in the plugin directory. If a plugin is unsigned, then Grafana does not load nor start it. To see the result of this verification for each plugin, navigate to Configuration -> Plugins.

Grafana also writes an error message to the server log:

WARN[05-26|12:00:00] Some plugin scanning errors were found   errors="plugin '<plugin id>' is unsigned, plugin '<plugin id>' has an invalid signature"

See the Grafana plugin signing developer documentation for more information.

LIMIT is applied to aggregated queries

The default for a field type data query is to limit the results to 100. However, when the selector is changed to Aggregation, the limit still applies but the limit field is removed from view.

This means a query where you want to return a count of the entities, it will always be 100 if the numbers are greater than 100.

As I can see that the aggregation is Grafana / browser side, I'm not sure if the limit should be removed completely or at least displayed to allow an override.

Add support for fetching resources from "all" namespaces

Sensu Go has API endpoints for fetching resources from "all namespaces".

Examples:

  • GET http://127.0.0.1:8080/api/core/v2/events
  • GET http://127.0.0.1:8080/api/core/v2/entities

These endpoints could be used along with Grafana variables Sensu Go's API response filtering to create Grafana dashboards that show "all" resource (e.g. all entities), with a drop-down (Grafana variable) that can be used to filter the results.

Broken in 6.3+ Cannot read property 'map' of undefined

On Grafana 6.3.0+ and I am getting an error when using the plugin
"Cannot read property 'map' of undefined"

Downgrading to anything prior to 6.3 fixes the issue.
I'm unsure what has changed between versions to cause this.

From the browser console during dashboard loading:

Panel data error: TypeError: Cannot read property 'map' of undefined
at h (SlideDown.tsx:38)
at PanelQueryState.ts:304

Develop some "official" Grafana dashboards

Some example dashboards that users can then customize would be a big help here. Some users have reported that a simple dashboard that emulates much of the data that's available in the Sensu Go dashboard (but in Grafana, where they can correlate Sensu data with other datasources), with a namespace variable & drop-down to switch namespaces would be a huge win.

hide silenced checks

Hello.

I'm not sure if this is a request for information, or a feature request.
I am trying to filter out the checks that have been silenced. I have inspected the json file that I get from sensuctl, and, for a silenced event, I see the following item:

 "check": {
    ...[CUT]...
    "history": [
      ...[CUT]...
      "silenced": [
        "entity:prod-blahblah.domain.org:keepalive"
      ],

can you think of a way to get this working?

immagine

release-it command doesn't work as described in readme

When I run release-it as instructed in the readme, I don't see a releases directory created. Instead I've found that there are scripts defined in package.json for compiling the plugin into the dist directory, which can then be tarred/zipped for installation.

I believe either the readme needs to be updated with an accurate explanation of the build/release steps, or we need updates to the release-it configuration so that it does what the readme claims.

Help needed! Aggregation Count by field

Hello there,

I am trying to aggregate the number of entities per each server type , as in the below image (see original post )
Screen Shot 2020-04-27 at 20 02 44

I can count the number of entities as in the image.
Screen Shot 2020-04-27 at 20 03 47

So far, I haven't been successful to aggregate the number entities by a field. I am currently using the sum aggregation on a field value (e.g. entity.metadata.label.type) as the count function does not allow you to specify any value
Screen Shot 2020-04-27 at 20 08 19

What am I missing here?
Thanks in advance

Templating Subscriptions

When using template variables to try and create a subscription selector.
QUERY API entity SELECT subscriptions.
This query will return subscriptions as an array:
["one","two","three"]

Is it possible to split these so they can be properly represented as variables? With multi-select options etc.

Escaping in entity names using variable cause incorrect lookups

Using an $entity variable in the query causes entities with a FQDN to have the periods escaped.

Reproduce:
Have an entity with an FQDN.
Create entity variable:
QUERY API entity IN NAMESPACE $namespace SELECT metadata.name LIMIT 0

Create a new query:
image

Entity filter is not returned as expected.
Query response shows the periods being escaped but the entity name is in a quoted string.

Object
request:Object
method:"GET"
url:"api/datasources/proxy/103/api/core/v2/namespaces/default/events"
params:Object
fieldSelector:"event.entity.name == "my-host-01\.mydomain\.org""
hideFromInspector:false
response:Array[0]

Bug in Sensu timestamp parsing by Grafana

Issue

Resulting parsed timestamps are in the 1970s

  • Grafana expects Unix timestamps in milliseconds
  • Sensu reports Unix timestamps in seconds

Solution

Timestamp fields should be multiplied by 1000:

  • timestamp
  • check.executed
  • check.issued
  • check.last_ok
  • entity.last_seen

PR #15 covers this

Entity response from API seems to be truncated/paginated

A customer reported that when they're pulling in entities via the datasource that the response seems to be truncated. In their words, "If I search for an entity beginning with 'A', I can find it, no issues. If I search for an entity beginning with 'S', I cannot find it." So it appears that API pagination may be at play here, but I'm not quite sure. More investigation is needed.

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.