Skip to content

Commit

Permalink
docs: translated demo/docker-deployment into ja
Browse files Browse the repository at this point in the history
  • Loading branch information
Msksgm committed Jan 30, 2025
1 parent b68054b commit 75d329b
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 0 deletions.
138 changes: 138 additions & 0 deletions content/ja/docs/demo/docker-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
title: Docker デプロイ
linkTitle: Docker
aliases: [docker_deployment]
cSpell:ignore: otelcollector otlphttp spanmetrics tracetest tracetesting
default_lang_commit: 7cb1bd39726fc03698164ee17fe9087afdac054c
---

<!-- markdownlint-disable code-block-style ol-prefix -->

## 前提条件

- Docker
- [Docker Compose](https://docs.docker.com/compose/install/#install-compose)
v2.0.0+
- Make (オプション)
- アプリケーション用に 6 GB の RAM

## デモの取得と実行

1. デモリポジトリをクローン:

```shell
git clone https://github.com/open-telemetry/opentelemetry-demo.git
```

2. デモフォルダに移動:

```shell
cd opentelemetry-demo/
```

3. デモを起動[^1]:

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

```shell
make start
```

{{% /tab %}} {{% tab Docker %}}

```shell
docker compose up --force-recreate --remove-orphans --detach
```

{{% /tab %}} {{< /tabpane >}}

4. (オプション) API オブザーバビリティ駆動テストの有効化[^1]:

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

```shell
make run-tracetesting
```

{{% /tab %}} {{% tab Docker %}}

```shell
docker compose -f docker-compose-tests.yml run traceBasedTests
```

{{% /tab %}} {{< /tabpane >}}

## ウェブストアとテレメトリーの確認

イメージがビルドされ、コンテナが開始されるとアクセスできるようになります:

- Web store: <http://localhost:8080/>
- Grafana: <http://localhost:8080/grafana/>
- Load Generator UI: <http://localhost:8080/loadgen/>
- Jaeger UI: <http://localhost:8080/jaeger/ui/>
- Tracetest UI: <http://localhost:11633/>`make run-tracetesting` の使用時のみ
- Flagd configurator UI: <http://localhost:8080/feature>

## デモのプライマリーポート番号の変更

デフォルトでは、デモアプリケーションは 8080 ポートにバウンドされたすべてのブラウザのトラフィックに対してプロキシを開始します。
ポート番号を変更するには、デモを開始する前に環境変数 `ENVOY_PORT` を設定してください。

- 例、8081 ポートを利用する場合[^1]:

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

```shell
ENVOY_PORT=8081 make start
```

{{% /tab %}} {{% tab Docker %}}

```shell
ENVOY_PORT=8081 docker compose up --force-recreate --remove-orphans --detach
```

{{% /tab %}} {{< /tabpane >}}

## 独自のバックエンドを導入する

おそらく、あなたがすでに所持しているオブザーバビリティバックエンド(たとえば、Jaeger、Zipkin、または[選択したベンダー](/ecosystem/vendors/)のいずれかの既存インスタンス)のデモアプリケーションとしてウェブストアを利用したいでしょう。

OpenTelemetry コレクターはテレメトリーデータを複数のバックエンドに送信するのに利用可能です。
デフォルトで、デモアプリケーションのコレクターは 2 つのファイルから設定をマージします:

- `otelcol-config.yml`
- `otelcol-config-extras.yml`

あなたのバックエンドに追加するために、エディターで[src/otelcollector/otelcol-config-extras.yml](https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/otelcollector/otelcol-config-extras.yml)ファイルを開いてください。

- 新しいエクスポーターを追加することで始めます。例えば、もしあなたのバックエンドが OTLP over HTTP をサポートしているのであれば、以下を追加してください:

```yaml
exporters:
otlphttp/example:
endpoint: <your-endpoint-url>
```
- そして、`exporters` をあなたのバックエンドに使いたいテレメトリーパイプラインに上書きしてください。

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

{{% alert title="Note" color="info" %}}
YAML の値をコレクターとマージすると、オブジェクトはマージされて、配列は置き換えられます。
`spanmetrics` エクスポーターを上書きする場合は、`traces` パイプラインのエクスポーターの配列に含める必要があります。
このエクスポーターを含めないとエラーが発生します。
{{% /alert %}}

ベンダーのバックエンドは認証のために追加のパラメーターを必要とするかもしれません。ドキュメントを確認してください。
一部のバックエンドは異なるエクスポーターが必要です。それらのエクスポーターとドキュメントについて[opentelemetry-collector-contrib/exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter) で入手できます。

`otelcol-config-extras.yml` を更新した後に、`make start` を実行してデモを開始してください。
しばらくして、あなたのバックエンドにトレースが流れるのも確認できるはずです。

[^1]: {{% param notes.docker-compose-v2 %}}
4 changes: 4 additions & 0 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ languages:
languageName: 日本語 (Japanese)
params:
description: OpenTelemetryプロジェクト公式サイト
notes:
docker-compose-v2: |
`docker-compose` は非推奨です. 詳細は、
[Migrate to Compose V2](https://docs.docker.com/compose/migrate/) を確認してください。
pt: # cSpell:ignore Português Projeto
languageName: Português
languageCode: pt-BR
Expand Down

0 comments on commit 75d329b

Please sign in to comment.