Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/geekeast/opentelemetry-typescript-mircoservice

The opentelemetry demo on typescript-based micorservices, graphql, restful and lambda event consumer.
https://github.com/geekeast/opentelemetry-typescript-mircoservice

event-driven graphql lambda microservice opentelemetry restful-api

Last synced: 26 days ago
JSON representation

The opentelemetry demo on typescript-based micorservices, graphql, restful and lambda event consumer.

Awesome Lists containing this project

README

        

# opentelemetry-typescript-microservice
The opentelemetry demo on typescript-based microservice: **sync** and **async** communication included.

## Context
- We need a industry-standard tool to increase the **observability** of our backend services while keep the trace **data portable** for analysis.

### Targets
- **http-based synchronous** call could be traced properly - achieve this by [@opentelemetry/auto-instrumentations-node](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node)
- **event-based asynchronous** signals could be traced well - achieve this by [Span Link](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/overview.md#links-between-spans).

## Architecture

no image found

## Step Guidance

### Start the Jaeger Service
```sh
docker-compose up -d
```
### Graphql Service
```sh
git clone [email protected]:GeekEast/opentelemetry-graphql-server.git

cd opentelemetry-graphql-server
yarn && yarn dev
```

### Restful Service

```sh
git clone [email protected]:GeekEast/opentelemetry-restful-server.git

cd opentelemetry-restful-server
yarn && yarn dev
```

### Lambda Event Consumer
```sh
git clone [email protected]/GeekEast/opentelemetry-lambda-consumer.git

cd opentelemetry-lambda-consumer
yarn && yarn stack up && yarn dev
```

## Generate Traces

- go to http://localhost:9901/api/graphql/v1 to send a graphql request, for example
```graphql
query Query {
ORGExistUser(filter: "anything")
}
```
- then you should view the traces at http://localhost:16686

## Reference
- [opentelemetry.io](https://opentelemetry.io/)