ElasticAPM4D
1.0.0
DelphiのElastic-APMのエージェントであり、ソフトウェアメトリックを収集します。
Elastic-APM 7.11.1と互換性があります(他のものではテストされていません)。
StackTraceをアクティブにする場合(推奨)、JEDI-JCLをインストールし、条件付き定義にJCLを追加する必要があります。
WindowsとLinuxのサポート。
グローバル設定を設定するには、TCONFIGクラスを使用できます。例:
Uses
ElasticAPM4D.Config;
TConfig.SetAppName( ' My App ' ); // If not defined, it'll use the application.name
TConfig.SetAppVersion( ' V1.1.0 ' ) // If not defined, it'll get the application version (only windows)
TConfig.SetActive(False); // Always active, but you can inactivate de APM agent.
TConfig.SetUrlElasticAPM( ' http://192.168.1.1:8200/intake/v2/events ' ); // default is local (http://127.0.0.1:8200/intake/v2/events)
TConfig.SetSecret( ' ' ); // Set if you use secret token for authentication
TConfig.SetEnvironment( ' production ' ); // If not defined, it'll use 'staging'
TConfig.SetUserId( ' 123 ' );
TConfig.SetUserMail( ' [email protected] ' );
TConfig.SetUserName( ' user name ' ); // if not defined, it'll get windows userトランザクションの例:
簡単なトランザクション
Uses
ElasticAPM4D;
TApm.StartTransaction( ' MyTransactionName ' , ' MyType ' );
try
try
TApm.StartSpan( ' Sleep1 ' );
Sleep( 500 );
TApm.EndSpan;
TApm.StartSpan( ' Sleep2 ' );
Sleep( 750 );
TApm.EndSpan;
Abort;
except
on E: exception do
TApm.AddError(E);
end ;
finally
TApm.EndTransaction;
end ;
RESTリクエストトランザクション(TrestRequest)
RESTRequest.Resource := ' api/v1/customers ' ;
TApm.StartTransactionRequest(RESTRequest.Resource);
try
try
RESTRequest.Execute;
except
on E: EHTTPProtocolException do
TApm.AddError(E);
on E: exception do
TApm.AddError(E);
end ;
finally
TApm.EndTransaction(RESTRequest.Response);
end ;