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

[AI-4784] DDSaaS: Sonatype Nexus: Integration v1.0.0 #19365

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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 @@ -562,6 +562,10 @@ coverage:
target: 75
flags:
- sonarqube
sonatype_nexus:
target: 75
flags:
- sonatype_nexus
Spark:
target: 75
flags:
Expand Down Expand Up @@ -1443,6 +1447,11 @@ flags:
paths:
- sonarqube/datadog_checks/sonarqube
- sonarqube/tests
sonatype_nexus:
carryforward: true
paths:
- sonatype_nexus/datadog_checks/sonatype_nexus
- sonatype_nexus/tests
spark:
carryforward: true
paths:
Expand Down
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ datadog_checks_base/datadog_checks/base/checks/windows/ @DataDog/wi
/snowflake/*.md @DataDog/saas-integrations @DataDog/documentation @DataDog/agent-integrations
/snowflake/manifest.json @DataDog/saas-integrations @DataDog/documentation

/sonatype_nexus/ @DataDog/saas-integrations
/sonatype_nexus/*.md @DataDog/saas-integrations @DataDog/documentation
/sonatype_nexus/manifest.json @DataDog/saas-integrations @DataDog/documentation
/sonatype_nexus/metadata.csv @DataDog/saas-integrations @DataDog/documentation

/sonicwall_firewall/ @DataDog/saas-integrations
/sonicwall_firewall/*.md @DataDog/saas-integrations @DataDog/documentation
/sonicwall_firewall/manifest.json @DataDog/saas-integrations @DataDog/documentation
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 @@ -497,6 +497,8 @@ integration/solr:
- solr/**/*
integration/sonarqube:
- sonarqube/**/*
integration/sonatype_nexus:
- sonatype_nexus/**/*
integration/sonicwall_firewall:
- sonicwall_firewall/**/*
integration/sophos_central_cloud:
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 @@ -3294,6 +3294,26 @@ jobs:
minimum-base-package: ${{ inputs.minimum-base-package }}
pytest-args: ${{ inputs.pytest-args }}
secrets: inherit
j3835902:
uses: ./.github/workflows/test-target.yml
with:
job-name: sonatype_nexus
target: sonatype_nexus
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
j529bc3b:
uses: ./.github/workflows/test-target.yml
with:
Expand Down
9 changes: 9 additions & 0 deletions sonatype_nexus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# CHANGELOG - sonatype_nexus

<!-- towncrier release notes start -->

## 1.0.0 / 2025-01-08

***Added***:

* Initial Release
103 changes: 103 additions & 0 deletions sonatype_nexus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
## Overview

Sonatype Nexus is a popular repository management solution designed for managing software components and dependencies across the entire software development lifecycle. It supports a wide range of development languages and formats, making it a central hub for DevOps and continuous integration/continuous delivery (CI/CD) pipelines.

The Sonatype Nexus integration collects analytics and instance health status metrics from Sonatype Nexus and sends them to Datadog for comprehensive analysis.

## Setup

### Installation

The Sonatype Nexus check is included in the [Datadog Agent package][1]. No additional installation is necessary.

### Get API credentials from Sonatype Nexus

1. The `Username` and `Password` of either the **Administrator** account or a user with the **nx-metrics-all** privilege

2. The `Server URL` of the Repository instance. For Ex: https://123.123.123.123:8081

### Connect your Sonatype Nexus account to agent

1. Copy the `conf.yaml.example` file.

```sh
cp /etc/datadog-agent/conf.d/sonatype_nexus.d/conf.yaml.example /etc/datadog-agent/conf.d/sonatype_nexus.d/conf.yaml
```

2. Edit the `/etc/datadog-agent/conf.d/sonatype_nexus.d/conf.yaml` file. Add the following configurations.

```yaml
instances:

## @param username - string - required
## Username of Sonatype Nexus instance
#
- username: <SONATYPE_NEXUS_USERNAME>

## @param password - string - required
## Password of Sonatype Nexus instance
#
password: <SONATYPE_NEXUS_PASSWORD>

## @param server_url - string - required
## Sonatype Nexus server url
#
sonatype_nexus_server_url: <SONATYPE_NEXUS_SERVER_URL>

## @param min_collection_interval - number - required
## This changes the collection interval of the check. For more information, see:
## https://docs.datadoghq.com/developers/write_agent_check/#collection-interval
#
min_collection_interval: 600
```
* Example for the `conf.yaml` when multiple instances of Sonatype Nexus are configured:

```yaml
instances:
- min_collection_interval: 1800
username: <SONATYPE_NEXUS_USERNAME>
password: <SONATYPE_NEXUS_PASSWORD>
sonatype_nexus_server_url: <SONATYPE_NEXUS_SERVER_URL>
- min_collection_interval: 1800
username: <SONATYPE_NEXUS_USERNAME>
password: <SONATYPE_NEXUS_PASSWORD>
sonatype_nexus_server_url: <SONATYPE_NEXUS_SERVER_URL>
```

3. [Restart the Agent][2].

### Validation

- [Run the Agent's status subcommand][3] and look for `sonatype_nexus` under the Checks section.

## Data Collected

### Logs
The Sonatype Nexus integration does not include any logs.

### Metrics

The Sonatype Nexus integration collects and forwards analytics, and instance health status metrics to Datadog.

{{< get-metrics-from-git "sonatype_nexus" >}}

### Events

The Sonatype Nexus integration forwards below events to Datadog.
1. sonatype_nexus.conf_validation
2. sonatype_nexus.authentication_validation

### Service Checks

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

## Support

For further assistance, contact [Datadog support][4].


[1]: https://app.datadoghq.com/account/settings/agent/latest
[2]: https://docs.datadoghq.com/agent/guide/agent-commands/?tab=agentv6v7#start-stop-and-restart-the-agent
[3]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[4]: https://docs.datadoghq.com/help/
[6]: https://github.com/DataDog/integrations-core/blob/master/sonatype_nexus/assets/service_checks.json
33 changes: 33 additions & 0 deletions sonatype_nexus/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: sonatype_nexus
files:
- name: sonatype_nexus.yaml
options:
- template: instances
options:
- name: username
required: true
description: "The username of your Sonatype Nexus account."
value:
type: string
example: test_username
- name: password
required: true
description: "The password of your Sonatype Nexus account."
value:
type: string
example: test_password
- name: sonatype_nexus_server_url
required: true
description: "The Server URL of your Sonatype Nexus account."
value:
type: string
example: https://0.0.0.0:8081
- template: instances/default
overrides:
min_collection_interval.required: true
min_collection_interval.value.example: 600
min_collection_interval.value.minimum: 600
min_collection_interval.value.maximum: 64800
service.hidden: true
empty_default_hostname.hidden: true
metric_patterns.hidden: true
1,019 changes: 1,019 additions & 0 deletions sonatype_nexus/assets/dashboards/sonatype_nexus_instance_health.json

Large diffs are not rendered by default.

1,227 changes: 1,227 additions & 0 deletions sonatype_nexus/assets/dashboards/sonatype_nexus_metrics.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": 2,
"created_at": "2025-01-08",
"last_updated_at": "2025-01-08",
"title": "High number of failed unique user authentications detected",
"description": "Failed authentication attempts may indicate security risks, including unauthorized access or misconfigured credentials. This monitor tracks failed unique user authentications to identify issues and mitigate risks, ensuring secure access and system reliability.",
"definition": {
"id": 161336669,
"name": "High number of failed unique user authentications detected",
"type": "query alert",
"query": "max(last_1d):avg:sonatype_nexus.analytics.failed_unique_user_authentication_count{*} by {sonatype_host} > 10",
"message": "{{#is_alert}}\nRepeated failed authentication attempts can indicate potential security issues, such as unauthorized access attempts or misconfigured user credentials.\n\nA high number of failed unique user authentications have been detected. Take necessary action to mitigate potential risks.\n{{/is_alert}}",
"tags": [
"integration:sonatype_nexus",
"type:metrics"
],
"options": {
"thresholds": {
"critical": 10
},
"notify_audit": false,
"on_missing_data": "default",
"include_tags": true,
"silenced": {}
},
"priority": null,
"restriction_policy": {
"bindings": []
}
},
"tags": [
"integration:sonatype-nexus"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": 2,
"created_at": "2025-01-08",
"last_updated_at": "2025-01-08",
"title": "High percentage of JVM heap memory usage detected",
"description": "JVM heap memory stores objects created by Java applications, managed by the JVM, with garbage collection cleaning unused objects. This monitor tracks high JVM heap usage to identify and address issues, ensuring optimal memory management and application performance.",
"definition": {
"id": 161337519,
"name": "High percentage of JVM heap memory usage detected",
"type": "query alert",
"query": "avg(last_1h):(avg:sonatype_nexus.analytics.jvm.heap_memory_used{*} by {sonatype_host} / avg:sonatype_nexus.analytics.jvm.heap_memory_max{*} by {sonatype_host}) * 100 > 80",
"message": "{{#is_alert}}\nJMV heap memory stores all the objects created by the Java application. The JVM manages this space, and a special process called garbage collection automatically cleans up unused objects to free up memory.\n\nHigh percentage of JVM heap memory usage detected. Take necessary action to mitigate the issue.\n{{/is_alert}}",
"tags": [
"integration:sonatype_nexus",
"type:metrics"
],
"options": {
"thresholds": {
"critical": 80
},
"notify_audit": false,
"on_missing_data": "default",
"include_tags": true,
"new_group_delay": 0,
"silenced": {}
},
"priority": null,
"restriction_policy": {
"bindings": []
}
},
"tags": [
"integration:sonatype-nexus"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": 2,
"created_at": "2025-01-08",
"last_updated_at": "2025-01-08",
"title": "Unhealthy available CPUs detected",
"description": "Available CPUs influence long-running operations and thread allocation in the web container. This monitor tracks CPU availability to identify issues and ensure optimal performance, preventing delays and maintaining system efficiency.",
"definition": {
"id": 161340184,
"name": "Unhealthy available CPUs detected",
"type": "query alert",
"query": "min(last_30m):avg:sonatype_nexus.status.available_cpus_health{*} by {sonatype_host} == 0",
"message": "{{#is_alert}}\nAvailable CPUs impacts longer running operations and also the thread allocation algorithms of the web container.\n\nAn unhealthy status for available CPUs has been detected. Take necessary action to mitigate potential risks.\n{{/is_alert}}",
"tags": [
"integration:sonatype_nexus",
"type:health_status"
],
"options": {
"thresholds": {
"critical": 0
},
"notify_audit": false,
"on_missing_data": "default",
"include_tags": true,
"silenced": {}
},
"priority": null,
"restriction_policy": {
"bindings": []
}
},
"tags": [
"integration:sonatype-nexus"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": 2,
"created_at": "2025-01-08",
"last_updated_at": "2025-01-08",
"title": "Unhealthy blob stores detected",
"description": "Nexus Repository uses blob storage to store repository files, including metadata, hashes, and indexes. This monitor tracks blob store health to prevent issues, ensuring efficient storage and system reliability. Immediate action is needed to address detected problems.",
"definition": {
"id": 161340768,
"name": "Unhealthy blob stores detected",
"type": "query alert",
"query": "min(last_30m):avg:sonatype_nexus.status.blob_store.ready_health{*} by {sonatype_host} == 0",
"message": "{{#is_alert}}\nNexus Repository uses a binary large object (blob) storage, or blob store, to store files found in a repository. This includes metadata, hashes, and repository-generated indexes.\n\nAn unhealthy status for blob stores has been detected. Take necessary action to mitigate the issue.\n{{/is_alert}}",
"tags": [
"integration:sonatype_nexus",
"type:health_status"
],
"options": {
"thresholds": {
"critical": 0
},
"notify_audit": false,
"on_missing_data": "default",
"include_tags": true,
"silenced": {}
},
"priority": null,
"restriction_policy": {
"bindings": []
}
},
"tags": [
"integration:sonatype-nexus"
]
}
Loading
Loading