-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ja]Translate content/en/docs/zero-code/js/(_index|configuration).md #7727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+156
−0
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| --- | ||
| title: JavaScriptのゼロコード計装 | ||
| linkTitle: JavaScript | ||
| description: ソースコードの変更なしでアプリケーションからテレメトリをキャプチャする | ||
| aliases: [/docs/languages/js/automatic] | ||
| default_lang_commit: 55f8de69ad3cf54f24243c200f70cd0b3a608ad4 | ||
| --- | ||
|
|
||
| JavaScriptのゼロコード計装は、コードを変更することなく、任意のNode.jsアプリケーションを計装し、多くの人気のあるライブラリやフレームワークからテレメトリーデータをキャプチャする方法を提供します。 | ||
|
|
||
| ## セットアップ {#setup} | ||
|
|
||
| 次のコマンドを実行して、適切なパッケージをインストールします。 | ||
|
|
||
| ```shell | ||
| npm install --save @opentelemetry/api | ||
| npm install --save @opentelemetry/auto-instrumentations-node | ||
| ``` | ||
|
|
||
| `@opentelemetry/api` および `@opentelemetry/auto-instrumentations-node` パッケージは、API、SDK、および計装ツールをインストールします。 | ||
|
|
||
| ## モジュール構成 {#configuring-the-module} | ||
|
|
||
| モジュールは高度に構成可能です。 | ||
|
|
||
| まず、CLIから環境変数を設定するために `env` を使用してモジュールを構成するオプションがあります。 | ||
|
|
||
| ```shell | ||
| env OTEL_TRACES_EXPORTER=otlp OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=your-endpoint \ | ||
| node --require @opentelemetry/auto-instrumentations-node/register app.js | ||
| ``` | ||
|
|
||
| あるいは、 `export` を使用して環境変数を設定することもできます。 | ||
|
|
||
| ```shell | ||
| export OTEL_TRACES_EXPORTER="otlp" | ||
| export OTEL_EXPORTER_OTLP_ENDPOINT="your-endpoint" | ||
| export OTEL_NODE_RESOURCE_DETECTORS="env,host,os" | ||
| export OTEL_SERVICE_NAME="your-service-name" | ||
| export NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register" | ||
| node app.js | ||
| ``` | ||
|
|
||
| デフォルトでは、すべてのSDK[リソース検出器](/docs/languages/js/resources/)が使用されます。 | ||
| 環境変数 `OTEL_NODE_RESOURCE_DETECTORS` を使用して、特定の検出器のみを有効にしたり、完全に無効にしたりできます | ||
|
|
||
| 構成オプションのすべての範囲を確認するには、[モジュール構成](configuration)を参照してください。 | ||
|
|
||
| ## サポートされているライブラリとフレームワーク {#supported-libraries-and-frameworks} | ||
|
|
||
| 人気のあるNode.jsライブラリの多くが自動計装されています。 | ||
| 完全なリストについては、[サポートされている計装](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/auto-instrumentations-node#supported-instrumentations)をご覧ください。 | ||
|
|
||
| ## トラブルシューティング {#troubleshooting} | ||
|
|
||
| `OTEL_LOG_LEVEL` 環境変数を以下のいずれかに設定いsて、ログレベルを設定できます。 | ||
kohbis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - `none` | ||
| - `error` | ||
| - `warn` | ||
| - `info` | ||
| - `debug` | ||
| - `verbose` | ||
| - `all` | ||
|
|
||
| デフォルトのレベルは `info` です。 | ||
|
|
||
| {{% alert title="Notes" %}} | ||
|
|
||
| - 本番環境では、 `OTEL_LOG_LEVEL` を `info` に設定することを推奨します。 | ||
| - ログは常に `console` に送信され、環境やデバッグレベルに関係なく送信されます。 | ||
| - デバッグログは、非常に冗長でありアプリケーションのパフォーマンスに悪影響を与える可能性があります。 | ||
| 必要な場合にのみデバッグログを有効にしてください。 | ||
|
|
||
| {{% /alert %}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| --- | ||
| title: ゼロコード計装の構成 | ||
| linkTitle: 構成 | ||
| description: Node.jsのゼロコード計装を構成する方法を学びます | ||
| aliases: | ||
| - /docs/languages/js/automatic/configuration | ||
| - /docs/languages/js/automatic/module-config | ||
| weight: 10 | ||
| default_lang_commit: 115933c1b9c643c8b6cf0d413a32061cd3a1b65f | ||
| cSpell:ignore: serviceinstance | ||
| --- | ||
|
|
||
| このモジュールは、[環境変数](/docs/specs/otel/configuration/sdk-environment-variables/)を設定することで高度に構成できます。 | ||
| リソース検出器、エクスポーター、トレースコンテキストの伝搬ヘッダーなど、ゼロコード計装の動作の多くの側面をニーズに合わせて構成できます。 | ||
|
|
||
| ## SDKとエクスポーターの構成 {#sdk-and-exporter-configuration} | ||
|
|
||
| [SDKとエクスポーターの構成](/docs/languages/sdk-configuration/)は、環境変数を使用して設定できます。 | ||
|
|
||
| ## SDKリソース検出器の構成 {#sdk-resource-detector-configuration} | ||
|
|
||
| デフォルトでは、モジュールはすべてのSDKリソース検出器を有効にします。 | ||
| `OTEL_NODE_RESOURCE_DETECTORS` 環境変数を使用して、特定の検出器のみを有効化または無効化できます。 | ||
|
|
||
| - `env` | ||
| - `host` | ||
| - `os` | ||
| - `process` | ||
| - `serviceinstance` | ||
| - `container` | ||
| - `alibaba` | ||
| - `aws` | ||
| - `azure` | ||
| - `gcp` | ||
| - `all` - すべてのリソース検出器を有効化 | ||
| - `none` - すべてのリソース検出器を無効化 | ||
|
|
||
| たとえば、`env` と `host` 検出器のみを有効にするには、次のように設定します。 | ||
|
|
||
| ```shell | ||
| OTEL_NODE_RESOURCE_DETECTORS=env,host | ||
| ``` | ||
|
|
||
| ## 計装ライブラリの除外 {#excluding-instrumentation-libraries} | ||
|
|
||
| デフォルトでは、[サポートされた計装ライブラリ](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/packages/auto-instrumentations-node/README.md#supported-instrumentations)が有効化されていますが、環境変数を使用して特定の計装のみを有効化または無効化できます。 | ||
|
|
||
| ### 特定の計装を有効化 {#enable-specific-instrumentations} | ||
|
|
||
| 環境変数 `OTEL_NODE_ENABLED_INSTRUMENTATIONS` を使用して、`@opentelemetry/instrumentation-` プレフィックスなしの計装ライブラリ名のカンマ区切りのリストを提供することで、特定の計装のみを有効化します。 | ||
kohbis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| たとえば、 | ||
| [@opentelemetry/instrumentation-http](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http) | ||
| および | ||
| [@opentelemetry/instrumentation-express](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express) | ||
| の計装のみを有効化します。 | ||
|
|
||
| ```shell | ||
| OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,express" | ||
| ``` | ||
|
|
||
| ### 特定の計装を無効化 {#disable-specific-instrumentations} | ||
|
|
||
| 環境変数を `OTEL_NODE_DISABLED_INSTRUMENTATIONS` を使用して、完全に有効化されたリストを保持し、`@opentelemetry/instrumentation-` プレフィックスなしの計装ライブラリ名のカンマ区切りのリストを提供することで、特定の計装のみを無効化します。 | ||
kohbis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| たとえば、 | ||
| [@opentelemetry/instrumentation-fs](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-fs) | ||
| および | ||
| [@opentelemetry/instrumentation-grpc](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-grpc) | ||
| の計装のみを無効化します。 | ||
|
|
||
| ```shell | ||
| OTEL_NODE_DISABLED_INSTRUMENTATIONS="fs,grpc" | ||
| ``` | ||
|
|
||
| {{% alert title="Note" %}} | ||
|
|
||
| 両方の環境変数が設定されている場合、最初に `OTEL_NODE_ENABLED_INSTRUMENTATIONS` が適用され、次に `OTEL_NODE_DISABLED_INSTRUMENTATIONS` がそのリストに適用されます。 | ||
| したがって、両方のリストに同じ計装が含まれている場合、その計装は無効化されます。 | ||
|
|
||
| {{% /alert %}} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.