Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eminetto/api-o11y

Repository used in a talk about APIs and Observability
https://github.com/eminetto/api-o11y

Last synced: 4 days ago
JSON representation

Repository used in a talk about APIs and Observability

Awesome Lists containing this project

README

        

# API Observability

### Building

```
docker compose up -d --build
```

## Using the services

### Auth

```
curl -X "POST" "http://localhost:8081/v1/auth" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d $'{
"email": "[email protected]",
"password": "12345"
}'

```

The result should be a token, like:

```
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtaW5ldHRvQGVtYWlsLmNvbSIsImV4cCI6MTY4MTM0ODQ3MSwiaWF0IjoxNjgxMzQ0ODQxLCJuYmYiOjE2ODEzNDQ4NDF9.GdUiLYqrXeUZNIgHDhGDhGIV1NpN941UiFBqgvSoS-4"
}
```

### Feedback

You need to use the token generated by the ```Auth``` service:

```
curl -X "POST" "http://localhost:8082/v1/feedback" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtaW5ldHRvQGVtYWlsLmNvbSIsImV4cCI6MTY4MTM0ODQ3MSwiaWF0IjoxNjgxMzQ0ODQxLCJuYmYiOjE2ODEzNDQ4NDF9.GdUiLYqrXeUZNIgHDhGDhGIV1NpN941UiFBqgvSoS-4' \
-d $'{
"title": "Feedback test",
"body": "Feedback body"
}'
```

### Vote

You need to use the token generated by the ```Auth``` service:

```
curl -X "POST" "http://localhost:8083/v1/vote" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtaW5ldHRvQGVtYWlsLmNvbSIsImV4cCI6MTY4MTM0ODQ3MSwiaWF0IjoxNjgxMzQ0ODQxLCJuYmYiOjE2ODEzNDQ4NDF9.GdUiLYqrXeUZNIgHDhGDhGIV1NpN941UiFBqgvSoS-4' \
-d $'{
"talk_name": "Go e Microserviços",
"score": "10"
}'
```