# Dynatrace

<span class="status stable">Stable</span>

Dynatrace is a software intelligence platform for monitoring, analyzing, and optimizing application performance.

| Property                | Value                    |
| ----------------------- | ------------------------ |
| **Type**                | SaaS Monitoring Platform |
| **Forge Compatibility** | Forge 2.1+, Forge 3.0    |
| **Status**              | Stable                   |

---

## Description

Dynatrace is a software intelligence platform that provides advanced monitoring and analytics for applications, infrastructure, and user experiences. It uses AI-driven insights to automatically detect and diagnose performance issues across complex, dynamic environments, including cloud-native, hybrid, and on-premises systems.

Dynatrace offers real-time observability into application performance, user behavior, and infrastructure health, helping organizations optimize performance, enhance user experiences, and ensure reliability.

---

## Why we use it

Dynatrace is used to monitor our applications and infrastructure on cloud services. We monitor the following information:

- OpenTelemetry logs, traces, metrics
- Logs from Azure Resources
- Synthetic Monitoring
- Map of Applications
- Real-time monitoring
- Costing Analysis

---

## When to use it

- ✅ Production application monitoring
- ✅ Distributed tracing across services
- ✅ Performance analysis and optimization
- ✅ Infrastructure health monitoring

**When NOT to use it:**

- ❌ Local development (use Aspire dashboard instead)
- ⚠️ Sensitive data that shouldn't leave the network

---

## Prerequisites

- Access to SAIF Dynatrace tenant
- Application deployed to Azure

---

## Querying telemetry from the CLI

The `saif otel` commands query Dynatrace directly, so you can pull logs, traces, and metrics
without hand-writing DQL. When an alert or dashboard hands you a **trace ID**, use `--trace-id`
to correlate every span and log for that one trace across both commands:

```bash
# 1. See the spans for the trace (slowest/failed operations, which service, how long)
saif otel traces --trace-id e1f7f740cb2c79175ed238017dd80bc4 --from now()-7d

# 2. Pull the correlated logs for the same trace, narrowed to errors
saif otel logs --trace-id e1f7f740cb2c79175ed238017dd80bc4 --level error
```

`--trace-id` handles the per-signal schema difference for you (spans store the id as a UID,
logs as a plain string) and composes with the other curated defaults such as `--from`/`--to`,
`--failed` (traces), and `--level`/`--source` (logs). It is ignored when you supply a raw
`--query`; scope the trace inside your DQL instead.

!!! tip "Which environment?"

    Use `--environment` (e.g. `test`, `uat`, `prod`) to select the tenant and scope traces to
    that deployment, or `--dynatrace-environment` to target a tenant directly.

---

## Related Documentation

| Guide                             | Description                                         |
| --------------------------------- | --------------------------------------------------- |
| [OpenTelemetry](opentelemetry.md) | Telemetry data collection that feeds into Dynatrace |
| [Aspire](aspire.md)               | Local development observability                     |

---

## Links

- [Dynatrace Documentation](https://docs.dynatrace.com/docs)
