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

Sy/keda #19303

Merged
merged 14 commits into from
Dec 24, 2024
Merged

Sy/keda #19303

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 @@ -310,6 +310,10 @@ coverage:
target: 75
flags:
- karpenter
Keda:
target: 75
flags:
- keda
Kong:
target: 75
flags:
Expand Down Expand Up @@ -1128,6 +1132,11 @@ flags:
paths:
- karpenter/datadog_checks/karpenter
- karpenter/tests
keda:
carryforward: true
paths:
- keda/datadog_checks/keda
- keda/tests
kong:
carryforward: true
paths:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/config/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ integration/amazon_msk:
- amazon_msk/**/*
integration/ambari:
- ambari/**/*
integration/anthropic:
- anthropic/**/*
integration/anyscale:
- anyscale/**/*
integration/apache:
Expand Down Expand Up @@ -279,6 +281,8 @@ integration/kafka_consumer:
- kafka_consumer/**/*
integration/karpenter:
- karpenter/**/*
integration/keda:
- keda/**/*
integration/kong:
- kong/**/*
integration/kube_apiserver_metrics:
Expand Down Expand Up @@ -319,8 +323,6 @@ integration/kyverno:
- kyverno/**/*
integration/langchain:
- langchain/**/*
integration/anthropic:
- anthropic/**/*
integration/lastpass:
- lastpass/**/*
integration/lighttpd:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,26 @@ jobs:
minimum-base-package: ${{ inputs.minimum-base-package }}
pytest-args: ${{ inputs.pytest-args }}
secrets: inherit
j2cb7ef0:
uses: ./.github/workflows/test-target.yml
with:
job-name: Keda
target: keda
platform: linux
runner: '["ubuntu-22.04"]'
repo: "${{ inputs.repo }}"
python-version: "${{ inputs.python-version }}"
standard: ${{ inputs.standard }}
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 }}
minimum-base-package: ${{ inputs.minimum-base-package }}
pytest-args: ${{ inputs.pytest-args }}
secrets: inherit
jaee58c5:
uses: ./.github/workflows/test-target.yml
with:
Expand Down
4 changes: 4 additions & 0 deletions keda/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CHANGELOG - Keda

<!-- towncrier release notes start -->

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

## Overview

This check monitors [Keda][1] through the Datadog Agent.

Include a high level overview of what this integration does:
- What does your product do (in 1-2 sentences)?
- What value will customers get from this integration, and why is it valuable to them?
- What specific data will your integration monitor, and what's the value of that data?

## Setup

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery Integration Templates][3] for guidance on applying these instructions.

### Installation

The Keda check is included in the [Datadog Agent][2] package.
No additional installation is needed on your server.

### Configuration

1. Edit the `keda.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your keda performance data. See the [sample keda.d/conf.yaml][4] for all available configuration options.

2. [Restart the Agent][5].

### Validation

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

## Data Collected

### Metrics

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

### Events

The Keda integration does not include any events.

### Service Checks

The Keda integration does not include any service checks.

See [service_checks.json][8] for a list of service checks provided by this integration.

## Troubleshooting

Need help? Contact [Datadog support][9].


[1]: **LINK_TO_INTEGRATION_SITE**
[2]: https://app.datadoghq.com/account/settings/agent/latest
[3]: https://docs.datadoghq.com/agent/kubernetes/integrations/
[4]: https://github.com/DataDog/integrations-core/blob/master/keda/datadog_checks/keda/data/conf.yaml.example
[5]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent
[6]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[7]: https://github.com/DataDog/integrations-core/blob/master/keda/metadata.csv
[8]: https://github.com/DataDog/integrations-core/blob/master/keda/assets/service_checks.json
[9]: https://docs.datadoghq.com/help/
10 changes: 10 additions & 0 deletions keda/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Keda
files:
- name: keda.yaml
options:
- template: init_config
options:
- template: init_config/default
- template: instances
options:
- template: instances/default
77 changes: 77 additions & 0 deletions keda/assets/dashboards/keda_overview.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"title": "Keda Overview",
"description": "## Keda\n",
"widgets": [
{
"id": 4717263751542750,
"definition": {
"title": "",
"banner_img": "/static/images/logos/keda_large.svg",
"show_title": true,
"type": "group",
"layout_type": "ordered",
"widgets": [
{
"id": 5685022835071772,
"definition": {
"type": "note",
"content": "## Keda\n",
"background_color": "white",
"font_size": "14",
"text_align": "left",
"vertical_align": "center",
"show_tick": false,
"tick_pos": "50%",
"tick_edge": "left",
"has_padding": true
},
"layout": {
"x": 0,
"y": 0,
"width": 3,
"height": 3
}
},
{
"id": 8921963557059570,
"definition": {
"type": "note",
"content": "",
"background_color": "white",
"font_size": "14",
"text_align": "center",
"vertical_align": "center",
"show_tick": false,
"tick_pos": "50%",
"tick_edge": "left",
"has_padding": true
},
"layout": {
"x": 3,
"y": 0,
"width": 3,
"height": 3
}
}
]
},
"layout": {
"x": 0,
"y": 0,
"width": 6,
"height": 6
}
}
],
"template_variables": [
{
"name": "host",
"prefix": "host",
"available_values": [],
"default": "*"
}
],
"layout_type": "ordered",
"notify_list": [],
"reflow_type": "fixed"
}
17 changes: 17 additions & 0 deletions keda/assets/service_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"agent_version": "7.62.0",
"integration": "Keda",
"check": "keda.openmetrics.health",
"statuses": [
"ok",
"critical"
],
"groups": [
"host",
"endpoint"
],
"name": "Keda OpenMetrics endpoint health",
"description": "Returns `CRITICAL` if the Agent is unable to connect to the Keda OpenMetrics endpoint, otherwise returns `OK`."
}
]
1 change: 1 addition & 0 deletions keda/changelog.d/19303.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Initial Release
4 changes: 4 additions & 0 deletions keda/datadog_checks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
4 changes: 4 additions & 0 deletions keda/datadog_checks/keda/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
__version__ = '0.0.1'
7 changes: 7 additions & 0 deletions keda/datadog_checks/keda/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from .__about__ import __version__
from .check import KedaCheck

__all__ = ['__version__', 'KedaCheck']
26 changes: 26 additions & 0 deletions keda/datadog_checks/keda/check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

from datadog_checks.base import OpenMetricsBaseCheckV2

from .metrics import METRIC_MAP, RENAME_LABELS_MAP


class KedaCheck(OpenMetricsBaseCheckV2):
DEFAULT_METRIC_LIMIT = 0
__NAMESPACE__ = 'keda'

def __init__(self, name, init_config, instances=None):

super(KedaCheck, self).__init__(
name,
init_config,
instances,
)

def get_default_config(self):
return {
'metrics': [METRIC_MAP],
"rename_labels": RENAME_LABELS_MAP,
}
24 changes: 24 additions & 0 deletions keda/datadog_checks/keda/config_models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

# 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
20 changes: 20 additions & 0 deletions keda/datadog_checks/keda/config_models/defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

# 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_disable_generic_tags():
return False


def instance_empty_default_hostname():
return False


def instance_min_collection_interval():
return 15
Loading
Loading