Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ coverage:
target: 75
flags:
- gnatsd_streaming
Grafana:
target: 75
flags:
- grafana
JFrog_Platform:
target: 75
flags:
Expand Down Expand Up @@ -442,6 +446,11 @@ flags:
paths:
- go_pprof_scraper/datadog_checks/go_pprof_scraper
- go_pprof_scraper/tests
grafana:
carryforward: true
paths:
- grafana/datadog_checks/grafana
- grafana/tests
grpc_check:
carryforward: true
paths:
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
/go_pprof_scraper/ @nsrip-dd
/gnatsd/ @stephenprater @jaredhoyt [email protected]
/gnatsd_streaming/ @stephenprater @jaredhoyt [email protected]
/grafana/ @rtjl [email protected]
/gremlin/ [email protected]
/grpc_check/ @keisku
/harness_cloud_cost_management/ @akashbdj [email protected] @DataDog/ecosystems-review
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,24 @@ jobs:
test-py3: ${{ inputs.test-py3 }}
setup-env-vars: "${{ inputs.setup-env-vars }}"
secrets: inherit
j0642a7b:
uses: DataDog/integrations-core/.github/workflows/test-target.yml@master
with:
job-name: Grafana
target: grafana
platform: linux
runner: '["ubuntu-22.04"]'
repo: "${{ inputs.repo }}"
python-version: "${{ inputs.python-version }}"
latest: ${{ inputs.latest }}
agent-image: "${{ inputs.agent-image }}"
agent-image-py2: "${{ inputs.agent-image-py2 }}"
agent-image-windows: "${{ inputs.agent-image-windows }}"
agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}"
test-py2: ${{ inputs.test-py2 }}
test-py3: ${{ inputs.test-py3 }}
setup-env-vars: "${{ inputs.setup-env-vars }}"
secrets: inherit
jb27a2a4:
uses: DataDog/integrations-core/.github/workflows/test-target.yml@master
with:
Expand Down
8 changes: 8 additions & 0 deletions grafana/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CHANGELOG - Grafana

## 1.0.0 / 2025-11-02

***Added***:

* Initial Release

65 changes: 65 additions & 0 deletions grafana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Agent Check: Grafana

## Overview

Grafana is a multi-platform open source analytics and interactive visualization web application. This check monitors [Grafana][1] through the Datadog Agent.

## Setup

### Installation

To install the Grafana check on your host:

1. Install the [developer toolkit](https://docs.datadoghq.com/developers/integrations/python/)
on any machine.

2. Run `ddev release build grafana` to build the package.

3. [Download the Datadog Agent][2].

4. Upload the build artifact to any host with an Agent and
run `datadog-agent integration install -w
path/to/grafana/dist/<ARTIFACT_NAME>.whl`.

### Configuration

1. Enable the internal Grafana metrics using the [Grafana config file](https://github.com/grafana/grafana/blob/c98259f74a835429ed2db6cca2c64a3802ebc43f/conf/defaults.ini#L1747)

```
#################################### Internal Grafana Metrics ############
# Metrics available at HTTP URL /metrics and /metrics/plugins/:pluginId
[metrics]
enabled = true
```

2. Edit the `grafana/conf.yaml` file in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your Grafana metrics. See the [sample grafana/conf.yaml][4] for all available configuration options.

3. [Restart the Agent][5].

### Validation

[Run the Agent's status subcommand][6] and look for `grafana` under the Checks section.

## Data Collected

### Metrics

See [metadata.csv][7] for a list of metrics provided by this integration.

### Events

The Grafana integration does not include any events.

## Troubleshooting

Need help? Contact [Datadog support][3].
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Need help? Contact [Datadog support][3].
Need help? Contact the [maintainer](https://github.com/DataDog/integrations-extras/blob/master/grafana/manifest.json) of this integration.

fix: troubleshooting contact should refer to the maintainer


[1]: https://grafana.com/
[2]: https://app.datadoghq.com/account/settings/agent/latest
[3]: https://docs.datadoghq.com/containers/kubernetes/integrations/
[4]: https://github.com/DataDog/integrations-extras/blob/master/grafana/datadog_checks/grafana/data/conf.yaml.example
[5]: https://docs.datadoghq.com/agent/configuration/agent-commands/#start-stop-and-restart-the-agent
[6]: https://docs.datadoghq.com/agent/configuration/agent-commands/#agent-status-and-information
[7]: https://github.com/DataDog/integrations-extras/blob/master/grafana/metadata.csv
[8]: https://github.com/DataDog/integrations-extras/blob/master/grafana/assets/service_checks.json
[9]: https://docs.datadoghq.com/help/
17 changes: 17 additions & 0 deletions grafana/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Grafana
files:
- name: grafana.yaml
options:
- template: init_config
options:
- template: init_config/default
- template: instances
options:
- template: instances/openmetrics
overrides:
openmetrics_endpoint.enabled: true
openmetrics_endpoint.required: true
openmetrics_endpoint.value.example: http://127.0.0.1:3000/metrics
extra_metrics.value.example:
- grafana_alerting_alertmanager_alerts: alerting.alertmanager_alerts
- grafana_database_conn_idle: database.conn_idle
16 changes: 16 additions & 0 deletions grafana/assets/service_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"agent_version": "7.69.0",
"integration": "Grafana",
"check": "grafana.openmetrics.health",
"statuses": [
"ok",
"critical"
],
"groups": [
"endpoint"
],
"name": "Grafana prometheus endpoint health",
"description": "Returns `CRITICAL` if the check cannot access the metrics endpoint. Returns `OK` otherwise."
}
]
1 change: 1 addition & 0 deletions grafana/datadog_checks/grafana/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.0.0'
4 changes: 4 additions & 0 deletions grafana/datadog_checks/grafana/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .__about__ import __version__
from .check import GrafanaCheck

__all__ = ['__version__', 'GrafanaCheck']
14 changes: 14 additions & 0 deletions grafana/datadog_checks/grafana/check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from datadog_checks.base import OpenMetricsBaseCheckV2

from .metrics import METRIC_MAP


class GrafanaCheck(OpenMetricsBaseCheckV2):
__NAMESPACE__ = 'grafana'
DEFAULT_METRIC_LIMIT = 0

def __init__(self, name, init_config, instances):
super(GrafanaCheck, self).__init__(name, init_config, instances)

def get_default_config(self):
return {"metrics": [METRIC_MAP]}
20 changes: 20 additions & 0 deletions grafana/datadog_checks/grafana/config_models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is autogenerated.
# To change this file you should edit assets/configuration/spec.yaml and then run the following commands:
# ddev -x validate config -s <INTEGRATION_NAME>
# ddev -x validate models -s <INTEGRATION_NAME>

from .instance import InstanceConfig
from .shared import SharedConfig


class ConfigMixin:
_config_model_instance: InstanceConfig
_config_model_shared: SharedConfig

@property
def config(self) -> InstanceConfig:
return self._config_model_instance

@property
def shared_config(self) -> SharedConfig:
return self._config_model_shared
120 changes: 120 additions & 0 deletions grafana/datadog_checks/grafana/config_models/defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# This file is autogenerated.
# To change this file you should edit assets/configuration/spec.yaml and then run the following commands:
# ddev -x validate config -s <INTEGRATION_NAME>
# ddev -x validate models -s <INTEGRATION_NAME>


def instance_allow_redirects():
return True


def instance_auth_type():
return 'basic'


def instance_cache_metric_wildcards():
return True


def instance_cache_shared_labels():
return True


def instance_collect_counters_with_distributions():
return False


def instance_collect_histogram_buckets():
return True


def instance_disable_generic_tags():
return False


def instance_empty_default_hostname():
return False


def instance_enable_health_service_check():
return True


def instance_histogram_buckets_as_distributions():
return False


def instance_ignore_connection_errors():
return False


def instance_kerberos_auth():
return 'disabled'


def instance_kerberos_delegate():
return False


def instance_kerberos_force_initiate():
return False


def instance_log_requests():
return False


def instance_min_collection_interval():
return 15


def instance_non_cumulative_histogram_buckets():
return False


def instance_persist_connections():
return False


def instance_request_size():
return 16


def instance_skip_proxy():
return False


def instance_tag_by_endpoint():
return True


def instance_telemetry():
return False


def instance_timeout():
return 10


def instance_tls_ignore_warning():
return False


def instance_tls_use_host_header():
return False


def instance_tls_verify():
return True


def instance_use_latest_spec():
return False


def instance_use_legacy_auth_encoding():
return True


def instance_use_process_start_time():
return False
Loading
Loading