Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sagikazarmark/go-gin-gorm-opencensus
OpenCensus instrumentation for Gin and Gorm
https://github.com/sagikazarmark/go-gin-gorm-opencensus
Last synced: about 1 month ago
JSON representation
OpenCensus instrumentation for Gin and Gorm
- Host: GitHub
- URL: https://github.com/sagikazarmark/go-gin-gorm-opencensus
- Owner: sagikazarmark
- License: mit
- Created: 2018-10-10T09:36:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-08T13:13:57.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T14:12:15.953Z (4 months ago)
- Language: Go
- Homepage:
- Size: 52.7 KB
- Stars: 17
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go OpenCensus example for Gin and Gorm
[![Build Status](https://img.shields.io/travis/com/sagikazarmark/go-gin-gorm-opencensus.svg?style=flat-square)](https://travis-ci.com/sagikazarmark/go-gin-gorm-opencensus)
[![Go Report Card](https://goreportcard.com/badge/github.com/sagikazarmark/go-gin-gorm-opencensus?style=flat-square)](https://goreportcard.com/report/github.com/sagikazarmark/go-gin-gorm-opencensus)
[![GolangCI](https://golangci.com/badges/github.com/sagikazarmark/go-gin-gorm-opencensus.svg)](https://golangci.com/r/github.com/sagikazarmark/go-gin-gorm-opencensus)This repository serves as an example for configuring [OpenCensus](http://opencensus.io/) to
instrument applications written using [Gin](https://gin-gonic.github.io/gin/) framework
and [Gorm](http://gorm.io/) ORM.## Requirements
- Go 1.11
- Docker (with Compose)
- Dep 0.5.0 (make installs it for you)
- cURL or Postman for calling the API
- the following ports free: 3306, 6831, 8080, 9090, 14268, 16686 (alternative: edit `docker-compose.override.yml` manually)## Usage
1. Set up the project: `make up`
2. Run the application: `make run`
3. Open `http://localhost:16686` in your browser (Jaeger UI)
4. Open `http://localhost:9090` in your browser (Prometheus UI)When you are done playing with the project you can easily destroy everything it created with `make down`.
(It removes everything except `.env` and `.env.test`)## Calling the API
The easiest way to run the example is using Postman:
[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/b2c8fd4eee98b396b5d8)
Alternatively you can send simple HTTP requests with any tool you like.
For example using cURL:```bash
$ curl http://localhost:8080/people -d '{"first_name": "John", "last_name": "Doe"}'
$ curl http://localhost:8080/hello/John
```## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.