cdk8s-grafana


Namecdk8s-grafana JSON
Version 0.1.679 PyPI version JSON
download
home_pagehttps://github.com/cdk8s-team/cdk8s-grafana.git
SummaryGrafana construct for cdk8s.
upload_time2025-02-05 12:17:31
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/b6/0f/84af8b7333ee4c97ab6760f34fa756861e97448d08747662345535f69d5e/cdk8s_grafana-0.1.679.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.679",
    "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": null,
            "digests": {
                "blake2b_256": "135dfed6d0e04a289f69ffa94160722c53a110f681e0d6d3b84fe31ad32f9572",
                "md5": "91f18bba3ac20ea0f46e59e006653c59",
                "sha256": "acdda5fe5ce5dc4211e6c8eec40f41379ab33fb0d107aa79b11dc513a52a310e"
            },
            "downloads": -1,
            "filename": "cdk8s_grafana-0.1.679-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "91f18bba3ac20ea0f46e59e006653c59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 327225,
            "upload_time": "2025-02-05T12:17:28",
            "upload_time_iso_8601": "2025-02-05T12:17:28.995045Z",
            "url": "https://files.pythonhosted.org/packages/13/5d/fed6d0e04a289f69ffa94160722c53a110f681e0d6d3b84fe31ad32f9572/cdk8s_grafana-0.1.679-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b60f84af8b7333ee4c97ab6760f34fa756861e97448d08747662345535f69d5e",
                "md5": "1adc96c43ce81927b681aafc80fa0154",
                "sha256": "ab6db3704636b49bee6434dd89f3f3a0aedc3a063db42fc4a7945a87c3a436c7"
            },
            "downloads": -1,
            "filename": "cdk8s_grafana-0.1.679.tar.gz",
            "has_sig": false,
            "md5_digest": "1adc96c43ce81927b681aafc80fa0154",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 329132,
            "upload_time": "2025-02-05T12:17:31",
            "upload_time_iso_8601": "2025-02-05T12:17:31.918795Z",
            "url": "https://files.pythonhosted.org/packages/b6/0f/84af8b7333ee4c97ab6760f34fa756861e97448d08747662345535f69d5e/cdk8s_grafana-0.1.679.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-05 12:17:31",
    "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.40060s