Skip to content

Latest commit

 

History

History
147 lines (103 loc) · 3.93 KB

docker-deployment.md

File metadata and controls

147 lines (103 loc) · 3.93 KB
title linkTitle aliases cSpell:ignore
Docker deployment
Docker
docker_deployment
otlphttp spanmetrics tracetest tracetesting

Prerequisites

  • Docker
  • Docker Compose v2.0.0+
  • Make (optional)
  • 6 GB of RAM for the application

Get and run the demo

  1. Clone the Demo repository:

    git clone https://github.com/open-telemetry/opentelemetry-demo.git
  2. Change to the demo folder:

    cd opentelemetry-demo/
  3. Start the demo1:

    {{< tabpane text=true >}} {{% tab Make %}}

make start
{{% /tab %}} {{% tab Docker %}}
docker compose up --force-recreate --remove-orphans --detach
{{% /tab %}} {{< /tabpane >}}
  1. (Optional) Enable API observability-driven testing1:

    {{< tabpane text=true >}} {{% tab Make %}}

make run-tracetesting
{{% /tab %}} {{% tab Docker %}}
docker compose -f docker-compose-tests.yml run traceBasedTests
{{% /tab %}} {{< /tabpane >}}

Verify the web store and Telemetry

Once the images are built and containers are started you can access:

Changing the demo's primary port number

By default, the demo application will start a proxy for all browser traffic bound to port 8080. To change the port number, set the ENVOY_PORT environment variable before starting the demo.

  • For example, to use port 80811:

    {{< tabpane text=true >}} {{% tab Make %}}

ENVOY_PORT=8081 make start
{{% /tab %}} {{% tab Docker %}}
ENVOY_PORT=8081 docker compose up --force-recreate --remove-orphans --detach
{{% /tab %}} {{< /tabpane >}}

Bring your own backend

Likely you want to use the web store as a demo application for an observability backend you already have (e.g., an existing instance of Jaeger, Zipkin, or one of the vendors of your choice).

OpenTelemetry Collector can be used to export telemetry data to multiple backends. By default, the collector in the demo application will merge the configuration from two files:

  • otelcol-config.yml
  • otelcol-config-extras.yml

To add your backend, open the file src/otel-collector/otelcol-config-extras.yml with an editor.

  • Start by adding a new exporter. For example, if your backend supports OTLP over HTTP, add the following:

    exporters:
      otlphttp/example:
        endpoint: <your-endpoint-url>
  • Then override the exporters for telemetry pipelines that you want to use for your backend.

    service:
      pipelines:
        traces:
          exporters: [spanmetrics, otlphttp/example]

{{% alert title="Note" color="info" %}} When merging YAML values with the Collector, objects are merged and arrays are replaced. The spanmetrics exporter must be included in the array of exporters for the traces pipeline if overridden. Not including this exporter will result in an error. {{% /alert %}}

Vendor backends might require you to add additional parameters for authentication, please check their documentation. Some backends require different exporters, you may find them and their documentation available at opentelemetry-collector-contrib/exporter.

After updating the otelcol-config-extras.yml, start the demo by running make start. After a while, you should see the traces flowing into your backend as well.

Footnotes

  1. {{% param notes.docker-compose-v2 %}} 2 3