OpenTelemetryコレクターを使用しないトレースデータ転送

最終更新日: 29 年 2023 月 XNUMX 日

OpenTelemetry Collectorを使用せずに、アプリケーションからLogicMonitorにトレースデータを直接転送できます。 これにより、コレクターをインストールして管理しなくても、アプリケーションからトレースをすばやく取り込むことができます。 たとえば、環境内のLambda関数のトレースデータを収集する場合は、インストルメンテーション中に変数を変更して、関数がトレースデータをLogicMonitorポータルに直接送信できるようにすることができます。

注: この方法を使用しても、OpenTelemetry Collectorのプロセッサを利用して、Collectorに送信されるデータを変更および拡張することはできません。 詳細については、を参照してください。 OpenTelemetryコレクタープロセッサの構成.

OpenTelemetryコレクターなしでトレースデータを転送するための要件

OpenTelemetry Collectorを使用せずにトレースデータを転送するには、次のものが必要です。

  • LogicMonitorポータルのエンドポイント。次のようになります。
    https://<PORTALNAME>.logicmonitor.com/rest/api/v1/traces
  • 有効なAPIトークン
    詳細については、を参照してください。 APIトークン.
  • 次の権限を管理します。
    • データの取り込み
    • ロジックモジュール
    • リソースまたはホストグループ

OpenTelemetryコレクターなしでトレースデータを転送する

注: 以下はJavaを使用しています。 他の言語の詳細と例については、LogicMonitorのホストされたデモアプリケーションを参照してください。 流行に敏感なショップ.

推奨事項: アプリケーションをインストルメントするときに、有効なサービス名前空間を提供します。 例えば、 -Dotel.resource.attributes=service.namespace=

During instrumentation, modify the variables in the application's configuration file to include the endpoint of your LogicMonitor portal, similar to the following:

java -javaagent:../opentelemetry-javaagent-all-1.9.0.jar \
-Dotel.exporter=otlp \
-Dotel.resource.attributes=service.name=pet-clinic \
-Dotel.exporter.otlp.endpoint=https://<portalname>.logicmonitor.com/rest/api \
-Dotel.exporter.otlp.protocol=http/protobuf \
-Dotel.exporter.otlp.headers=Authorization="Bearer <token>" \
-jar spring-petclinic-2.5.0-SNAPSHOT.jar

Recommendation: Use "OTLP" or "HTTP" as the protocol to send data directly to your LogicMonitor portal. These protocols use Protobuf payloads encoded either in binary format or in JSON format and use HTTP Post requests to send telemetry data from clients to servers.

In This Article