dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.28k stars 520 forks source link

Prometheus / Graphana #783

Open tomasforsman opened 4 years ago

tomasforsman commented 4 years ago

I saw in a post somewhere that you were working on easy integration with logging, prometheus and graphana. How have things come along with that? Are there any samples on how to do that? I'm not experienced with using prometheus so I figured I might give it a go with Tye if it's something you've worked at.

hikalkan commented 3 years ago

I am having trouble when I try to integrate prometheus. I use prometheus docker image.

tye.yml (related parts)

- name: prometheus
  image: prom/prometheus
  bindings:
    - port: 9090
  volumes:
    - source: prometheus.yml
      target: /etc/prometheus/prometheus.yml

- name: saas-service
  project: saas/src/SaasService.HttpApi.Host/SaasService.HttpApi.Host.csproj
  bindings:
    - protocol: https
      port: 44381

prometheus.yml

global:
  scrape_interval: 10s
scrape_configs:
  - job_name: 'saas-service'
    scheme: https
    static_configs:
    - targets: ['saas-service:44381']
      labels:
        alias: "saas-service"

(I also tried 'localhost:44381', '127.0.0.1:44381')

Prometheus UI

image

It seems that Prometheus can not access to my service (that is running locally).

So, Question is: How an application in a container can access to the service URL that is added as project?