Giter VIP home page Giter VIP logo

observabilidade-open-telemetry's Introduction

Este projeto consiste em dois serviços em Go:

  • Serviço A: Recebe um CEP via POST, valida o formato e encaminha para o Serviço B.
  • Serviço B: Recebe um CEP válido, consulta a localização através do serviço ViaCEP, e consulta a temperatura atual através do serviço WeatherAPI. Retorna a temperatura em Celsius, Fahrenheit e Kelvin, juntamente com o nome da cidade.

Instruções para Execução

  1. Construir as Imagens: Na raiz do projeto, execute:

    docker-compose build
    
  2. Executar o Docker Compose: Na raiz do projeto (onde está o arquivo docker-compose.yml), execute:

    docker-compose up -d
    
  3. Testar a Aplicação: Após iniciar os serviços, utilize o arquivo api.http ou

  • Para o serviço A:

    Teste CEP VÁLIDO:

     curl -X POST -H "Content-Type: application/json" -d "{\"cep\":\"02712080\"}" http://localhost:8080/cep
    

    Teste CEP INVÁLIDO:

     curl -X POST -H "Content-Type: application/json" -d "{\"cep\":\"00000000\"}" http://localhost:8080/cep
    
  • Para o serviço B (substitua CEP por um código postal válido de 8 dígitos):

    curl -X GET "http://localhost:8081/weather?cep=02712080" -H "accept: application/json" 
    
  1. Testar o zipkin:
  • Abra o link no seu navegador:

    http://localhost:9411
    

Clipboard02

observabilidade-open-telemetry's People

Contributors

mcsomenzari avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.