## cdk8s-grafana
[![View on Construct Hub](https://constructs.dev/badge?package=cdk8s-grafana)](https://constructs.dev/packages/cdk8s-grafana)
cdk8s-grafana is a library that lets you easily define a Grafana service for
your kubernetes cluster along with associated dashboards and datasources, using
a high level API.
### Usage
To apply the resources generated by this construct, the Grafana operator must be
installed on your cluster. See
[https://operatorhub.io/operator/grafana-operator](https://operatorhub.io/operator/grafana-operator) for full installation
instructions.
The following will define a Grafana cluster connected to a Prometheus
datasource:
```python
import { Grafana } from 'cdk8s-grafana';
// inside your chart:
const grafana = new Grafana(this, 'my-grafana', {
defaultDataSource: {
name: 'Prometheus',
type: 'prometheus',
access: 'proxy',
url: 'http://prometheus-service:9090',
}
});
```
Basic aspects of a dashboard can be customized:
```python
const github = grafana.addDatasource('github', ...);
const dashboard = grafana.addDashboard('my-dashboard', {
title: 'My Dashboard',
refreshRate: Duration.seconds(10),
timeRange: Duration.hours(6), // show metrics from now-6h to now
plugins: [
{
name: 'grafana-piechart-panel',
version: '1.3.6',
}
],
});
```
Note: the kubernetes grafana operator only supports one Grafana instance per
namespace (see https://github.com/grafana-operator/grafana-operator/issues/174).
This may require specifying namespaces explicitly, e.g.:
```python
const devGrafana = new Grafana(this, 'my-grafana', {
namespace: 'dev',
});
const prodGrafana = new Grafana(this, 'my-grafana', {
namespace: 'prod',
});
```
The grafana operator must be installed in each namespace for the resources in
that namespace to be recognized.
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more
information.
## License
This project is licensed under the Apache-2.0 License.
Raw data
{
"_id": null,
"home_page": "https://github.com/cdk8s-team/cdk8s-grafana.git",
"name": "cdk8s-grafana",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Amazon Web Services",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/88/ef/4b8f4a9e7af12d8c7d05a0c7d87368687b4f9b329622cec4c72d5ee259cd/cdk8s_grafana-0.1.663.tar.gz",
"platform": null,
"description": "## cdk8s-grafana\n\n[![View on Construct Hub](https://constructs.dev/badge?package=cdk8s-grafana)](https://constructs.dev/packages/cdk8s-grafana)\n\ncdk8s-grafana is a library that lets you easily define a Grafana service for\nyour kubernetes cluster along with associated dashboards and datasources, using\na high level API.\n\n### Usage\n\nTo apply the resources generated by this construct, the Grafana operator must be\ninstalled on your cluster. See\n[https://operatorhub.io/operator/grafana-operator](https://operatorhub.io/operator/grafana-operator) for full installation\ninstructions.\n\nThe following will define a Grafana cluster connected to a Prometheus\ndatasource:\n\n```python\nimport { Grafana } from 'cdk8s-grafana';\n\n// inside your chart:\nconst grafana = new Grafana(this, 'my-grafana', {\n defaultDataSource: {\n name: 'Prometheus',\n type: 'prometheus',\n access: 'proxy',\n url: 'http://prometheus-service:9090',\n }\n});\n```\n\nBasic aspects of a dashboard can be customized:\n\n```python\nconst github = grafana.addDatasource('github', ...);\nconst dashboard = grafana.addDashboard('my-dashboard', {\n title: 'My Dashboard',\n refreshRate: Duration.seconds(10),\n timeRange: Duration.hours(6), // show metrics from now-6h to now\n plugins: [\n {\n name: 'grafana-piechart-panel',\n version: '1.3.6',\n }\n ],\n});\n```\n\nNote: the kubernetes grafana operator only supports one Grafana instance per\nnamespace (see https://github.com/grafana-operator/grafana-operator/issues/174).\nThis may require specifying namespaces explicitly, e.g.:\n\n```python\nconst devGrafana = new Grafana(this, 'my-grafana', {\n namespace: 'dev',\n});\nconst prodGrafana = new Grafana(this, 'my-grafana', {\n namespace: 'prod',\n});\n```\n\nThe grafana operator must be installed in each namespace for the resources in\nthat namespace to be recognized.\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more\ninformation.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Grafana construct for cdk8s.",
"version": "0.1.663",
"project_urls": {
"Homepage": "https://github.com/cdk8s-team/cdk8s-grafana.git",
"Source": "https://github.com/cdk8s-team/cdk8s-grafana.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "517274b7769d107601b927745868d417b985fc7b231f7689d970ff202de365a3",
"md5": "51e5e608ece052f7ee6e4b86dfe2e699",
"sha256": "5b3ff2e0298a05aeee1312f3bff5a1778d5d1a0de1df17702f4dc2b2d16d6215"
},
"downloads": -1,
"filename": "cdk8s_grafana-0.1.663-py3-none-any.whl",
"has_sig": false,
"md5_digest": "51e5e608ece052f7ee6e4b86dfe2e699",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 327576,
"upload_time": "2024-11-16T12:16:14",
"upload_time_iso_8601": "2024-11-16T12:16:14.778632Z",
"url": "https://files.pythonhosted.org/packages/51/72/74b7769d107601b927745868d417b985fc7b231f7689d970ff202de365a3/cdk8s_grafana-0.1.663-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "88ef4b8f4a9e7af12d8c7d05a0c7d87368687b4f9b329622cec4c72d5ee259cd",
"md5": "2119a59615c8b032aa69f3376e19c64b",
"sha256": "811676f3ca18ab7ec929f5649e521c6d65f9c0321ba0d9ddf244c57e73e784ee"
},
"downloads": -1,
"filename": "cdk8s_grafana-0.1.663.tar.gz",
"has_sig": false,
"md5_digest": "2119a59615c8b032aa69f3376e19c64b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 329495,
"upload_time": "2024-11-16T12:16:17",
"upload_time_iso_8601": "2024-11-16T12:16:17.061195Z",
"url": "https://files.pythonhosted.org/packages/88/ef/4b8f4a9e7af12d8c7d05a0c7d87368687b4f9b329622cec4c72d5ee259cd/cdk8s_grafana-0.1.663.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-16 12:16:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cdk8s-team",
"github_project": "cdk8s-grafana",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cdk8s-grafana"
}