Skip to content

Commit

Permalink
[ja] translate demo/docker-deployment into ja (#6098)
Browse files Browse the repository at this point in the history
  • Loading branch information
Msksgm authored Feb 11, 2025
1 parent d2368c7 commit 443bf43
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]
default_lang_commit: 24146bd1368e4c6082c7d6077efd29dba0d51055
cSpell:ignore: otlphttp spanmetrics tracetest tracetesting
---

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

## 前提条件 {#prerequisites}

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

## デモの取得と実行 {#get-and-run-the-demo}

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 >}}

## ウェブストアとテレメトリーの確認 {#verify-the-web-store-and-telemetry}

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

- ウェブストア: <http://localhost:8080/>
- Grafana: <http://localhost:8080/grafana/>
- 負荷生成 UI: <http://localhost:8080/loadgen/>
- Jaeger UI: <http://localhost:8080/jaeger/ui/>
- トレーステスト UI: <http://localhost:11633/>`make run-tracetesting` の使用時のみ
- Flagd 設定 UI: <http://localhost:8080/feature>

## デモのプライマリーポート番号の変更 {#changing-the-demos-primary-port-number}

デフォルトでは、デモアプリケーションは 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 >}}

## 独自のバックエンドを導入する {#bring-your-own-backend}

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

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

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

あなたのバックエンドに追加するために、エディターで [src/otel-collector/otelcol-config-extras.yml](https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/otel-collector/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 443bf43

Please sign in to comment.