Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opent...

shin1x1
December 22, 2024

PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry

2024-12-22 PHP カンファレンス 2024

shin1x1

December 22, 2024
Tweet

More Decks by shin1x1

Other Decks in Technology

Transcript

  1. D .BTBTIJ4IJOCBSB!TIJOY 0QFO5FMFNFUSZ 05FM ͱ͸ w ςϨϝτϦσʔλΛੜ੒ɺऩूɺૹ৴͢ΔπʔϧΩοτ ࢓༷ͱ࣮૷ w ϕϯμʔχϡʔτϥϧͳΦʔϓϯιʔε

    $/$'QSPKFDUҎ্ͷπʔϧ΍αʔϏε͕αϙʔτ w ΦϒβʔόϏϦςΟόοΫΤϯυ͸ؚ·ͳ͍ ςϨϝτϦσʔλͷอଘɺ෼ੳɺࢹ֮Խ͸ผͷπʔϧ΍αʔϏεΛར༻
  2. D .BTBTIJ4IJOCBSB!TIJOY खಈܭ૷ඞཁͳύοέʔδ $ composer require open-telemetry/sdk \ open-telemetry/exporter-otlp \

    php-http/guzzle7-adapter # ඞཁʹԠͯ͡ɺy or n Λೖྗ Do you trust "tbachert/spi" to ... [y,n,d,?] n
  3. D .BTBTIJ4IJOCBSB!TIJOY ܭ૷ͷઃఆ w ؀ڥม਺Ͱࢦఆ ؀ڥม਺ ஋ ಺༰ 05&-@&91035&3@05-1@13050$0- IUUQQSPUPCVGʢσϑΥϧτʣ

    ૹ৴ϓϩτίϧ 05&-@4&37*$&@/".& BQQ αʔϏε໊ʢτϨʔεʹؚ·ΕΔʣ 05&-@&91035&3@05-1@&/%10*/5 IUUQKBFHFS ૹ৴ઌ63-ʢ+BFHFSʣ
  4. D .BTBTIJ4IJOCBSB!TIJOY खಈܭ૷1)1ίʔυྫ $tracerProvider = new TracerProviderFactory()->create(); // TraceProvider ࡞੒

    $tracer = $tracerProvider->getTracer('trace-example'); // Tracer ࡞੒ $rootSpan = $tracer->spanBuilder('root')->startSpan(); // ϧʔτεύϯ։࢝ $rootScope = $rootSpan->activate(); // Ҏ߱ͷεύϯΛϧʔτεύϯΛ਌ʹ͢Δ usleep(50 * 1000); try { $span1 = $tracer->spanBuilder('foo')->startSpan(); // εύϯ։࢝ usleep(100 * 1000); $span1->end(); // εύϯऴྃ } finally { $rootScope->detach(); $rootSpan->end(); // ϧʔτεύϯऴྃ } $tracerProvider->shutdown(); // TraceProvider ऴྃ
  5. D .BTBTIJ4IJOCBSB!TIJOY PHP アプリケーション Jaeger OTel Collector New Relic Datadog

    Loki 0QFO5FMFNFUSZ$PMMFDUPSར༻Πϝʔδ ςϨϝτϦσʔλੜ੒ɺૹ৴ όοΫΤϯυʹసૹ σʔλอଘɺࢹ֮Խɺ෼ੳ
  6. D .BTBTIJ4IJOCBSB!TIJOY ྫϩʔΧϧ؀ڥͱຊ൪؀ڥྫ PHP アプリケーション Jaeger OTLP OTel Collector OTLP

    w ϩʔΧϧ؀ڥ w ຊ൪؀ڥ PHP アプリケーション New Relic OTLP OTel Collector OTLP όοΫΤϯυ͕มΘͬͯ΋ 1)1ΞϓϦέʔγϣϯ͸มߋෆཁ
  7. D .BTBTIJ4IJOCBSB!TIJOY ྫҟͳΔϓϩτίϧʹม׵ PHP アプリケーション Jaeger OTLP OTel Collector OTLP

    w ϩʔΧϧ؀ڥ w ຊ൪؀ڥ %BUBEPH&YQPSUFSͰม׵ PHP アプリケーション Datadog OTLP OTel Collector Datadog
  8. D .BTBTIJ4IJOCBSB!TIJOY PHP アプリケーション AWS X-Ray OTLP ADOT Collector X-Ray

    ྫόοΫΤϯυઐ༻$PMMFDUPSͷར༻ PHP アプリケーション Jaeger OTLP OTel Collector OTLP w ϩʔΧϧ؀ڥ w ຊ൪؀ڥ "84%JTUSPGPS0QFO5FMFNFUSZ "%05 $PMMFDUPSΛར༻