﻿---
title: Elastic nightshift
description: Learn what Elastic nightshift is, why you'd use it, how it works, and where to start.
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/nightshift
products:
  - Elastic Cloud Serverless
  - Elastic Documentation
  - Elastic Observability
applies_to:
  - Serverless Observability projects: Preview
---

# Elastic nightshift
Elastic nightshift is an AI site reliability engineer (SRE) available in Elastic Observability Serverless. When something goes wrong in production, it investigates for you by querying your logs, metrics, and traces, reading your code if you connect it, testing explanations, and providing a likely cause with evidence and proposed actions. You decide what happens next.
It learns your system as it works, and brings that knowledge to every investigation, chat, and detection. It can also watch your data for problems that none of your alerts catch.
**To set up Elastic nightshift for the first time**, follow the [Get started](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/get-started) guide to go from enabling Elastic nightshift to your first investigation in a few steps.
![The Elastic nightshift home page, with investigations grouped by severity, including High investigations about inventory-api latency and Postgres lock timeouts](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/images/nightshift-home.png)


## Why use Elastic nightshift

Knowledge of how your system fits together usually sits with a few engineers. A new SRE has the skills but not the knowledge, and AI models start with the same gap. Elastic nightshift builds and maintains knowledge as it works, so it starts with the problem instead of learning your system.
Elastic nightshift does the first pass of an incident, so you start from a summary instead of a blank dashboard. Investigations use the data and alerts you already have, with no re-instrumenting and no rewritten rules. Detection starts once Elastic nightshift is on and a source is configured, so it can also find problems that none of your alerts catch. Here are some common situations and how they play out with and without Elastic nightshift:

| Situation                              | Without Elastic nightshift                                    | With Elastic nightshift                                                                                                |
|----------------------------------------|---------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| An alert fires                         | You piece together what changed from dashboards and traces.   | An automation investigates it. You open the likely cause and evidence.                                                 |
| Something is wrong, but no alert fired | Users or a teammate tell you.                                 | Detections group unusual changes into a significant event.                                                             |
| The cause is in the code               | You search your repositories for the change.                  | Elastic nightshift reads the relevant code and pull requests in a temporary sandbox, without copying or indexing them. |
| Your team works in Slack               | You copy charts and links into the channel.                   | You mention `@Elastic`, and the results appear in the thread.                                                          |
| A problem comes back                   | You have to find someone who remembers the previous solution. | Elastic nightshift starts with context from previous investigations.                                                   |


## How it works

![How an investigation flows from a trigger, through detection and context, to the proposed actions you decide on.](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/images/nightshift-how-it-works.png)

1. **An investigation starts.** The trigger can be a question, selecting **Investigate** on an alert or significant event, or an automation.
2. **Elastic nightshift investigates.** It queries your data, reads connected code, and tests hypotheses, ranked by confidence.
3. **It uses and builds context.** It reads its Wiki and Memory first to get context, and saves what it learns.
4. **It proposes actions.** It provides a likely cause, the evidence, proposed actions, and what it was unsure of.
5. **You decide.** Elastic nightshift doesn't change your environment unless you let it run your workflows. Refer to [Remediate with workflows](/elastic/docs-content/pull/9663/solutions/observability/nightshift/investigation/extend#nightshift-extend-remediate). You apply or decline each action. Administrators set run limits and can pause detection in [Settings and limits](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/settings).

Conclusions can be wrong. Before you act, check the reasoning in the hypothesis tree. Refer to [How investigations work](/elastic/docs-content/pull/9663/solutions/observability/nightshift/investigation#nightshift-investigations-accuracy).

## What it costs

Elastic nightshift is billed by the model tokens it uses, and daily run limits keep spending predictable. Refer to [Cost and models](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/cost-and-models).

## Availability

Elastic nightshift is available on Elastic Observability Serverless projects on the Complete tier, in the default space only. Refer to [Limitations](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/known-issues).

## Give feedback

On the Elastic nightshift home page, open the `boxes_vertical` menu and select **Feedback**.

## Learn more

- [Get started](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/get-started): Set up Elastic nightshift and run your first investigation.
- [Elastic nightshift use cases](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/use-cases): Follow step-by-step guides for investigating problems, automating investigations, and detecting problems.
- [How investigations work](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/investigation): Read an investigation and check its reasoning.
- [How Elastic nightshift builds context](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/context): Review or correct what Elastic nightshift learned in the Wiki, Memory, and Knowledge Indicators.
- [Cost and models](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/cost-and-models): Find out what Elastic nightshift costs and how your data is used.
- [Reference architecture](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9663/solutions/observability/nightshift/reference-architecture): Check what works with your deployment, whether Serverless, Elastic Cloud Hosted, or self-managed.