Code Monkey home page Code Monkey logo

datasource's Introduction

Data Source

Grafana data source plugin for Chaos Mesh.

This plugin requires Chaos Mesh >=2.1, Grafana >= 10.0.

Note: We only test the plugin on Grafana 10.0.3, it may support lower versions, but we are not sure. Upgrading to Grafana v10 is because of the Angular support deprecation. If you encounter any problems, please open an issue to let us know.

Features

  • Displaying Chaos events in a table visualization
  • Support Variables to filter Chaos events
  • Support Annotations to annotate Chaos events on the panel

Installation

With dashboard

https://grafana.com/docs/grafana/latest/administration/plugin-management/#install-a-plugin

With cli

grafana-cli plugins install chaosmeshorg-datasource

Manual installation

Download the plugin zip package with the following command or go to https://github.com/chaos-mesh/datasource/releases to download:

curl -LO https://github.com/chaos-mesh/datasource/releases/download/v3.0.0/chaosmeshorg-datasource-3.0.0.zip

After downloading, unzip:

unzip chaosmeshorg-datasource-3.0.0.zip -d YOUR_PLUGIN_DIR

Then update and save the grafana.ini file:

[plugins]
  allow_loading_unsigned_plugins = chaosmeshorg-datasource

Finally, restart Grafana to load the plugin.

Setup

Once installed, go to Administration -> Data sources and add Chaos Mesh, then go to the configuration page:

Settings

Assuming you have Chaos Mesh installed locally, the Chaos Dashboard will export the API on port 2333 by default. So, if you haven't changed anything, you can fill in http://localhost:2333.

Then use the port-forward command to make the API externally accessible:

kubectl port-forward -n chaos-mesh svc/chaos-dashboard 2333:2333

Finally, click Save & test to test the connection. If it shows a successful notification, the setup is complete.

Authentication

If you deploy Chaos Mesh with permission authentication, you need to add the Authorization header to the configuration. You can follow the steps below to add the header:

  1. Click the Add header button.
  2. Fill in the Authorization in the Header field.
  3. Follow this section to get the token.
  4. Fill in the Bearer YOUR_TOKEN in the Value field.

Then don't forget to click Save & test to test the connection.

Query

The data source plugin looks at the Chaos Mesh through the lens of events, and the following options are responsible for filtering the different events:

  • Object ID

    Filter by object uuid.

  • Namespace

    Filter by different namespace.

  • Name

    Filter by object name.

  • Kind

    Filter by kind (PodChaos, NetworkChaos, Schedule...). You can also input an arbitrary kind if you implement a new kind in Chaos Mesh.

  • Limit

    Limit the number of events.

All of them will be passed as parameters to the /api/events API.

Variables

The data source plugin supports adding query variables by different metrics:

Variables

  • Namespace

    After selection, all available namespaces will show in the Preview of values directly.

  • Kind

    Same as Namespace. Retrieve all kinds.

  • Experiment/Schedule/Workflow

    Same as Namespace. Retrieve current all experiments/schedules/workflows.

    You can also specify the queries to further filter the values, for example, ?namespace=default will only retrieve the experiments/schedules/workflows in the default namespace.

Annotations

You can integrate events into panels via annotations, the following is a sample creation, it will retrieve all PodChaos events:

Annotations

Please refer to Query to fill in the corresponding fields.

How to contribute

Pull a request or open an issue to describe your changes or problems.

License

Same as Chaos Mesh. Under the Apache-2.0 License.

datasource's People

Contributors

dependabot[bot] avatar g1eny0ung avatar strrl avatar yeya24 avatar zhouqiang-cl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

datasource's Issues

Angular is deprecated - please migrate to React

Hello πŸ‘‹ from Grafana Labs

We have detected that your plugin might still be using AngularJS and recommend migrating it to React, so that it may continue to operate successfully in future versions of Grafana.

You can read more on why and how by visiting our documentation: https://grafana.com/docs/grafana/latest/developers/angular_deprecation/

You can reach out to us with any questions via slack: slack.grafana.com - channel #plugins or our plugin development community forum

Angular is deprecated - please migrate to React

Hello πŸ‘‹ from Grafana Labs

We have detected that your plugin might still be using AngularJS and recommend migrating it to React, so that it may continue to operate successfully in future versions of Grafana.

You can read more on why and how by visiting our documentation: https://grafana.com/docs/grafana/latest/developers/angular_deprecation/

You can reach out to us with any questions via slack: slack.grafana.com - channel #plugins or our plugin development community forum

Chaos dashboard returns error when receiving queries from grafana

I'm trying to launch the latest version of chaos mesh (2.0.2) + grafana 8.1.7. I've installed the grafana plugin from the v2 branch (tried the official one before that, but realized it's not working with chaos mesh 2.0.2). The version from branch v2 is not working either, when grafana tries to query the chaos dashboard, it receives an error html page saying "You need to enable JavaScript to run this app"

Is there a working version of the grafana plugin at the moment with v2.0.2? When is it expected to be released or at least be in a working state? I don't want to downgrade chaos mesh and I would like to make it work with grafana ... I suppose the issue is not with the plugin itself, but with the way chaos dashboard responds at the moment.

Any help will be appreciated.

Grafana Plugin

Hi there! I noticed a few broken images on the Grafana Plugin page and also see that the plugin is not signed.

I'd like to confirm that everything is in good state with this plugin so I can recommend it to Grafana Cloud users and would love to help out with getting this signed if you'd like.

Ugrades to plugin

As it is today, the plugin is looks very limited.

Some cons that I found using it:

  • Cannot filter multiple experiments by 'name' in the annotation (can only select one or all experiments)
  • Cannot filter multiple experiments by 'kind' (only one possibility)
  • When using Worflows, all finished experiments go to "archives" after running, so I can't see them in Grafana Dashboard (the plugin only select 'active' experiments)
  • Maybe the possibility to filter by 'labelSelector' so I can see in the service monitoring when it recieved some Chaos?

Do you guys have any plans to improve the plugin?

Grafana query for chaos mesh gives "Object(...) is not a function"

What version of Chaos Mesh Datasource are you using?

2.2.3

What version of Chaos Mesh are you using?

2.6.2

What version of Grafana are you using?

7.5.15

What did you do?

I installed Chaos Mesh v2.6.2 using the tutorial there. I created some experiments and workflows that worked fine.

I tried to follow the manual part of this tutorial to install the Grafana plugin. It worked well until the Query section.

What did you expect to see?

I expect to be able to run queries as explained in the tutorial.

What did you see instead?

Grafana is producing an error when running a query.

image
runRequest.catchError TypeError: Object(...) is not a function
    at c.value (datasource.ts:64:41)
    at c.value (datasource.ts:36:1)
    at c.eval (datasource.ts:114:38)
    at c (runtime.js:63:40)
    at Generator._invoke (runtime.js:293:22)
    at Generator.next (runtime.js:118:21)
    at eval (module.js:1:9839)
    at new Promise (<anonymous>)
    at Q (tslib.es6.js:70:37)
    at eval (datasource.ts:96:41)

When I try to create an Annotation I also get an error.

AnnotationSrv.query error TypeError: Object(...) is not a function
    at c.value (datasource.ts:64:41)
    at c.value (datasource.ts:36:1)
    at c.eval (datasource.ts:168:28)
    at c (runtime.js:63:40)
    at Generator._invoke (runtime.js:293:22)
    at Generator.next (runtime.js:118:21)
    at eval (module.js:1:9839)
    at new Promise (<anonymous>)
    at Q (tslib.es6.js:70:37)
    at c.value (module.js:1:15071)

Can't see any data in Grafana

Hello, first of all BIG thanks to you for making your ChaosMesh observable through Grafana!

I added the Datasource according to the tutorial and Grafana accepted and saved it. But when I try to add the first panel, it looks like Grafana isn't able to fetch any data from it. I can't even choose a namespace. See below picture.

Do you have any tips to debug this? Maybe I'm just missing something.

grafik

Plugin not working with Chaos Mesh v2.0.1.

What version of Chaos Mesh Datasource are you using?
0.2.2

What version of Chaos Mesh are you using?
2.0.1

What did you do?

  • I had Chaos Mesh 1.1.2 installed and the plugin working.

  • I've upgraded Chaos Mesh to version 2.0.1 and the plugin stopped working, now giving Annotation Query Failed errors.

  • Just to be sure, I tried pointing the datasource to a dashboard with Chaos Mesh version 1.1.2 and it worked.

So, there might be an incompatibility with Chaos Mesh version 2.

What did you expect to see?
Grafana chaos mesh datasource plugin working with no errors

What did you see instead?

Grafana is giving Annotation Query Failed errors.

AnnotationSrv.query error TypeError: l.sent(...).data.map is not a function
at t.eval (DataSource.ts:157)
at eval (tslib.es6.js:103)
at Object.eval [as next] (tslib.es6.js:132)
at i (tslib.es6.js:74)
(anonymous) @ annotations_srv.ts:89

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.