Those services have API endpoints where they push their metrics for monitoring or they can push the metrics directly. The best way would be to write a OneAgent plugin to collect them. At the moment there is not a publicly available OneAgent plugin to collect those metrics since Dynatrace is investing into broader scope of infrastructure monitoring, there might be some early versions of them.
It should be possible to send Vault and Consul monitoring data into Dynatrace:
Monitoring HashiCorp Consul is now available, here are some useful blog articles about the topic:
Automatic intelligent observability into your HashiCorp Consul service mesh