Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing a new component monitoring-integration(1st milestone) #218

Merged
merged 14 commits into from
Aug 10, 2017
Merged
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
263 changes: 263 additions & 0 deletions specs/monitoring_integration.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
= Spec - Introducing a new component monitoring-integration(1st milestone)

A new component called monitoring-Integration is introduced which integrates Grafana
with tendrl core.


== Problem description

The new monitoring-integration component would primarily focus on dynamic
configuration of grafana, based on the topology changes in etcd. Some of these
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we doing any dynamic configuration based on the topology changes in milestone 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no i will remove it

responsibilities would be:

* Monitoring-integration should create default dashboards in grafana using predefined json.
The dashboard json contains details regarding panels, metrics and alerts.
* Configuring grafana authentication and authorization (https://github.com/Tendrl/specifications/pull/205),
based on changes in the primary tendrl AA scheme.
* Keeping track of the topology changes in etcd to configure the grafana dashboards
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping track of the topology changes is something which is done in milestone-1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will remove it

to ensure that the correct nodes are part of the respective cluster dashboards.
(Not planned yet, for 1st milestone grafana is configured using some default
configuration from monitoring-integration)


== Use Cases

For 1st milestone:

* Monitoring-Integration will create default dashboards in grafana.

For 2nd milestone:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading talks about milestone-1 and you have details about milestone-2 & 3 here. As we talked about in various discussions, take this out from this spec, file specific issues for milestone-2 & 3 items. We need milestone specific specs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it


* Grafana alerting events should be notified via tendrl.
* Monitoring-integration should be able to configure grafana based on topology
changes in etcd.

For 3rd milestone:

* User should be able access grafana dashboard via tendrl user interface using
Copy link

@rishubhjain rishubhjain Aug 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this refer to #191?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on that only authentication logic will change here

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tendrl authentication.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you planing to handle the updates?for ex updates to json files during yum update?
Also monitoring-integration as a service?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These things are planned for 2nd milestone, For now monitoring-integration is just a one time manual run.
It is now it work just like a script.

So @TimothyAsir is working on .spec after that only we will change monitoring-integration as service

== Proposed change

=== Why monitoring-integration?

Grafana is used for visualizing time series data in graphs. Based on the metrics
from datasource it will create graphs and display. It provides a rich set of tools
to display monitoring and analytics using time series data. monitoring-integration
component would primarily focus on dynamic configuration of grafana, based on
the topology changes in etcd.

Monitoring-integration and grafana server are installed via tendrl-ansible in server machine
(for 1st milestone it is installed manually). There is just one instance of monitoring-integration
and grafana installed across all clusters. For now when monitoring-integration starts
then it will create gafana dashboards using some predefined json files.
(Complelete flow structure for monitoring-integration is out of scope of this specification).

For each grafana dashboard different predefined json is maintained in monitoring-integration.
The json is sent to grafana server as http api request.

JSON Body schema:

* dashboard – The complete dashboard model, id = null to create a new dashboard
* overwrite – Set to true if you want to overwrite existing dashboard with newer
version or with same dashboard title.
* message - Set a commit message for the version history.

```
Example dashboard json for creating a new dashboard or updating an existing dashboard.

{
"dashboard": {
"id": null,
"title": "Production Overview",
"tags": [ "templated" ],
"timezone": "browser",
"rows": [
{
}
],
"schemaVersion": 6,
"version": 0
},
"overwrite": false
}
```

Monitoring-integration is enabling anonymous access to create dashboards and
datasource by changing grafana configuration file. It Setting the organization name
that should be used for anonymous users.


== Alternatives

None


== Data model impact:

None


== Impacted Modules:

=== Tendrl API impact:

None

=== Notifications/Monitoring impact:

None

=== Tendrl/common impact:

None

=== Tendrl/node_agent impact:

None

=== Sds integration impact:

None

=== Tendrl/monitoring-integration impact:

Introduce a new component monitoring-integration in tendrl.

Monitoring integration should have all predefined json files and configuration files
for grafana. When monitoring-integration starts it will create the grafana dashboard
and datasource using predefined jsons via http api request.

```
Grafana APIs used in monitoring-integration:

1) Dashboard API:
To creates a new dashboard or update an existing dashboard.
POST - /api/dashboards/db
{
"dashboard": {
"id": null,
"title": "Brick utilization",
"tags": [ "" ],
"timezone": "",
"rows": [
{
}
],
"schemaVersion": 6,
"version": 0
},
"overwrite": false
}
2) Data source API
To create data source
POST /api/datasources
{
"name":"datasource_name",
"type":"graphite",
"url":"",
"access":"proxy",
"basicAuth":false
}
3) Create Organisation
To create organisation
POST /api/orgs
{
"name":"New Org."
}
```


=== Security impact:

None

=== Other end user impact:

User can access the grafana dashboards using tendrl authorization only.

=== Performance impact:

None

=== Other deployer impact:

Monitoring-integration needs grafana packages as dependency.

=== Developer impact:

Create a new component called monitoring-integration and implement its functionalities.

== Implementation:

Implementation details for milestone 1:

* Create a new tendrl component called "monitoring-integration".
* Create a directory called "etc" to store configuration files:
1. grafana/grafana.ini
2. tendrl/monitoring-integration/monitoring-integration.conf.sample
3. tendrl/monitoring-integration/grafana/dashboards/tendrl-gluster-at-a-glance.json
4. tendrl/monitoring-integration/grafana/dashboards/tendrl-gluster-bricks.json
5. tendrl/monitoring-integration/grafana/dashboards/tendrl-gluster-hosts.json
6. tendrl/monitoring-integration/grafana/dashboards/tendrl-gluster-volumes.json
7. tendrl/monitoring-integration/graphite/carbon.conf.sample
8. tendrl/monitoring-integration/graphite/graphite-web.conf.sample
* Create tendrl-monitoring-integration.spec file for packaging.
* Create a tox.ini file to run unit test cases.
* Create a setup.py file for package installation.
* Create a version.py file to specify monitoring-integration component version.
* Create a check_commit_msg.py file to check the commit messages by travis.
* Create .travis.yml file for Travis CI service.
* Create a new directory called tendrl.
* Create a new directory called monitoring_integration inside tendrl directory.
* Create new file "__init__.py" in tendrl/monitoring_integration and wite a loggic
to initiate the grafana dashboard and datasource creation process.
* Create a new directory called grafana in tendrl/monitoring_integration.
* Create a file called dashboard.py in tendrl/monitoring_integration to create grafana
dashboard.
* Create a file datasource.py in tendrl/monitoring_integration to create grafana
datasource.
* Create a file called utils.py in tendrl/monitoring_integration/grafana.
* utils functions are used to make different api calls for create dashboard
and datasource in grafana.

Workflow planned for first milestone is:

When monitoring-integration starts then it is configured from a configuration file
"/etc/tendr/monitoring_integration/monitoring-integration.conf".
Then it will create dashboards and datasources in grafana using predefined
json files from tendrl/monitoring_integration/grafana directory with the help of util functions. When
monitoring_integration restart it will compare existing dashboards in grafana with predefined
dashboards in monitoring integration, if any dashboard is not present in grafana then it will create a
new dashboard otherwise it will skip.


== Assignee(s):

@GowthamShanmugam

@rishubhjain

== Work Items:

https://github.com/Tendrl/specifications/issues/179


== Testing:

Check grafana dashboards are configured and displayed correctly based on topologies
from etcd.


== Documentation impact:

None


== References:

https://github.com/Tendrl/specifications/pull/198

https://github.com/Tendrl/specifications/pull/205

https://github.com/Tendrl/specifications/pull/171