• Stars
    star
    860
  • Rank 53,022 (Top 2 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample microservices application for playing with

Sample Microservice Application

Stan's Robot Shop is a sample microservice application you can use as a sandbox to test and learn containerised application orchestration and monitoring techniques. It is not intended to be a comprehensive reference example of how to write a microservices application, although you will better understand some of those concepts by playing with Stan's Robot Shop. To be clear, the error handling is patchy and there is not any security built into the application.

You can get more detailed information from my blog post about this sample microservice application.

This sample microservice application has been built using these technologies:

The various services in the sample application already include all required Instana components installed and configured. The Instana components provide automatic instrumentation for complete end to end tracing, as well as complete visibility into time series metrics for all the technologies.

To see the application performance results in the Instana dashboard, you will first need an Instana account. Don't worry a trial account is free.

Build from Source

To optionally build from source (you will need a newish version of Docker to do this) use Docker Compose. Optionally edit the .env file to specify an alternative image registry and version tag; see the official documentation for more information.

To download the tracing module for Nginx, it needs a valid Instana agent key. Set this in the environment before starting the build.

$ export INSTANA_AGENT_KEY="<your agent key>"

Now build all the images.

$ docker-compose build

If you modified the .env file and changed the image registry, you need to push the images to that registry

$ docker-compose push

Run Locally

You can run it locally for testing.

If you did not build from source, don't worry all the images are on Docker Hub. Just pull down those images first using:

$ docker-compose pull

Fire up Stan's Robot Shop with:

$ docker-compose up

If you want to fire up some load as well:

$ docker-compose -f docker-compose.yaml -f docker-compose-load.yaml up

If you are running it locally on a Linux host you can also run the Instana agent locally, unfortunately the agent is currently not supported on Mac.

There is also only limited support on ARM architectures at the moment.

Marathon / DCOS

The manifests for robotshop are in the DCOS/ directory. These manifests were built using a fresh install of DCOS 1.11.0. They should work on a vanilla HA or single instance install.

You may install Instana via the DCOS package manager, instructions are here: https://github.com/dcos/examples/tree/master/instana-agent/1.9

Kubernetes

You can run Kubernetes locally using minikube or on one of the many cloud providers.

The Docker container images are all available on Docker Hub.

Install Stan's Robot Shop to your Kubernetes cluster using the Helm chart.

To deploy the Instana agent to Kubernetes, just use the helm chart.

Accessing the Store

If you are running the store locally via docker-compose up then, the store front is available on localhost port 8080 http://localhost:8080

If you are running the store on Kubernetes via minikube then, find the IP address of Minikube and the Node Port of the web service.

$ minikube ip
$ kubectl get svc web

If you are using a cloud Kubernetes / Openshift / Mesosphere then it will be available on the load balancer of that system.

Load Generation

A separate load generation utility is provided in the load-gen directory. This is not automatically run when the application is started. The load generator is built with Python and Locust. The build.sh script builds the Docker image, optionally taking push as the first argument to also push the image to the registry. The registry and tag settings are loaded from the .env file in the parent directory. The script load-gen.sh runs the image, it takes a number of command line arguments. You could run the container inside an orchestration system (K8s) as well if you want to, an example descriptor is provided in K8s directory. For End-user Monitoring ,load is not automatically generated but by navigating through the Robotshop from the browser .For more details see the README in the load-gen directory.

Website Monitoring / End-User Monitoring

Docker Compose

To enable Website Monioring / End-User Monitoring (EUM) see the official documentation for how to create a configuration. There is no need to inject the JavaScript fragment into the page, this will be handled automatically. Just make a note of the unique key and set the environment variable INSTANA_EUM_KEY and INSTANA_EUM_REPORTING_URL for the web image within docker-compose.yaml.

Kubernetes

The Helm chart for installing Stan's Robot Shop supports setting the key and endpoint url required for website monitoring, see the README.

Prometheus

The cart and payment services both have Prometheus metric endpoints. These are accessible on /metrics. The cart service provides:

  • Counter of the number of items added to the cart

The payment services provides:

  • Counter of the number of items perchased
  • Histogram of the total number of items in each cart
  • Histogram of the total value of each cart

To test the metrics use:

$ curl http://<host>:8080/api/cart/metrics
$ curl http://<host>:8080/api/payment/metrics

More Repositories

1

go-sensor

🚀 Go Distributed Tracing & Metrics Sensor for Instana
Go
119
star
2

nodejs

Node.js in-process collectors for Instana
JavaScript
69
star
3

python-sensor

🐍 Python Distributed Tracing & Metrics Sensor for Instana
Python
68
star
4

instana-agent-operator

A Kubernetes operator to install and manage the Instana agent.
Go
45
star
5

weasel

Gather end-user browser performance data
JavaScript
40
star
6

instana-grafana-datasource

🔭 Grafana datasource plugin for Instana
TypeScript
38
star
7

ruby-sensor

💎 Ruby Distributed Tracing & Metrics Sensor for Instana
Ruby
26
star
8

instana-java-opentracing

Instana Java OpenTracing
Java
20
star
9

android-agent

Gather end-user Android app performance data
Kotlin
19
star
10

iOSAgent

Swift
18
star
11

agent-updates

Public Reference Repository for Instana Agent Updates
18
star
12

otel-shop

OpenTelemetry Demo App
JavaScript
17
star
13

crystal-sensor

🔮 Crystal Distributed Tracing & Metrics Sensor for Instana
Crystal
16
star
14

nginx-tracing

Instana tracing for NGINX demonstration
Java
12
star
15

instana-agent-ansible

Ansible role to install instana-agent
Ruby
11
star
16

otel-dc

Java
10
star
17

helm-charts

Curated applications for Kubernetes
Mustache
10
star
18

instana-java-sdk

Open Source Repository for the Instana Java SDK
Java
10
star
19

envoy-tracing

Deprecated demo of Instana's tracing for Envoy Proxy (1.15..1.29) based on OpenTracing
Java
10
star
20

website-monitoring-examples

How to make use of website monitoring APIs
7
star
21

instana-autotrace-webhook

Mustache
7
star
22

instana-agent-docker

Shell
6
star
23

self-hosted-k8s

Documentation and templates for hosting instana using the operator
Shell
5
star
24

synthetic-synctl

CLI Tool for Synthetic Monitoring to Manage Synthetic Test and Locations Easily
Python
5
star
25

openapi

Contains the instana public api documentation for publish on gh-pages.
JavaScript
5
star
26

flutter-agent

Dart
5
star
27

instana-ansible

Collection of things for integration with Ansible
Python
4
star
28

onprem-distkit

A collection of configurations that may be useful for operators of distributed Instana deployments
Shell
4
star
29

instana-php-opentracing

PHP
4
star
30

react-native-agent

Monitor React Native app end-user interactions with Instana
Java
4
star
31

instana-javaagent

javaagent to initialize JVM attach and instrumentation APIs at JVM startup.
Java
4
star
32

synthetic-api-script

Command script-cli to run/debug Synthetic API Script
JavaScript
4
star
33

github-action-update-agent-configurations

Shell
3
star
34

trace-context.js

JavaScript Parser / serializer for the formats defined in the W3C TraceContext specification
TypeScript
3
star
35

lab-self-hosting-k8s

Tools and docs that help launch self-hosted Instana extremely easy.
Shell
3
star
36

haskell-trace-sdk

Haskell
3
star
37

instana-nodejs-demos

JavaScript
3
star
38

ingress-nginx-tracing

Obsolete: Instana Init Containers to provide Distributed Tracing to Kubernetes NGINX Ingress
3
star
39

agent-k8s-deployment

3
star
40

pipeline-feedback-orb

Shell
2
star
41

gitops-demo

Shell
2
star
42

instana-dotnetcore-sdk-examples

C#
2
star
43

envcheck

Go
2
star
44

android-agent-examples

Java
2
star
45

envoy-otel-tracing

Demo of Instana's tracing for Envoy Proxy (1.30..latest) based on OpenTelemetry
Java
2
star
46

monitoring-presentation

A presentation showing a tiny sample app for monitoring demo purposes at universities
JavaScript
1
star
47

ui-notifications

Maintenance and release notes which will be published in the UI
Shell
1
star
48

archer

a stop gap rpm/deb installer/updater toolkit
Go
1
star
49

instana-openapi-golang-example

Go
1
star
50

ibm-monitoring-integration

Deployment package for the IBM Monitoring Instana Integration service.
1
star
51

pipeline-feedback-resource

Shell
1
star
52

instana-dotnet-sdk-examples

Open Source Repository for the Instana .Net SDK
C#
1
star
53

instana-php-sdk

PHP
1
star
54

ibm-instana-ansible

A repository of ansible artifacts for Instana
Python
1
star
55

terraform-provider-instana

Terraform provider implementation for Instana REST API
Go
1
star
56

synthetic-browser-script

JavaScript
1
star
57

instana-idea-php-plugin

Java
1
star
58

agent-google-market-app

Instana Agent app on Google Marketplace
Mustache
1
star
59

instana-version-resource

A simple Concourse CI action to keep track of the latest Instana version, SaaS or self-managed.
Shell
1
star
60

self-hosted-backup-restore

Blueprint for Instana Self-Hosted Custom Edition backup and restore
Shell
1
star