/nginx-example

Primary LanguageGoApache License 2.0Apache-2.0

Image CI

nginx-example

This repo hosts a simple app to demonstrate distributed tracing feature of nginx.

graph TB
    subgraph Browser
    start["http://esigo.dev/hello/nginx"]
    end

    subgraph app
        sa[service-a]
        sb[service-b]
        sc[service-c]
        sa --> |name: nginx| sb
        sb --> |hello nginx!| sa
    end

    subgraph otel
        otc["Otel Collector"] 
    end

    subgraph observability
        tempo["Tempo"]
        grafana["Grafana"]
        backend["Jaeger"]
        zipkin["Zipkin"]
    end

    subgraph ingress-nginx
        ngx[nginx]
    end

    subgraph ngx[nginx]
        ng[nginx]
        om[OpenTelemetry module]
    end

    subgraph Node
        app
        otel
        observability
        ingress-nginx
        om --> |otlp-gRPC| otc --> |jaeger| backend
        otc --> |zipkin| zipkin
        otc --> |otlp-gRPC| tempo --> grafana
        sa --> |otlp-gRPC| otc
        sb --> |otlp-gRPC| otc
        start --> ng --> |auth-url| sc
        ng --> sa
    end

build images:

make images

deploy demo app:

make deploy-app

deploy otel collector, grafan, tempo and Jaeger all-in-one:

make helm-repo
make observability

test:

kubectl port-forward --namespace=ingress-nginx service/ingress-nginx-controller 8090:80
bash test.sh

controller-configmap.yaml:

otlp-collector-host: "otel-coll-collector.otel.svc"

or

otlp-collector-host: "tempo.observability.svc"