> For the complete documentation index, see [llms.txt](https://docs.opsmx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opsmx.com/opsmx-1/opsmx-context-engine/additional-resources/previous-releases/isd-3.12/data-and-intelligence-module-autopilot/autopilot/enable-integration-into-ci-cd-pipelines/integrate-with-ci-cd.md).

# Integrate with CI/CD

### Triggering a Canary Analysis <a href="#triggering-a-canary-analysis" id="triggering-a-canary-analysis"></a>

OpsMx enables performing Canary Analysis on two separate deployments and provides a comprehensive report on the analysis after. This is typically triggered right after the deployment of the new build.

To start the analysis, trigger the follow API

### API for Registering a Canary Analysis <a href="#api-for-registering-a-canary-analysis" id="api-for-registering-a-canary-analysis"></a>

#### Pameters to be Specified: <a href="#pameters-to-be-specified" id="pameters-to-be-specified"></a>

```

application:                   Name of the Application
beginCanaryAnalysisAfterMins:  Time to enable warming up of the container
canaryAnalysisIntervalMins:    Intervals in which metric-data is fetched and analysed
**name:** (Important)          Specify the Metric-Template name and the Log-Template name
minimumCanaryResultScore:      The score under which the Canary Analysis should fail
canaryResultScore:             The score above which the Canary Analysis should be a pass
lifetimeHours:                 The time in hours for which the Canary Analysis should be run

canaryDeployments:             Specifies the deployments' information of the Analysis
baseline:                      The container-id of the base container being compared against
baselineStartTimeMs:           The timestamp in Epoch Milliseconds when to start the analysis of baseline container
canary:                        The container-id of the new container being compared
canaryStartTimeMs:             The timestamp in Epoch Milliseconds when to start the analysis of canary container
useLookBack & lookbackMins:    The parameter, useLookBack makes the call to indicate either to use lookbackMins or not to calculate the accurate start and end time of the canary analysis.
```

```
 POST http://{opsmx-server-ip}:8090/registerCanary 
```

#### Old sample input format: <a href="#old-sample-input-format" id="old-sample-input-format"></a>

```


    {
      "application" : "appName",
      "isJsonResponse": true,
      "canaryConfig" : {
        "canaryAnalysisConfig" : {
          "beginCanaryAnalysisAfterMins" : "0",
          "canaryAnalysisIntervalMins" : "30",
          "lookbackMins" : 0,
          "name" : "metric-template:swarm-template;log-template:madhu",
          "notificationHours" : [ ],
          "useLookback" : false
        },
        "canaryHealthCheckHandler" : {
          "@class" : "com.netflix.spinnaker.mine.CanaryResultHealthCheckHandler",
          "minimumCanaryResultScore" : "50"
        },
        "canarySuccessCriteria" : {
          "canaryResultScore" : "60"
        },
        "combinedCanaryResultStrategy" : "AGGREGATE",
        "lifetimeHours" : "0.5",
        "name" : "swarm",
        "application" : "appName"
      },
      "canaryDeployments" : [ {
        "@class" : ".CanaryTaskDeployment",
        "accountName" : "my-k8s-account",
        "baseline" : "2906d8455658",
        "baselineStartTimeMs": 1527942007000,
        "canary" : "fbad4ff8685c",
        "canaryStartTimeMs": 1527942007000
        "type" : "cluster"
      } ],
      "watchers" : [ ]
    }

```

#### New sample input format: <a href="#new-sample-input-format" id="new-sample-input-format"></a>

The new format includes a separate nested structure for baseline and canary deployment details. Optional sections for “log” and “metric” with name of service and the identifier as key-value pair.

```

{
    "application": "TouchPoint",
    "isJsonResponse": true,
    "canaryConfig": {
        "canaryAnalysisConfig": {
            "beginCanaryAnalysisAfterMins": "0",
            "canaryAnalysisIntervalMins": "30",
            "name": "metric-template:Metric-tmpl;log-template:Log-tmpl",
            "notificationHours": []
        },
        "canaryHealthCheckHandler": {
            "minimumCanaryResultScore": "70"
        },
        "canarySuccessCriteria": {
            "canaryResultScore": "90"
        },
        "combinedCanaryResultStrategy": "average",
        "lifetimeHours": "0.5",
        "name": "OpsMxUser"
    },
    "canaryDeployments": [{
        "baseline": {
            "log": {
                "TouchPoint-Svc": {
                    "container_name": "baseapp_rest_1"
                }
            },
            "metric": {
                "TouchPoint-Svc": {
                    "host": "service:baseapp"
                }
            }
        },
        "baselineStartTimeMs": 1585762800000,
        "canaryStartTimeMs": 1585762800000,
        "canary": {
            "log": {
                "TouchPoint-Svc": {
                    "container_name": "canaryapp_rest_1"
                }
            },
            "metric": {
                "TouchPoint-Svc": {
                    "host": "service:canaryapp"
                }
            }
        }
    }]
}
```

To get the Json response as the following, `{ "canaryId" : {canary-id} }`. Ensure to add the below after the application parameters "isJsonResponse": true. In case if basic canary-id response is sufficient, ensure to use the json without isJsonResponse. Which eventually returns the Canary-Id associated with this canary analysis run as the following `{canary-id}`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.opsmx.com/opsmx-1/opsmx-context-engine/additional-resources/previous-releases/isd-3.12/data-and-intelligence-module-autopilot/autopilot/enable-integration-into-ci-cd-pipelines/integrate-with-ci-cd.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
