Skip to content

TykTechnologies/demo-api-observability-opentelemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Observability with OpenTelemetry

About

This is a demo project running on Docker, that shows how to configure Tyk Gateway OSS, OpenTelemetry Collector, Jaeger, Prometheus and Grafana OSS to set-up an API observability dashboard for your APIs managed by Tyk.

Deploy and run the demo

  1. Clone this repository:
git clone https://github.com/TykTechnologies/demo-api-observability-opentelemetry.git
  1. Start the services
cd ./demo-api-observability-opentelemetry/
docker compose up -d
  1. Verify that all services are running
  1. Generate traffic

K6 is used to generate traffic to the API endpoints. The load script load.js will run for 15 minutes.

docker compose run  k6 run /scripts/load.js
  1. Check out the dashboard in Grafana

Go to Grafana in your browser (initial user/pwd: admin/admin) and open the dashboard called API Observability.

The dashboard aggregates the data for all the APIs. You can use the following dropdown to filter per API:

  1. Explore traces in Jaeger

Go to Jaeger in your browser to explore the traces generated by Tyk.

Tear down

Stop the services

docker compose stop

Remove the services

docker compose down

How does it work?

Configuration:

  • Tyk API Gateway
    • is configured per environment variables in the Docker compose file to export the OpenTelemetry spans to the OpenTelemetry Collector:
        - TYK_GW_OPENTELEMETRY_ENABLED=true
        - TYK_GW_OPENTELEMETRY_EXPORTER=grpc
        - TYK_GW_OPENTELEMETRY_ENDPOINT=otel-collector:4317
  • see also OpenTelemetry Integration with Tyk Gateway
  • is configured to load the API definitions from the (apps Folder)
  • K6 will use the load script load.js to generate demo traffic to the API endpoints
  • OpenTelemetry Collector
    • is configured to export spans to Jaeger
    • is configured create metrics from spans using the SpanMetrics Connector and expose them as Prometheus metrics on a Collector endpoint
    • visual configuration of the pipeline generated by OTelBin (see Collector config yaml):
  • Prometheus
    • prometheus.yml is configured to automatically scrape the endpoint exposed by the OpenTelemetry Collector
  • Grafana

Contribute

You are welcome to contribute by

Support, questions & feedback

This is a demo project, using Tyk Gateway.

For question about our products, please use Tyk Community forum.
Clients can also use support@tyk.io.
Potential clients and evaluators, please use info@tyk.io.

About

Demo - API Observability with Tyk, OpenTelemetry, Jaeger and Grafana

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published