cdk8s-grafana


Namecdk8s-grafana JSON
Version 0.1.668 PyPI version JSON
download
home_pagehttps://github.com/cdk8s-team/cdk8s-grafana.git
SummaryGrafana construct for cdk8s.
upload_time2024-12-24 12:16:57
maintainerNone
docs_urlNone
authorAmazon Web Services
requires_python~=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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/b9/6e/840c81b46154af456d30b2273ffc91e3edd82a1cc7deb83ce523e02e395a/cdk8s_grafana-0.1.668.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.668",
    "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": "4ec2810c440b04f1b0a2501f9a9337de7e2e84f30366466be9103a154f02b394",
                "md5": "6e320b2a233450714910f4f3682bc99c",
                "sha256": "71a42332d9f3352b1a543a217a41b75f56c227a186fddfb0bcb9e00c596c4cf7"
            },
            "downloads": -1,
            "filename": "cdk8s_grafana-0.1.668-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6e320b2a233450714910f4f3682bc99c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 327228,
            "upload_time": "2024-12-24T12:16:51",
            "upload_time_iso_8601": "2024-12-24T12:16:51.886046Z",
            "url": "https://files.pythonhosted.org/packages/4e/c2/810c440b04f1b0a2501f9a9337de7e2e84f30366466be9103a154f02b394/cdk8s_grafana-0.1.668-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b96e840c81b46154af456d30b2273ffc91e3edd82a1cc7deb83ce523e02e395a",
                "md5": "6cde87ed10f66c6c4491bc593aa6e8fe",
                "sha256": "a77f9f61ffbf9d2deaf7c68db6386f66163664f67403e2bedb959670e43aee0e"
            },
            "downloads": -1,
            "filename": "cdk8s_grafana-0.1.668.tar.gz",
            "has_sig": false,
            "md5_digest": "6cde87ed10f66c6c4491bc593aa6e8fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 329111,
            "upload_time": "2024-12-24T12:16:57",
            "upload_time_iso_8601": "2024-12-24T12:16:57.592095Z",
            "url": "https://files.pythonhosted.org/packages/b9/6e/840c81b46154af456d30b2273ffc91e3edd82a1cc7deb83ce523e02e395a/cdk8s_grafana-0.1.668.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-24 12:16:57",
    "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"
}
        
Elapsed time: 0.49492s