The goal is to change in prometheus.yml this
- targets: ['host.docker.internal:5048'] # hard-coded port matches launchSettings.json
to this
- targets: ['app'],
so that prometheus container can reach metricsapp that runs on host in development environment by resource name instead of hardcoded endpoint.
In this PR this is achieved by:
Creating custom docker network and adding all ContainerResource to it.
Adding simple Nginx container with network alias equal to ProjectResource name which should be accessible by container.
This modifies Metrics sample.
The goal is to change in
prometheus.yml
this- targets: ['host.docker.internal:5048'] # hard-coded port matches launchSettings.json
to this- targets: ['app']
, so that prometheus container can reach metricsapp that runs on host in development environment by resource name instead of hardcoded endpoint.In this PR this is achieved by: