> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chronosphere.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Collections

export const CollectionNavIcon = props => {
  const drawPath = "M8.4 18.2C8.8 18.7 9 19.3 9 20C9 21.7 7.7 23 6 23S3 21.7 3 20 4.3 17 6 17C6.4 17 6.8 17.1 7.2 17.3L8.6 15.5C7.7 14.5 7.3 13.1 7.5 11.8L5.5 11.1C5 11.9 4.1 12.5 3 12.5C1.3 12.5 0 11.2 0 9.5S1.3 6.5 3 6.5 6 7.8 6 9.5V9.7L8 10.4C8.6 9.2 9.8 8.3 11.2 8.1V5.9C10 5.6 9 4.4 9 3C9 1.3 10.3 0 12 0S15 1.3 15 3C15 4.4 14 5.6 12.8 5.9V8.1C14.2 8.3 15.4 9.2 16 10.4L18 9.7V9.5C18 7.8 19.3 6.5 21 6.5S24 7.8 24 9.5 22.7 12.5 21 12.5C19.9 12.5 19 11.9 18.5 11.1L16.5 11.8C16.7 13.1 16.3 14.5 15.4 15.5L16.8 17.3C17.2 17.1 17.6 17 18 17C19.7 17 21 18.3 21 20S19.7 23 18 23 15 21.7 15 20C15 19.3 15.2 18.7 15.6 18.2L14.2 16.4C12.8 17.2 11.2 17.2 9.8 16.4L8.4 18.2Z";
  return <svg viewBox="0 0 24 24" data-testid="Collections" aria-label="Collections" {...props} className="inline-block h-5 w-5 fill-current">
      <path d={drawPath} />
    </svg>;
};

A *collection* is a group of Chronosphere Observability Platform resources, such as
[dashboards](/observe/dashboards) and [monitors](/investigate/alerts/monitors), associated with a
service or feature you want to monitor.

A [*team*](/administer/accounts-teams/teams), consisting of
[*user accounts*](/administer/accounts-teams/user-accounts) and
[*service accounts*](/administer/accounts-teams/service-accounts) that share
responsibility for the service or feature, is also responsible for each collection.

Collections help service and feature owners manage their services at scale and
streamline incident response by consolidating all relevant information about a
service or feature into one place, and sharing access to that information with
everyone in its responsible team.

For example, to ensure that your team and on-call engineers all have full context for
a service, you can create a collection for it that provides direct access to its
monitors, dashboards, and the team members who can respond to incidents.
Observability Platform then provides a menu of a team's collections to its members
who can quickly review resources most relevant to their services, and a homepage for
the collection that the team can share with on-call engineers or other stakeholders.

## View collections

<Tabs>
  <Tab title="Web" id="view-collections-web">
    To search for a collection:

    1. Click the search bar to focus on it, or use the keyboard shortcut
       `Control+K` (`Command+K` on macOS).
       1. Begin typing any part of the collection's name.
       2. Optional: Click the filters for all other listed resource types at the top of
          the search results to remove them and display only collections.
       3. Click the search result you're interested in, or use the arrow keys to select
          it and press `Enter` (`Return` on macOS), to select that
          collection.

    To browse collections by their respective teams, in the navigation menu click
    **<CollectionNavIcon /> Collections**. Collections associated with teams that
    you belong to appear first, followed by lists of **All Teams & Collections**
    and **Unowned Collections**. To expand the latter lists, click the list's
    <Icon icon="chevron-down" /> expand icon.

    If you have administrative privileges, you can view a filterable list.

    1. In the navigation menu, click **<Icon icon="shield-user" /> Go to Admin** and
       then select
       **Platform <span aria-label="and then">></span> Collections**.
       Clicking a collection or team in this table takes you to their respective
       homepages.

       * To filter this table by keyword, click **Search collections** and begin typing.
         The table automatically updates to display only the matching collections.
       * To filter this list by teams, select them in the **Select a Team** dropdown.
       * To display only collections that lack an owner, enable the **Unowned Collections Only**
         toggle.

    You can optionally select collections by checking the checkbox on each collection's
    row, which reveals an **Edit Team Association** button. Clicking this button allows
    you to select a parent team for all selected collections. If you select a team,
    click **Save** to save the edited association. For more Collection editing features,
    see [Edit a Collection](#edit-a-collection).
  </Tab>

  <Tab title="Chronoctl" id="view-collections-chronoctl">
    To view a list of all collections using [Chronoctl](/tooling/chronoctl), use the
    `collections list` command:

    ```shell theme={null}
    chronoctl collections list
    ```

    This returns a list of YAML documents separated by three dashes (`---`), each
    representing a collection:

    ```yaml theme={null}
    api_version: v1/config
    kind: Collection
    spec:
      slug: example-collection
      name: Example Collection
      team_slug: example-team
      description: Example Team - Example Collection
    ```
  </Tab>

  <Tab title="API" id="view-collections-api">
    To complete this action with the Chronosphere API, use the
    [`ListCollections`](/tooling/api-info/definition/operations/ListCollections) endpoint.

    Because the Chronosphere API requires authentication, include an API token with your
    `curl` request, as shown in the following example. For more details, see
    [Create an API token](/tooling/api-info#create-an-api-token).

    ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
    export CHRONOSPHERE_API_TOKEN="TOKEN"
    export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"

    curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
         -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
    ```

    Replace the following:

    * *`TOKEN`*: Your API token.
    * *`INSTANCE`*: The subdomain name for your organization's Observability Platform instance.
    * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
    * *`ENDPOINT_PATH`*: The specific endpoint you want to access.
  </Tab>
</Tabs>

## Create a collection

You can use Observability Platform to create Terraform, Chronoctl, or API
configurations, which you must then apply using the respective application.

Collections use a `slug` as an identifier. [Services](/observe/services) also use a
`slug`. Collection and service slugs can have the same value.

<Tabs>
  <Tab title="Web" id="create-a-collection-web">
    To create a collection, you must have administrative privileges.

    1. In the navigation menu, click **<Icon icon="shield-user" /> Go to Admin**
       and then click
       **Platform <span aria-label="and then">></span> Collections**.
    2. Click **Create collection**.
    3. In the dialog that appears, enter a descriptive name in the **Collection Name**
       field. Observability Platform displays this name anywhere that it refers to this
       collection.
    4. Optional: Click the **Parent team** dropdown and select a team to which
       you're associating this collection. If the dropdown doesn't contain any teams,
       you can create one.
    5. Optional: Enter a description in the **Collection Description** field.
       Observability Platform displays this description when you view this collection's
       homepage.
    6. Click **Save**.
  </Tab>

  <Tab title="Chronoctl" id="create-a-collection-chronoctl">
    To create a collection using [Chronoctl](/tooling/chronoctl), apply a `Collection` resource.
    The resource contains these fields:

    | Field                      | Type   | Description                                                                                                                                     |
    | -------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
    | `name`                     | String | The collection name as displayed in Observability Platform.                                                                                     |
    | `slug`                     | String | Optional: A unique identifier that Observability Platform uses to identify the collection. If omitted, Observability Platform generates a slug. |
    | `team_slug`                | String | Optional: The slug of the team with which you're associating with this collection.                                                              |
    | `description`              | String | A description displayed when viewing this collection.                                                                                           |
    | `notification_policy_slug` | String | The slug of a notification policy that you're associating with this collection.                                                                 |

    For example, this resource creates a new collection named `DBAs` with the slug
    `dbas-collection` and associated with `dbas-team`:

    ```yaml theme={null}
    api_version: v1/config
    kind: Collection
    spec:
      slug: dbas-collection
      name: DBAs
      team_slug: dbas-team
      description: Collection of database-related resources.
      notification_policy_slug: dbas-policy
    ```

    To create the collection:

    1. Save the `Collection` resource definition to a file, such as `collection.yaml`.

    2. Test the changes with a dry run:

       ```shell theme={null}
       chronoctl collections create -f collection.yaml -d
       ```

    3. Apply the changes:

       ```shell theme={null}
       chronoctl collections create -f collection.yaml
       ```
  </Tab>

  <Tab title="Terraform" id="create-a-collection-terraform">
    To create a collection using [Terraform](/tooling/infrastructure/terraform), use
    the `chronosphere_collection` resource type.

    | Field                    | Type   | Description                                                                                                                                     |
    | ------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
    | `name`                   | String | The collection name as displayed in Observability Platform.                                                                                     |
    | `slug`                   | String | Optional: A unique identifier that Observability Platform uses to identify the collection. If omitted, Observability Platform generates a slug. |
    | `team_id`                | String | Optional: The identifier of the team with which you're associating with this collection.                                                        |
    | `description`            | String | A description displayed when viewing this collection.                                                                                           |
    | `notification_policy_id` | String | Optional: The identifier of a notification policy that you're associating with this collection.                                                 |

    For example, this resource creates a new collection that Terraform refers to as
    `databases`, names it `Databases` in Observability Platform, provides a description, associates
    the collection with a notification policy, and assigns the collection to the team `dbas`:

    ```terraform theme={null}
    resource "chronosphere_collection" "infra" {
      name        = "Databases"
      team_id     = chronosphere_team.dbas.id
      description = "Collection of resources related to database services."
      notification_policy_id = chronosphere_notification_policy.np.id
    }
    ```
  </Tab>

  <Tab title="API" id="create-a-collection-api">
    To complete this action with the Chronosphere API, use the
    [`CreateCollection`](/tooling/api-info/definition/operations/CreateCollection) endpoint.

    Because the Chronosphere API requires authentication, include an API token with your
    `curl` request, as shown in the following example. For more details, see
    [Create an API token](/tooling/api-info#create-an-api-token).

    ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
    export CHRONOSPHERE_API_TOKEN="TOKEN"
    export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"

    curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
         -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
    ```

    Replace the following:

    * *`TOKEN`*: Your API token.
    * *`INSTANCE`*: The subdomain name for your organization's Observability Platform instance.
    * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
    * *`ENDPOINT_PATH`*: The specific endpoint you want to access.
  </Tab>
</Tabs>

## Edit a collection

<Tabs>
  <Tab title="Web" id="edit-a-collection-web">
    <Note>
      Users can modify Terraform-managed resources only by using Terraform.
      [Learn more](/tooling/infrastructure/terraform#prevent-changes-to-managed-resources).
    </Note>

    To edit a collection, you must have administrative privileges.

    1. In the navigation menu, click **<Icon icon="shield-user" /> Go to Admin** and
       then select
       **Platform <span aria-label="and then">></span> Collections**.
    2. Click the name of the collection you want to modify.
    3. In the **Collection information** section, click
       **<Icon icon="pencil" /> Edit**.
    4. In the dialog that appears, edit the collection based on your needs.
    5. Click **Save**.

    You can optionally select collections by checking the checkbox on each collection's
    row, which reveals an **Edit Team Association** button. Clicking this button allows
    you to select a parent team for all selected collections. If you select a team,
    click **Save** to save the edited association. For more Collection editing features,
    see [Edit a Collection](#edit-a-collection).
  </Tab>

  <Tab title="Chronoctl" id="edit-a-collection-chronoctl">
    To edit a collection using [Chronoctl](/tooling/chronoctl), modify
    an existing `Collection` resource, then apply the change.

    To view `Collection` resources as Chronoctl YAML, see
    [View collections](#view-collections).

    1. Copy the `Collection` resource for the collection you want to edit.

    2. Save the collection to a file, such as `collection.yml`.

    3. Modify the collection's fields. For details, see [Create a collection](#create-a-collection).

    4. Test the changes with a dry run:

       ```shell theme={null}
       chronoctl collections create -f collection.yaml -d
       ```

    5. Apply the changes:

       ```shell theme={null}
       chronoctl collections create -f collection.yaml
       ```
  </Tab>

  <Tab title="Terraform" id="edit-a-collection-terraform">
    To edit a collection using [Terraform](/tooling/infrastructure/terraform), modify
    its resource and apply it using Terraform.
  </Tab>

  <Tab title="API" id="edit-a-collection-api">
    To complete this action with the Chronosphere API, use the
    [`UpdateCollection`](/tooling/api-info/definition/operations/UpdateCollection) endpoint.

    Because the Chronosphere API requires authentication, include an API token with your
    `curl` request, as shown in the following example. For more details, see
    [Create an API token](/tooling/api-info#create-an-api-token).

    ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
    export CHRONOSPHERE_API_TOKEN="TOKEN"
    export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"

    curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
         -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
    ```

    Replace the following:

    * *`TOKEN`*: Your API token.
    * *`INSTANCE`*: The subdomain name for your organization's Observability Platform instance.
    * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
    * *`ENDPOINT_PATH`*: The specific endpoint you want to access.
  </Tab>
</Tabs>

## Delete a collection

<Warning>
  Before you delete a collection, you must first remove all of its monitors and dashboards.
  You can do this by either deleting them or moving them to other collections.
</Warning>

<Tabs>
  <Tab title="Web" id="delete-a-collection-web">
    <Note>
      Users can modify Terraform-managed resources only by using Terraform.
      [Learn more](/tooling/infrastructure/terraform#prevent-changes-to-managed-resources).
    </Note>

    To delete a collection, you must have administrative privileges.

    1. In the navigation menu, click **<Icon icon="shield-user" /> Go to Admin** and
       then select
       **Platform <span aria-label="and then">></span> Collections**.
    2. Click the name of the collection you want to delete.
    3. In the **Collection information** section, click
       **<Icon icon="pencil" /> Edit**.
    4. In the dialog that appears, click **Delete collection**.
  </Tab>

  <Tab title="Chronoctl" id="delete-a-collection-chronoctl">
    <Note>
      Users can modify Terraform-managed resources only by using Terraform.
      [Learn more](/tooling/infrastructure/terraform#prevent-changes-to-managed-resources).
    </Note>

    To delete a collection using [Chronoctl](/tooling/chronoctl), use
    the `collections delete` command:

    ```shell /SLUG/ theme={null}
    chronoctl collections delete SLUG
    ```

    Replace *`SLUG`* with the slug for the collection you want to delete.

    For example, to delete a collection with the slug `dbas-collection`, run:

    ```shell theme={null}
    chronoctl collections delete dbas-collection
    ```
  </Tab>

  <Tab title="Terraform" id="delete-a-collection-terraform">
    To delete a resource that's managed by [Terraform](/tooling/infrastructure/terraform):

    1. Edit your Terraform configuration file to remove the pre-existing resource
       definition.
    2. Run this command to remove the resource from Observability Platform:

       ```shell theme={null}
       terraform apply
       ```
  </Tab>

  <Tab title="API" id="delete-a-collection-api">
    To complete this action with the Chronosphere API, use the
    [`DeleteCollection`](/tooling/api-info/definition/operations/DeleteCollection) endpoint.

    Because the Chronosphere API requires authentication, include an API token with your
    `curl` request, as shown in the following example. For more details, see
    [Create an API token](/tooling/api-info#create-an-api-token).

    ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
    export CHRONOSPHERE_API_TOKEN="TOKEN"
    export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"

    curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
         -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
    ```

    Replace the following:

    * *`TOKEN`*: Your API token.
    * *`INSTANCE`*: The subdomain name for your organization's Observability Platform instance.
    * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
    * *`ENDPOINT_PATH`*: The specific endpoint you want to access.
  </Tab>
</Tabs>
