From be64203d21cab6469f0345c67855528483d54212 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Fri, 18 Oct 2024 09:42:53 -0700 Subject: [PATCH] Update README and add more pre-commit checks (#694) --- .clang-format | 67 +++++++++-------- .github/labeler.yml | 21 +++--- .markdownlint-cli2.yaml | 18 +++++ .pre-commit-config.yaml | 19 +++++ .yamllint.yaml | 16 ++++ README.md | 73 ++++++++++--------- doc/Reference.md | 13 ++-- doc/Tutorial.md | 25 +++++-- example/go/otel/README.md | 12 +-- example/php/jaeger/README.md | 13 +++- example/trivial/datadog/README.md | 8 +- example/trivial/jaeger/README.md | 6 +- .../jaeger/go/src/hello-backend/glide.yaml | 12 +-- example/trivial/ubuntu-x86_64/README.md | 8 +- .../go/src/hello-backend/glide.yaml | 12 +-- example/trivial/zipkin/README.md | 6 +- example/zoo/README.md | 6 +- example/zoo/docker-compose.yaml | 3 +- 18 files changed, 217 insertions(+), 121 deletions(-) create mode 100644 .markdownlint-cli2.yaml create mode 100644 .yamllint.yaml diff --git a/.clang-format b/.clang-format index daee4e16..0e0b8310 100644 --- a/.clang-format +++ b/.clang-format @@ -1,12 +1,12 @@ --- -Language: Cpp +Language: Cpp # BasedOnStyle: Google AccessModifierOffset: -1 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlinesLeft: true -AlignOperands: true +AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false @@ -21,49 +21,49 @@ AlwaysBreakTemplateDeclarations: true BinPackArguments: true BinPackParameters: true BraceWrapping: - AfterClass: false - AfterControlStatement: false - AfterEnum: false - AfterFunction: false - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: false - AfterUnion: false - BeforeCatch: false - BeforeElse: false - IndentBraces: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true -ColumnLimit: 80 -CommentPragmas: '^ IWYU pragma:' +ColumnLimit: 80 +CommentPragmas: "^ IWYU pragma:" ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: true -DisableFormat: false +DisableFormat: false ExperimentalAutoDetectBinPacking: false -ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH] IncludeCategories: - - Regex: '^<.*\.h>' - Priority: 1 - - Regex: '^<.*' - Priority: 2 - - Regex: '.*' - Priority: 3 -IncludeIsMainRegex: '([-_](test|unittest))?$' + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: "^<.*" + Priority: 2 + - Regex: ".*" + Priority: 3 +IncludeIsMainRegex: "([-_](test|unittest))?$" IndentCaseLabels: true -IndentWidth: 2 +IndentWidth: 2 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false -MacroBlockBegin: '' -MacroBlockEnd: '' +MacroBlockBegin: "" +MacroBlockEnd: "" MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBlockIndentWidth: 2 @@ -76,23 +76,22 @@ PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Left -ReflowComments: true -SortIncludes: true +ReflowComments: true +SortIncludes: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 -SpacesInAngles: false +SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: Auto -TabWidth: 8 -UseTab: Never -... +Standard: Auto +TabWidth: 8 +UseTab: Never --- Language: JavaScript SpacesInContainerLiterals: false diff --git a/.github/labeler.yml b/.github/labeler.yml index 08a74c18..c57f901e 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,28 +1,29 @@ change: - - head-branch: ['^change/'] + - head-branch: ["^change/"] enhancement: - - head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/'] + - head-branch: ["^feature/", "^feat/", "^enhancement/", "^enh/"] bug: - - head-branch: ['^fix/', '^bug/'] + - head-branch: ["^fix/", "^bug/"] chore: - - head-branch: ['^chore/'] + - head-branch: ["^chore/"] documentation: - - head-branch: ['^docs/', '^doc/'] + - head-branch: ["^docs/", "^doc/"] - changed-files: - - any-glob-to-any-file: '**/*.md' + - any-glob-to-any-file: "**/*.md" dependencies: - - head-branch: ['^deps/', '^dep/', '^dependabot/', 'pre-commit-ci-update-config'] + - head-branch: + ["^deps/", "^dep/", "^dependabot/", "pre-commit-ci-update-config"] tests: - any: - - head-branch: ['^tests/', '^test/'] + - head-branch: ["^tests/", "^test/"] - changed-files: - - any-glob-to-any-file: 'test/**/*' + - any-glob-to-any-file: "test/**/*" - all: - changed-files: - - all-globs-to-all-files: '!test/requirements.txt' + - all-globs-to-all-files: "!test/requirements.txt" diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 00000000..19326096 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,18 @@ +# Rule configuration. +# For rule descriptions and how to fix: https://github.com/DavidAnson/markdownlint/tree/main#rules--aliases +config: + ul-style: + style: dash + no-duplicate-heading: + siblings_only: true + line-length: + line_length: 120 + code_blocks: false + tables: false + +# Define glob expressions to ignore +ignores: + - ".github/" + +# Fix any fixable errors +fix: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a7dcc4ad..30f02248 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,15 +27,34 @@ repos: - id: no-commit-to-branch - id: requirements-txt-fixer - id: fix-byte-order-marker + - id: detect-private-key + - repo: https://github.com/asottile/pyupgrade rev: v3.18.0 hooks: - id: pyupgrade + - repo: https://github.com/PyCQA/isort rev: 5.13.2 hooks: - id: isort + - repo: https://github.com/psf/black rev: 24.10.0 hooks: - id: black + + - repo: https://github.com/gitleaks/gitleaks + rev: v8.21.0 + hooks: + - id: gitleaks + + - repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.14.0 + hooks: + - id: markdownlint-cli2 + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.35.1 + hooks: + - id: yamllint diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..284d038c --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,16 @@ +--- +ignore-from-file: .gitignore + +extends: default + +rules: + comments: + min-spaces-from-content: 1 + comments-indentation: enable + document-start: disable + line-length: + max: 120 + ignore: | + .github/ + truthy: + check-keys: false diff --git a/README.md b/README.md index c1c2b5e0..65fb7a6c 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,40 @@ -nginx-opentracing ------------------ +# NGINX plugin for OpenTracing + +[![Docker](https://github.com/opentracing-contrib/nginx-opentracing/actions/workflows/docker.yml/badge.svg)](https://github.com/opentracing-contrib/nginx-opentracing/actions/workflows/docker.yml) +[![GitHub release (laßtest SemVer)](https://img.shields.io/github/v/release/opentracing-contrib/nginx-opentracing?logo=github&sort=semver)](https://github.com/opentracing-contrib/nginx-opentracing/releases/latest) +![GitHub all releases](https://img.shields.io/github/downloads/opentracing-contrib/nginx-opentracing/total?logo=github) +![GitHub release (latest by SemVer)](https://img.shields.io/github/downloads/opentracing-contrib/nginx-opentracing/latest/total?sort=semver&logo=github) +[![Docker Pulls](https://img.shields.io/docker/pulls/opentracing/nginx-opentracing.svg)](https://hub.docker.com/r/opentracing/nginx-opentracing/) Enable requests served by nginx for distributed tracing via [The OpenTracing Project](http://opentracing.io). -Dependencies ------------- +## Dependencies + - The [C++ OpenTracing Library](https://github.com/opentracing/opentracing-cpp) - A C++ OpenTracing Tracer. It currently works with -[Jaeger](https://github.com/jaegertracing/cpp-client), -[Zipkin](https://github.com/rnburn/zipkin-cpp-opentracing), -[LightStep](https://github.com/lightstep/lightstep-tracer-cpp), or -[Datadog](https://github.com/DataDog/dd-opentracing-cpp/). + [Jaeger](https://github.com/jaegertracing/cpp-client), + [Zipkin](https://github.com/rnburn/zipkin-cpp-opentracing), + [LightStep](https://github.com/lightstep/lightstep-tracer-cpp), or + [Datadog](https://github.com/DataDog/dd-opentracing-cpp/). - Source for [Nginx 1.9.13 or later](http://nginx.org/). -Installation ------------- +## Installation + For `linux-x86_64`, pre-compiled binaries are provided for the supported versions of NGINX. These can be dropped into existing NGINX installations provided that NGINX was compiled with -the `--with-compat` option. See [example/trivial/ubuntu-x86_64](example/trivial/ubuntu-x86_64) for an -example of how to set it up. +the `--with-compat` option. +See [example/trivial/ubuntu-x86_64](example/trivial/ubuntu-x86_64) for an example of how to set it up. + +Otherwise, nginx-opentracing can be used from the [Docker image](https://github.com/opentracing-contrib/nginx-opentracing#docker) +or [built from source](https://github.com/opentracing-contrib/nginx-opentracing#building-from-source). -Otherwise, nginx-opentracing can be used from the [Docker image](https://github.com/opentracing-contrib/nginx-opentracing#docker) or -[built from source](https://github.com/opentracing-contrib/nginx-opentracing#building-from-source). +## Getting Started -Getting Started ---------------- First, write a configuration for the tracer used. Below's an example of what a Jaeger configuration might look like: /etc/jaeger-nginx-config.json + ```json { "service_name": "nginx", @@ -55,7 +61,8 @@ See the vendor documentation for details on what options are available. You can then set up NGINX for distributed tracing by adding the following to nginx.conf: -``` + +```nginx # Load the OpenTracing dynamic module. load_module modules/ngx_http_opentracing_module.so; @@ -99,8 +106,8 @@ See [Tutorial](doc/Tutorial.md) for a more complete example, [Reference](doc/Reference.md) for a list of available OpenTracing-related directives. -Docker ------- +## Docker + A docker image `opentracing/nginx-opentracing` is provided to support using nginx with OpenTracing in a manner analogous to the [nginx Docker image](https://hub.docker.com/_/nginx/). See [here](example/) for examples of how to use it. @@ -124,18 +131,17 @@ docker build \ Other build arguments -* `OPENTRACING_CPP_VERSION` -* `JAEGER_CPP_VERSION` -* `GRPC_VERSION` +- `OPENTRACING_CPP_VERSION` +- `JAEGER_CPP_VERSION` +- `GRPC_VERSION` -Building From Source --------------------- +## Building From Source -``` -$ tar zxvf nginx-1.9.x.tar.gz -$ cd nginx-1.9.x -$ ./configure --add-dynamic-module=/absolute/path/to/nginx-opentracing/opentracing -$ make && sudo make install +```bash +tar zxvf nginx-1.9.x.tar.gz +cd nginx-1.9.x +./configure --add-dynamic-module=/absolute/path/to/nginx-opentracing/opentracing +make && sudo make install ``` You will also need to install a C++ tracer for either @@ -145,7 +151,7 @@ You will also need to install a C++ tracer for either or [Zipkin](https://github.com/rnburn/zipkin-cpp-opentracing). For linux x86-64, portable binary plugins are available: -``` +```bash # Jaeger wget https://github.com/jaegertracing/jaeger-client-cpp/releases/download/v0.4.2/libjaegertracing_plugin.linux_amd64.so -O /usr/local/lib/libjaegertracing_plugin.so @@ -162,11 +168,10 @@ wget -O - https://github.com/DataDog/dd-opentracing-cpp/releases/download/v0.3.0 Make sure the nginx module for opentracing and a tracer plugin were built against the same version of [C++ OpenTracing Library](https://github.com/opentracing/opentracing-cpp). By default [Opentracing v1.6.0](https://github.com/opentracing/opentracing-cpp/releases/tag/v1.6.0) is used. -Testing --------- +## Testing Run tests on local machine requires `pyenv` and tested against version 3.8.5. -```shell -$ make test +```bash +make test ``` diff --git a/doc/Reference.md b/doc/Reference.md index 19ddb9f1..36f4dd25 100644 --- a/doc/Reference.md +++ b/doc/Reference.md @@ -1,5 +1,6 @@ -Directives ----------- +# Reference + +## Directives ### `opentracing` @@ -75,7 +76,8 @@ of the span for an NGINX location block. - **default**: `on` - **context**: `http`, `server`, `location` -Enables or disables using OpenTracing spans from incoming requests as parent for created ones. Might be disabled for security reasons. +Enables or disables using OpenTracing spans from incoming requests as parent for created ones. +Might be disabled for security reasons. ### `opentracing_tag` @@ -85,10 +87,9 @@ Enables or disables using OpenTracing spans from incoming requests as parent for Sets a [tag](https://github.com/opentracing/specification/blob/master/specification.md#set-a-span-tag) with the given `key` and `value` for an NGINX span. -Variables ---------- +## Variables -### `opentracing_context_`*name* +### `opentracing_context_`_name_ Expands to the a value of the active span context; the last part of the variable name is the span context's header converted to lower case with dashes replaced by diff --git a/doc/Tutorial.md b/doc/Tutorial.md index 7913b052..6f24ad5e 100644 --- a/doc/Tutorial.md +++ b/doc/Tutorial.md @@ -19,7 +19,7 @@ writes the profile data to a shared sqlite database and resizes the profile picture to a common thumbnail size. Here's what the NGINX configuration looks like: -``` +```nginx events {} http { @@ -89,12 +89,14 @@ Enabling OpenTracing for NGINX We can tell NGINX to trace every request by adding these two lines to `nginx.conf`: -``` + +```nginx http { opentracing_load_tracer /path/to/tracer/plugin /path/to/tracer/config; opentracing on; ... ``` + Now, we'll see the following when admitting a new animal into the zoo: ![alt text](data/nginx-upload-trace1.png "Trace") @@ -105,13 +107,15 @@ change this behavior by using the directives `opentracing_operation_name` and `opentracing_location_operation_name` to set the names of the request and location block spans respectively. For example, by adding -``` + +```nginx http { ... location = /upload/animal { opentracing_location_operation_name upload; ... ``` + The trace will change to ![alt text](data/nginx-upload-trace2.png "Trace") @@ -127,17 +131,18 @@ Enabling OpenTracing for the Backend When using express with Node.js, OpenTracing can be turn on by adding tracing middleware to the express app: + ```JavaScript const app = express(); app.use(tracingMiddleware.middleware({ tracer })); ... ``` + If tracing is additionally manually added for the database and image operations, we'll see the following when uploading: ![alt text](data/nginx-upload-trace3.png "Trace") - Performance Improvements ------------------------ @@ -145,10 +150,13 @@ One source of inefficiency we can see from looking at the trace is the file uplo for an animal's profile picture. The image is packaged as a component of the request body using the multipart/form-data format where it's sent by NGINX to a Node.js server which uses [form middleware](https://www.npmjs.com/package/express-formidable) to extract the file -and write it to disk. As pointed out in this [article](https://coderwall.com/p/swgfvw/nginx-direct-file-upload-without-passing-them-through-backend), there is some unnecessary copying that can -be eliminated by having NGINX write the file to disk and pass the file's path instead -of its contents to the Node.js servers. Updating NGINX's configuration file to do this -``` +and write it to disk. As pointed out in this [article](https://coderwall.com/p/swgfvw/nginx-direct-file-upload-without-passing-them-through-backend), +there is some unnecessary copying that can be eliminated by having NGINX write the file to disk +and pass the file's path instead of its contents to the Node.js servers. + +Updating NGINX's configuration file to do this + +```nginx location = /upload/animal { ... client_body_temp_path /tmp/; @@ -162,6 +170,7 @@ of its contents to the Node.js servers. Updating NGINX's configuration file to d proxy_redirect off; ... ``` + the `upload` span now looks like ![alt text](data/nginx-upload-trace4.png "Trace") diff --git a/example/go/otel/README.md b/example/go/otel/README.md index 4e67d87d..02b8dfd6 100644 --- a/example/go/otel/README.md +++ b/example/go/otel/README.md @@ -1,3 +1,5 @@ +# OpenTelemetry Example + Demonstrating usage of the nginx-opentracing docker image with Opentelemetry collector and Jaeger. It features Nginx as a reverse-proxy in front a GO server. @@ -9,7 +11,7 @@ Use these commands to run: From the root of the repo ```shell -$ make docker.build +make docker.build ``` ## Run applications @@ -17,14 +19,14 @@ $ make docker.build From the current directory ```shell -$ docker-compose up --build +docker-compose up --build ``` Send requests to the app: ```shell -$ curl localhost:8081 # W3C format traces -$ curl localhost:8082 # Zipkin format traces +curl localhost:8081 # W3C format traces +curl localhost:8082 # Zipkin format traces ``` -Visit http://localhost:16686 to view the traces in Jaeger. +Visit to view the traces in Jaeger. diff --git a/example/php/jaeger/README.md b/example/php/jaeger/README.md index cd9be3f8..35806181 100644 --- a/example/php/jaeger/README.md +++ b/example/php/jaeger/README.md @@ -1,8 +1,13 @@ -Demonstrating usage of the nginx-opentracing -docker image with Jaeger and FastCGI. It features Nginx as a reverse-proxy in front a PHP -server. Use these commands to run: +# PHP with Jaeger + +Demonstrating usage of the nginx-opentracing docker image with Jaeger and FastCGI. +It features Nginx as a reverse-proxy in front a PHP server. + +Use these commands to run: + ```bash docker-compose up curl localhost:8080 ``` -Visit http://localhost:16686 to view the traces in Jaeger. + +Visit to view the traces in Jaeger. diff --git a/example/trivial/datadog/README.md b/example/trivial/datadog/README.md index 6bbda63a..7a7dc7c8 100644 --- a/example/trivial/datadog/README.md +++ b/example/trivial/datadog/README.md @@ -1,13 +1,17 @@ +# Datadog Example + A minimal OpenTracing example demonstrating usage of the nginx-opentracing docker image with Datadog. It features Nginx as a reverse-proxy in front a Go server. -Before running create an account at https://www.datadoghq.com and enter your +Before running create an account at and enter your API key into docker-compose.yaml Use these commands to run: + ```bash docker-compose up curl localhost:8080 ``` -Visit https://app.datadoghq.com/apm/services to view the traces. + +Visit to view the traces. diff --git a/example/trivial/jaeger/README.md b/example/trivial/jaeger/README.md index c8029c38..6e9b04e3 100644 --- a/example/trivial/jaeger/README.md +++ b/example/trivial/jaeger/README.md @@ -1,8 +1,12 @@ +# Jaeger Example + A minimal OpenTracing example demonstrating usage of the nginx-opentracing docker image with Jaeger. It features Nginx as a reverse-proxy in front a Go server. Use these commands to run: + ```bash docker-compose up curl localhost:8080 ``` -Visit http://localhost:16686 to view the traces in Jaeger. + +Visit to view the traces in Jaeger. diff --git a/example/trivial/jaeger/go/src/hello-backend/glide.yaml b/example/trivial/jaeger/go/src/hello-backend/glide.yaml index df73e09b..10b6e92b 100644 --- a/example/trivial/jaeger/go/src/hello-backend/glide.yaml +++ b/example/trivial/jaeger/go/src/hello-backend/glide.yaml @@ -1,8 +1,8 @@ package: . import: -- package: github.com/opentracing/opentracing-go - version: ~1.0.2 -- package: github.com/uber/jaeger-client-go - version: ~2.14.0 - subpackages: - - config + - package: github.com/opentracing/opentracing-go + version: ~1.0.2 + - package: github.com/uber/jaeger-client-go + version: ~2.14.0 + subpackages: + - config diff --git a/example/trivial/ubuntu-x86_64/README.md b/example/trivial/ubuntu-x86_64/README.md index d5aa7470..85f56c8b 100644 --- a/example/trivial/ubuntu-x86_64/README.md +++ b/example/trivial/ubuntu-x86_64/README.md @@ -1,9 +1,12 @@ +# Ubuntu x86_64 Example + Demonstates how to set up nginx-opentracing and Jaeger for `linux-x86_64` using prebuilt binary images. NGINX-1.14.0 is installed for Ubuntu following the instructions [here](https://www.nginx.com/resources/wiki/start/topics/tutorials/install/#official-debian-ubuntu-packages). nginx-opentracing is installed into NGINX's module directory with + ```bash cd /usr/lib/nginx/modules wget -O - https://github.com/opentracing-contrib/nginx-opentracing/releases/download/v0.4.0/linux-amd64-nginx-1.14.0-ngx_http_module.so.tgz \ @@ -11,14 +14,17 @@ wget -O - https://github.com/opentracing-contrib/nginx-opentracing/releases/down ``` and Jaeger is installed with + ```bash cd /usr/local/lib wget -O libjaegertracing_plugin.so https://github.com/jaegertracing/jaeger-client-cpp/releases/download/v0.4.1/libjaegertracing_plugin.linux_amd64.so ``` Use these commands to run: + ```bash docker-compose up curl localhost:8080 ``` -Visit http://localhost:16686 to view the traces in Jaeger. + +Visit to view the traces in Jaeger. diff --git a/example/trivial/ubuntu-x86_64/go/src/hello-backend/glide.yaml b/example/trivial/ubuntu-x86_64/go/src/hello-backend/glide.yaml index df73e09b..10b6e92b 100644 --- a/example/trivial/ubuntu-x86_64/go/src/hello-backend/glide.yaml +++ b/example/trivial/ubuntu-x86_64/go/src/hello-backend/glide.yaml @@ -1,8 +1,8 @@ package: . import: -- package: github.com/opentracing/opentracing-go - version: ~1.0.2 -- package: github.com/uber/jaeger-client-go - version: ~2.14.0 - subpackages: - - config + - package: github.com/opentracing/opentracing-go + version: ~1.0.2 + - package: github.com/uber/jaeger-client-go + version: ~2.14.0 + subpackages: + - config diff --git a/example/trivial/zipkin/README.md b/example/trivial/zipkin/README.md index f1da1ac4..60e582e9 100644 --- a/example/trivial/zipkin/README.md +++ b/example/trivial/zipkin/README.md @@ -1,8 +1,12 @@ +# Zipkin Example + A minimal OpenTracing example demonstrating usage of the nginx-opentracing docker image with Zipkin. It features Nginx as a reverse-proxy in front a Go server. Use these commands to run: + ```bash docker-compose up curl localhost:8080 ``` -Visit http://localhost:9411 to view the traces in Zipkin. + +Visit to view the traces in Zipkin. diff --git a/example/zoo/README.md b/example/zoo/README.md index 9f06728d..1b88c7d2 100644 --- a/example/zoo/README.md +++ b/example/zoo/README.md @@ -1,10 +1,14 @@ +# LightStep Example + A more complicated OpenTracing example demonstrating usage of the nginx-opentracing docker image with lightstep. It features nginx serving as a load balancer to multiple node servers. It provides a toy application for a virtual zoo where animal profiles can be uploaded and viewed. Run + ```bash docker build -t nginx-example-zoo . docker run -d -p 8080:80 -e LIGHTSTEP_ACCESS_TOKEN=YOURACCESSTOKEN nginx-example-zoo ``` -and visit http://localhost:8080 to interact with the application or your + +and visit to interact with the application or your LightStep account to view traces. diff --git a/example/zoo/docker-compose.yaml b/example/zoo/docker-compose.yaml index 0018fdab..0d9af55e 100644 --- a/example/zoo/docker-compose.yaml +++ b/example/zoo/docker-compose.yaml @@ -1,6 +1,5 @@ -version: '2' +version: "2" services: - nginx: image: opentracing/nginx-opentracing networks: