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

Prepare for Mergify built-in integration #2487

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
45 changes: 37 additions & 8 deletions mergify/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Agent Check: Mergify
# Mergify

## Overview

Expand All @@ -10,13 +10,29 @@ and optimize your development workflow using this Datadog integration.

## Setup

### Installation
You can either install the built-in integration, or install the agent.

#### From release
### Setup Built-In Integration

- **In Mergify dashboard**: Go to [Mergify dashboard][10], log in and navigate to **Integrations**.

- Click the **Connect** button in the **Datadog** tile.

![Mergify Screenshot][12]

- You will be redirected to the Datadog authorization page.

- Log in to Datadog to complete setup.

Your Mergify statistics now appear in Datadog.

### Setup Agent

#### From Release

Run `datadog-agent integration install -t datadog-mergify==<INTEGRATION_VERSION>`.

#### From source
#### From Source

To install the Mergify check on your host:

Expand All @@ -30,25 +46,36 @@ To install the Mergify check on your host:
run `datadog-agent integration install -w
path/to/mergify/dist/<ARTIFACT_NAME>.whl`.

### Configuration
#### Configuration

1. Edit the `mergify.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory][9] to start collecting your Mergify [metrics](#metrics).

See the sample [mergify.d/conf.yaml.example][3] file for all available configuration options.

2. [Restart the Agent][4].

### Validation
#### Validation

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

## Uninstallation

- **In Mergify dashboard**: Go to [Mergify dashboard][10], log in and navigate to **Integrations**.

- Click the **Disconnect** button in the **Datadog** tile.

Once this integration has been uninstalled, any previous authorizations are revoked.

Additionally, ensure that all API keys associated with this integration have been disabled by searching for the integration name on the [API Keys page][11].

## Data Collected

### Metrics

See [metadata.csv][6] for a list of metrics provided by this check.

For the metric `mergify.queue_checks_outcome`, the available `outcome_type` tags are :

- `PR_DEQUEUED`: The number of PRs that have been manually removed from the queue
- `PR_AHEAD_DEQUEUED`: The number of PRs that have been removed from the queue because a PR ahead of it was removed from the queue
- `PR_AHEAD_FAILED_TO_MERGE`: The number of PRs that have been removed from the queue because a PR ahead of it failed to merge
Expand All @@ -65,7 +92,6 @@ For the metric `mergify.queue_checks_outcome`, the available `outcome_type` tags
- `PR_UNEXPECTEDLY_FAILED_TO_MERGE`: The number of PRs that have been removed from the queue because they unexpectedly failed to get merged
- `BATCH_MAX_FAILURE_RESOLUTION_ATTEMPTS`: The number of PRs that have been removed from the queue because the maximum batch failure resolution attempts have been reached


### Service Checks

See [service_checks.json][7] for a list of service checks provided by this integration.
Expand All @@ -74,7 +100,7 @@ See [service_checks.json][7] for a list of service checks provided by this integ

Mergify does not include any events.

## Troubleshooting
## Support

Need help? Contact [Mergify support][1].

Expand All @@ -87,3 +113,6 @@ Need help? Contact [Mergify support][1].
[7]: https://github.com/DataDog/integrations-extras/blob/master/mergify/assets/service_checks.json
[8]: https://docs.datadoghq.com/developers/integrations/new_check_howto/#configure-the-developer-tool
[9]: https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory
[10]: https://dashboard.mergify.com
[11]: https://app.datadoghq.com/organization-settings/api-keys?filter=Mergify
[12]: https://raw.githubusercontent.com/DataDog/integrations-extras/master/mergify/images/setup_integration.png
Binary file added mergify/images/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mergify/images/setup_integration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 15 additions & 3 deletions mergify/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
"overview": "README.md#Overview",
"configuration": "README.md#Setup",
"support": "README.md#Support",
"uninstallation": "README.md#Uninstallation",
"changelog": "CHANGELOG.md",
"description": "Mergify merge queue statistics integration",
"title": "Mergify",
"media": [],
"media": [
{
"media_type": "image",
"caption": "Mergify - Dashboard",
"image_url": "images/dashboard.png"
}
],
"classifier_tags": [
"Supported OS::Linux",
"Supported OS::Windows",
Expand All @@ -31,7 +38,12 @@
},
"metrics": {
"prefix": "mergify.",
"check": "mergify.queue_checks_outcome",
"check": [
"mergify.merge_queue_length",
"mergify.time_to_merge.median",
"mergify.time_to_merge.mean",
"mergify.queue_checks_outcome"
],
"metadata_path": "metadata.csv"
},
"service_checks": {
Expand All @@ -50,4 +62,4 @@
"homepage": "https://mergify.com",
"sales_email": "[email protected]"
}
}
}
Loading