﻿---
title: Reference architecture
description: Check which Elastic nightshift features work with your deployment, whether your data is in a Serverless project, in projects linked by cross-project search, in Elastic Cloud Hosted, or in a self-managed cluster.
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/reference-architecture
products:
  - Elastic Cloud Serverless
  - Elastic Documentation
  - Elastic Observability
applies_to:
  - Serverless Observability projects: Preview
---

# Reference architecture
Elastic nightshift always runs in an Elastic Observability Serverless project. What it can do depends on where your data lives. Use this page to check what works with your setup before you start.
Elastic nightshift has two engines that reach your data in different ways:
- **Detection** watches your data through [sources](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/detection/sources). A source is an ES|QL query, so detection only reads data that the project can query meaning data in the project itself, or in projects linked by [cross-project search](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/deploy-manage/cross-project-search-config).
- **Investigation** queries your data through Elasticsearch connectors. A connector can point to any Elasticsearch cluster that Elastic nightshift can reach over the network with an API key. Refer to [Connect your data and tools](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/investigation/set-up).


## What works where


| Where your data lives                                                                        | Detection | Investigation       | How investigations reach the data                                                                                                   |
|----------------------------------------------------------------------------------------------|-----------|---------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| [A single serverless project](#nightshift-reference-architecture-single)                     | Yes       | Yes                 | **Local Elasticsearch** connector, created for you                                                                                  |
| [Serverless projects linked by cross-project search](#nightshift-reference-architecture-cps) | Yes       | Yes                 | External Elasticsearch connector to the Elastic nightshift project, with an Elastic Cloud API key that has connected cluster access |
| [An Elastic Cloud Hosted deployment](#nightshift-reference-architecture-ech)                 | No        | Yes                 | External Elasticsearch connector with an API key                                                                                    |
| [A self-managed cluster](#nightshift-reference-architecture-self-managed)                    | No        | Possible, with care | External Elasticsearch connector to a public, secured endpoint                                                                      |

For the best results, keep your data in Serverless, either in the Elastic nightshift project or in projects linked to it. Then detection and investigation both work. For linked projects, you create one API key.

## A single Serverless project

The simplest setup is having your logs, metrics, and traces in the same Elastic Observability Serverless project as Elastic nightshift.
![Elastic nightshift and your data in the same Serverless project. Detection and investigation both work.](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/images/nightshift-ref-arch-single-project.svg)

- **Detection**: Add a source such as **All logs** and select **Enable detection**. Refer to [Manage what detection monitors](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/detection/sources).
- **Investigation**: When you enable Elastic nightshift, it creates a **Local Elasticsearch** connector for the project. You don't set up anything else.


## Multiple Serverless projects with cross-project search

Your data is spread across several Serverless projects, for example one project per team or per region, and the Elastic nightshift project is linked to them with [cross-project search](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/deploy-manage/cross-project-search-config).
![The Elastic nightshift project linked to other Serverless projects by cross-project search. Detection and investigation both work across the linked projects.](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/images/nightshift-ref-arch-cps.svg)

- **Detection**: Works across the linked projects. A source query reads the linked projects in the same way as the local one.
- **Investigation**: The **Local Elasticsearch** connector searches only the Elastic nightshift project. To search the linked projects, add an External Elasticsearch connector that points to the Elastic nightshift project, with an API key that you create in the Elastic Cloud console and that has connected cluster access. Refer to [Search projects linked through cross-project search](/elastic/docs-content/pull/9658/solutions/observability/nightshift/investigation/set-up#nightshift-set-up-cps).

This is the recommended setup when your data lives in more than one place. Link the projects once, and add one connector, and Elastic nightshift sees all of them.

## An Elastic Cloud Hosted deployment

Your data is in an [Elastic Cloud Hosted](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/deploy-manage/deploy/elastic-cloud/cloud-hosted) deployment, and Elastic nightshift runs in a separate Serverless project.
![Elastic nightshift in a Serverless project connects to an Elastic Cloud Hosted deployment with an External Elasticsearch connector and a read-only API key. Investigation works. Detection doesn't.](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/images/nightshift-ref-arch-ech.svg)

- **Detection**: Sources can't read data in an Elastic Cloud Hosted deployment.
- **Investigation**: Add an External Elasticsearch connector that points to the deployment's Elasticsearch endpoint and uses a read-only API key. Refer to [Add data](/elastic/docs-content/pull/9658/solutions/observability/nightshift/get-started#nightshift-get-started-add-data) for the API key request and where to find the endpoint.

Automations start from alerts in the Elastic nightshift project. To investigate alerts that fire in the Elastic Cloud Hosted deployment automatically, send them to a Slack channel or to a webhook in the Elastic nightshift project. Refer to [Investigate alerts from your other tools](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/use-cases/external-alerts).

## A self-managed Elasticsearch cluster

Your data is in an Elasticsearch cluster that you run yourself, on premises or in your own cloud account.
![Elastic nightshift in a Serverless project connects to a self-managed cluster through a public, secured endpoint with an External Elasticsearch connector. Investigation is possible with care. Detection doesn't work.](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/images/nightshift-ref-arch-self-managed.svg)

- **Detection**: Sources can't read data in a self-managed cluster.
- **Investigation**: Only possible if Elastic nightshift can reach your cluster's Elasticsearch endpoint over the internet. An External Elasticsearch connector runs in Elastic Cloud, so it can't reach a cluster that is only on a private network. Mutual TLS (mTLS) and private connectivity, such as AWS PrivateLink, aren't supported.

<warning>
  Exposing a cluster to the internet is a security decision for your team. If you do it, secure the endpoint before you connect it:
  - Use TLS with a trusted certificate. Refer to [Secure cluster communications](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/deploy-manage/security/secure-cluster-communications).
  - Use a dedicated API key that can only read the indices that investigations need. Refer to [Elasticsearch API keys](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/deploy-manage/api-keys/elasticsearch-api-keys).
  - Restrict who can connect, for example with IP filtering or a reverse proxy in front of the cluster. Refer to [IP filtering](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/deploy-manage/security/ip-filtering).
</warning>

If you can't expose the cluster, consider sending the data you want Elastic nightshift to investigate to a Serverless project instead, for example with OpenTelemetry or Elastic Agent. Refer to [Get started with Elastic Observability Serverless](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/get-started).

## Next steps

- [Get started](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/get-started): Enable Elastic nightshift and connect your data
- [Connect your data and tools](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/investigation/set-up): Set up Local and External Elasticsearch connectors, GitHub, and Slack
- [How detection works](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/detection): Learn what detection needs from your data
- [Limitations](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9658/solutions/observability/nightshift/known-issues): Check the Tech Preview limitations