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/argo rollouts #17006

Merged
merged 43 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3453f4f
argo-rollouts WIP
steveny91 Feb 20, 2024
00397b7
add working env
steveny91 Feb 27, 2024
36e9488
add simple tests
steveny91 Feb 28, 2024
9dcc919
nit
steveny91 Feb 28, 2024
b71da1e
add service check
steveny91 Feb 28, 2024
9dff44c
manifest tweaks
steveny91 Feb 28, 2024
e9456e9
validation syncs
steveny91 Feb 28, 2024
f152630
lint
steveny91 Feb 28, 2024
f51338f
readme
steveny91 Mar 6, 2024
c952d86
metadata
steveny91 Mar 6, 2024
1f4dc8f
validate
steveny91 Mar 6, 2024
65c52ac
fix metadata
steveny91 Mar 6, 2024
8b5f554
remove folder
steveny91 Mar 6, 2024
3a43540
place holder dashboard
steveny91 Mar 6, 2024
d0b3dfd
place holder dashboard
steveny91 Mar 6, 2024
54924bf
manifest metric to check
steveny91 Mar 6, 2024
840256c
manifest
steveny91 Mar 6, 2024
4785204
manifest
steveny91 Mar 6, 2024
83dde5b
labeler
steveny91 Mar 6, 2024
46dd6ee
metadata descriptions
steveny91 Mar 6, 2024
776eca7
Update argo_rollouts/README.md
steveny91 Mar 7, 2024
69663bb
Update argo_rollouts/README.md
steveny91 Mar 7, 2024
7d0e611
Update argo_rollouts/README.md
steveny91 Mar 7, 2024
ad30f83
Update argo_rollouts/README.md
steveny91 Mar 7, 2024
05a4aaf
Update argo_rollouts/README.md
steveny91 Mar 7, 2024
55d2542
Update argo_rollouts/README.md
steveny91 Mar 8, 2024
f1e1aa4
Update argo_rollouts/datadog_checks/argo_rollouts/__about__.py
steveny91 Mar 8, 2024
ed5df44
Update argo_rollouts/manifest.json
steveny91 Mar 8, 2024
17258ba
fix remapped labels
steveny91 Mar 8, 2024
1aff046
simplify check
steveny91 Mar 8, 2024
7b777fa
add service_checks test
steveny91 Mar 8, 2024
dbb2ce2
add test for label rename
steveny91 Mar 8, 2024
bf36e9a
Update argo_rollouts/tests/test_e2e.py
steveny91 Mar 13, 2024
ae8f5d1
simplify e2e
steveny91 Mar 18, 2024
42ade2e
fix metadata
steveny91 Mar 18, 2024
c6c089d
lint
steveny91 Mar 18, 2024
59a921f
Update argo_rollouts/assets/configuration/spec.yaml
steveny91 Mar 19, 2024
8a73ac4
Update check.py
steveny91 Mar 19, 2024
6ec8266
sort metrics
steveny91 Mar 19, 2024
52e8c91
fix mistakenly named metric
steveny91 Mar 19, 2024
dccc97f
fix mistakenly named metric
steveny91 Mar 19, 2024
84ffdc4
cleanup
steveny91 Mar 19, 2024
df5d074
add controller version as metadata
steveny91 Mar 19, 2024
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 @@ -58,6 +58,10 @@ coverage:
target: 75
flags:
- argocd
Argo_Rollouts:
target: 75
flags:
- argo_rollouts
Avi_Vantage:
target: 75
flags:
Expand Down Expand Up @@ -700,6 +704,11 @@ flags:
paths:
- arangodb/datadog_checks/arangodb
- arangodb/tests
argo_rollouts:
carryforward: true
paths:
- argo_rollouts/datadog_checks/argo_rollouts
- argo_rollouts/tests
argocd:
carryforward: true
paths:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/config/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ integration/apache:
- apache/**/*
integration/arangodb:
- arangodb/**/*
integration/argo_rollouts:
- argo_rollouts/**/*
integration/argocd:
- argocd/**/*
integration/aspdotnet:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,25 @@ jobs:
test-py3: ${{ inputs.test-py3 }}
minimum-base-package: ${{ inputs.minimum-base-package }}
secrets: inherit
j3650884:
uses: ./.github/workflows/test-target.yml
with:
job-name: Argo Rollouts
target: argo_rollouts
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 }}
secrets: inherit
j92d42de:
uses: ./.github/workflows/test-target.yml
with:
Expand Down
4 changes: 4 additions & 0 deletions argo_rollouts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CHANGELOG - Argo Rollouts

<!-- towncrier release notes start -->

95 changes: 95 additions & 0 deletions argo_rollouts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Agent Check: Argo Rollouts

## Overview

This check monitors [Argo Rollouts][1] through the Datadog Agent.

## Setup

Follow the instructions below to install and configure this check for an Agent running in your Kubernetes environment. For more information about configuration in containerized environments, see the [Autodiscovery Integration Templates][3] for guidance.

### Installation

Starting from Agent release 7.53.0, the Argo Rollouts check is included in the [Datadog Agent][2] package. No additional installation is needed in your environment.

This check uses [OpenMetrics][5] to collect metrics from the OpenMetrics endpoint that Karpenter exposes, which requires Python 3.

### Configuration

The Argo Rollouts controller has Prometheus-formatted metrics readily available at `/metrics` on port `8090`. For the Agent to start collecting metrics, the Argo Rollouts pods need to be annotated. For more information about annotations, refer to the [Autodiscovery Integration Templates][3] for guidance. You can find additional configuration options by reviewing the [sample argo_rollouts.d/conf.yaml][4].

**Note**: The listed metrics can only be collected if they are available. Some metrics are generated only when certain actions are performed. For example, the `argo_rollout.info.replicas.updated` metric is exposed only after a replica is updated.

The only parameter required for configuring the Argo Rollouts check is:
- `openmetrics_endpoint`: This parameter should be set to the location where the Prometheus-formatted metrics are exposed. The default port is `8090`. In containerized environments, `%%host%%` should be used for [host autodetection][3].

```yaml
apiVersion: v1
kind: Pod
# (...)
metadata:
name: '<POD_NAME>'
annotations:
ad.datadoghq.com/argo-rollouts.checks: |
{
"argo_rollouts": {
"init_config": {},
"instances": [
{
"openmetrics_endpoint": "http://%%host%%:8090/metrics",
}
]
}
}
# (...)
spec:
containers:
- name: 'argo-rollouts'
# (...)
```

#### Log collection

_Available for Agent versions >6.0_

Argo Rollouts logs can be collected from the different Argo Rollouts pods through Kubernetes. Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes Log Collection][10].

See the [Autodiscovery Integration Templates][3] for guidance on applying the parameters below.

| Parameter | Value |
| -------------- | ------------------------------------------------------- |
| `<LOG_CONFIG>` | `{"source": "argo_rollouts", "service": "<SERVICE_NAME>"}` |

### Validation

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

## Data Collected

### Metrics

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

### Events

The Argo Rollouts integration does not include any events.

### 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]: https://argoproj.github.io/rollouts/
[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/argo_rollouts/datadog_checks/argo_rollouts/data/conf.yaml.example
[5]: https://docs.datadoghq.com/integrations/openmetrics/
[6]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[7]: https://github.com/DataDog/integrations-core/blob/master/argo_rollouts/metadata.csv
[8]: https://github.com/DataDog/integrations-core/blob/master/argo_rollouts/assets/service_checks.json
[9]: https://docs.datadoghq.com/help/
[10]: https://docs.datadoghq.com/agent/kubernetes/log/
15 changes: 15 additions & 0 deletions argo_rollouts/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Argo Rollouts
files:
- name: argo_rollouts.yaml
options:
- template: init_config
options:
- template: init_config/openmetrics
- template: instances
options:
- template: instances/openmetrics
overrides:
openmetrics_endpoint.value.example: http://localhost:8090/metrics
openmetrics_endpoint.description: |
Endpoint exposing the Argo Rollouts Controller's Prometheus metrics. For more information refer to:
https://argo-rollouts.readthedocs.io/en/stable/features/controller-metrics/
41 changes: 41 additions & 0 deletions argo_rollouts/assets/dashboards/overview.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"author_name": "Datadog",
"description": "[[suggested_dashboards]]",
"layout_type": "ordered",
"template_variables": [],
"title": "Argo Rollouts Overview",
"widgets": [
{
"definition": {
"banner_img": "public/static/images/logos/argo-rollouts_large.svg",
"layout_type": "ordered",
"show_title": false,
"title": "",
"type": "group",
"widgets": []
},
"id": 2826076057698652,
"layout": {
"height": 5,
"width": 6,
"x": 0,
"y": 0
}
},
{
"definition": {
"layout_type": "ordered",
"title": "New group",
"type": "group",
"widgets": []
},
"id": 6669807407706588,
"layout": {
"height": 5,
"width": 6,
"x": 6,
"y": 0
}
}
]
}
18 changes: 18 additions & 0 deletions argo_rollouts/assets/service_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"agent_version": "7.53.0",
"integration": "Argo Rollouts",
"check": "argo_rollouts.openmetrics.health",
"statuses": [
"ok",
"critical"
],
"groups": [
"host",
"endpoint"
],
"name": "Argo Rollouts OpenMetrics endpoint health",
"description": "Returns `CRITICAL` if the Agent is unable to connect to the Argo Rollouts OpenMetrics endpoint, otherwise returns `OK`."
}
]

1 change: 1 addition & 0 deletions argo_rollouts/changelog.d/17006.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Initial Release
4 changes: 4 additions & 0 deletions argo_rollouts/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 argo_rollouts/datadog_checks/argo_rollouts/__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 argo_rollouts/datadog_checks/argo_rollouts/__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 ArgoRolloutsCheck

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

from .config_models import ConfigMixin
from .metrics import METRIC_MAP, RENAME_LABELS_MAP


class ArgoRolloutsCheck(OpenMetricsBaseCheckV2, ConfigMixin):
DEFAULT_METRIC_LIMIT = 0
__NAMESPACE__ = 'argo_rollouts'

def get_default_config(self):
return {
'metrics': [METRIC_MAP],
"rename_labels": RENAME_LABELS_MAP,
}
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
Loading
Loading