The replacement is two projects rather than one. Prometheus collects and stores the metrics, Grafana shows them and alerts on them. Together they cover most of what teams use Datadog for, without the per host bill.
What you are replacing
Datadog sells the assembly, not any single piece: agents, storage, dashboards, alerting and correlation that arrive already connected. Replacing it means owning the seams yourself, which is cheaper in money and more expensive in attention.
It is the collection and storage half, and its pull model plus label based data suits infrastructure that changes shape, which is exactly where hand maintained monitoring falls apart. Alerting rules live as text you can review like code.
What it does not replace
Long term storage and high availability are not solved in the box, and neither are logs or traces. Teams that expect one system for all three signals are looking at a stack rather than a product.
It is the part people actually look at, and it reads from Prometheus and from most other sources, so the dashboards survive changes underneath. Dashboards as versioned files is the thing that makes the setup durable rather than personal.
What it does not replace
It visualises and alerts, it does not collect. On its own it replaces nothing, which is the mistake behind most half finished migrations away from a hosted vendor.
Stay on Datadog when nobody has time to own a monitoring stack. The failure mode of this migration is not a bad dashboard, it is an alerting pipeline that quietly stops working and is discovered during an incident.