-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add the structure of the Tekton integration * update manifest * auto install * Add the e2e environment * add triggers * lint * sleep * switch to the operator * lint * add tasks * echo sleep * sleep * sh * lint * add pipeline run * lint * add pipelinerun * Implement the check and add tests * triggers tests * update the config * metrics in manifest * update the config * nit * update tests * nit * lint * fix * test * add metrics * update manifest * simplify * config * lint * add metrics * update tests * add metrics * drop optional metrics * metadata * add service checks * fix * lint * metadata * revert gitlab stuff * Update tekton/datadog_checks/tekton/check.py Co-authored-by: Ilia Kurenkov <ilia.kurenkov@datadoghq.com> * address * lint * fix * Update tekton/tests/conftest.py Co-authored-by: Ilia Kurenkov <ilia.kurenkov@datadoghq.com> * Update tekton/datadog_checks/tekton/check.py * Update tekton/datadog_checks/tekton/check.py * changelog --------- Co-authored-by: Ilia Kurenkov <ilia.kurenkov@datadoghq.com>
- Loading branch information
1 parent
6374198
commit 4144124
Showing
39 changed files
with
4,119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# CHANGELOG - Tekton | ||
|
||
<!-- towncrier release notes start --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Agent Check: Tekton | ||
|
||
## Overview | ||
|
||
This check monitors [Tekton][1] through the Datadog Agent. | ||
|
||
## 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 Tekton check is included in the [Datadog Agent][2] package. | ||
No additional installation is needed on your server. | ||
|
||
### Configuration | ||
|
||
1. Edit the `tekton.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your tekton performance data. See the [sample tekton.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 `tekton` under the Checks section. | ||
|
||
## Data Collected | ||
|
||
### Metrics | ||
|
||
See [metadata.csv][7] for a list of metrics provided by this integration. | ||
|
||
### Events | ||
|
||
The Tekton integration does not include any events. | ||
|
||
### Service Checks | ||
|
||
The Tekton 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/tekton/datadog_checks/tekton/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/tekton/metadata.csv | ||
[8]: https://github.com/DataDog/integrations-core/blob/master/tekton/assets/service_checks.json | ||
[9]: https://docs.datadoghq.com/help/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Tekton | ||
files: | ||
- name: tekton.yaml | ||
options: | ||
- template: init_config | ||
options: | ||
- template: init_config/openmetrics | ||
- template: instances | ||
options: | ||
- name: pipelines_controller_endpoint | ||
description: | | ||
Endpoint exposing the Pipelines Controller's Prometheus metrics. | ||
value: | ||
display_default: null | ||
example: http://tekton-pipelines-controller:9090/metrics | ||
type: string | ||
- name: triggers_controller_endpoint | ||
description: | | ||
Endpoint exposing the Triggers Controller's Prometheus metrics. | ||
value: | ||
display_default: null | ||
example: http://tekton-triggers-controller:9000/metrics | ||
type: string | ||
- template: instances/openmetrics | ||
overrides: | ||
openmetrics_endpoint.required: false | ||
openmetrics_endpoint.hidden: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[ | ||
{ | ||
"agent_version": "7.53.0", | ||
"integration": "Tekton", | ||
"check": "tekton.pipelines_controller.openmetrics.health", | ||
"statuses": [ | ||
"ok", | ||
"critical" | ||
], | ||
"groups": [ | ||
"host", | ||
"endpoint" | ||
], | ||
"name": "Tekton Pipelines openmetrics endpoint up", | ||
"description": "Returns `CRITICAL` if the check cannot access the openmetrics metrics endpoint of Tekton Pipelines." | ||
}, | ||
{ | ||
"agent_version": "7.53.0", | ||
"integration": "Tekton", | ||
"check": "tekton.triggers_controller.openmetrics.health", | ||
"statuses": [ | ||
"ok", | ||
"critical" | ||
], | ||
"groups": [ | ||
"host", | ||
"endpoint" | ||
], | ||
"name": "Tekton Triggers openmetrics endpoint up", | ||
"description": "Returns `CRITICAL` if the check cannot access the openmetrics metrics endpoint of Tekton Triggers." | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 TektonCheck | ||
|
||
__all__ = ['__version__', 'TektonCheck'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# (C) Datadog, Inc. 2024-present | ||
# All rights reserved | ||
# Licensed under a 3-clause BSD style license (see LICENSE) | ||
from datadog_checks.base import ConfigurationError, OpenMetricsBaseCheckV2 | ||
from datadog_checks.tekton.config_models import ConfigMixin | ||
|
||
from .metrics import ENDPOINTS_METRICS_MAP | ||
|
||
|
||
class TektonCheck(OpenMetricsBaseCheckV2, ConfigMixin): | ||
DEFAULT_METRIC_LIMIT = 0 | ||
|
||
def __init__(self, name, init_config, instances): | ||
super(TektonCheck, self).__init__(name, init_config, instances) | ||
self.check_initializations.appendleft(self.parse_config) | ||
|
||
def parse_config(self): | ||
self.scraper_configs = [] | ||
|
||
if not any(self.instance.get(endpoint) for endpoint in ENDPOINTS_METRICS_MAP): | ||
raise ConfigurationError( | ||
f"Must specify at least one of the following: {', '.join(ENDPOINTS_METRICS_MAP.keys())}." | ||
) | ||
|
||
for endpoint, metrics in ENDPOINTS_METRICS_MAP.items(): | ||
if url := self.instance.get(endpoint): | ||
self.scraper_configs.append( | ||
self.generate_config(url, f"tekton.{endpoint.removesuffix('_endpoint')}", metrics) | ||
) | ||
|
||
def generate_config(self, endpoint, namespace, metrics): | ||
config = { | ||
'openmetrics_endpoint': endpoint, | ||
'metrics': [metrics], | ||
'namespace': namespace, | ||
} | ||
config |= self.instance | ||
return config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# (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 shared_skip_proxy(): | ||
return False | ||
|
||
|
||
def shared_timeout(): | ||
return 10 | ||
|
||
|
||
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 |
Oops, something went wrong.