hopper
A simple point to point path walking service that can be used to test service mesh observability with Istio tracing spans alongside OTEL spans generated by the app.
Use this by deploying to an arbitrary number of workloads with matching services, say hop-a, hop-b hop-c and then one can test with variations like.
curl -v http://hop-a/hop-b/hop-c
Until the final path each service in the chain will simply forward to the next one, the final path will simply return text saying that it is the final hop.
The app will also return body information at each hop showing the current headers present in the request so one can examine W3C traceparent or anything else the mesh might add.
For mesh testing/demonstrations this means one can build up complex service pictures quickly by creating a variety of services and hopping between them.
Note: This app is designed for testing only and one should put thoughts into if it exposes your general services if deployed into production clusters since the app will make a get request to any service specified in the path!
Enabling OTEL app capability
When used alongside mesh tracing the app can also generate spans and propagate existing W3C trace context if OTEL is enabled by the flag -otel=tue. The app simply initialises the OTEL libraries to do this so that any configuration can be provided as part of the workload via the standard environment variables e.g.
---
apiVersion: v1
kind: Service
metadata:
name: hop-c
namespace: test
spec:
selector:
app: hop-c
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hop-c
namespace: test
spec:
selector:
matchLabels:
app: hop-c
template:
metadata:
labels:
app: hop-c
spec:
containers:
- name: hopper
image: <your registry>/hopper
args:
- "-level=debug"
- "-otel=true"
env:
- name: OTEL_SERVICE_NAME
value: hop-c
- name: OTEL_EXPORTER_OTLP_SECURE
value: 'false'
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://opentelemetry-collector.<collector-namespace>:4317
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: grpc