OpenCensus with Datadog APM

OpenCensus with Datadog APM

C3b68d6841dcd343be9685f1cdaf8ac9?s=128

Atsushi Tanaka

June 27, 2019
Tweet

Transcript

  1. OpenCensus
 with Datadog APM OpenCensus/OpenTelemetry meetup vol.2 LT 27.Jul.2019 -

    Atsushi Tanaka @bgpat ©2019 Wantedly, Inc.
  2. ©2018 Wantedly, Inc. @bgpat / Atsushi Tanaka Infrastructure Engineer at

    Wantedly, Inc.
  3. ©2018 Wantedly, Inc. %BUBEPH"1. αʔϏε͝ͱʹ৭෼͚͞Εͯ៉ྷ
 
 ݸʑͷεύϯΛݟͳͯ͘΋
 ͳΜͱͳ͘શମΛ೺ѲͰ͖Δ

  4. ©2018 Wantedly, Inc. %BUBEPH"1. Τϥʔ͕৭෇͚͞ΕΔͷͰ
 Ͳ͕͜ѱ͍ͷ͔Θ͔Γ΍͍͢

  5. ©2018 Wantedly, Inc. 0QFO$FOTVT͔ΒૹΓ͍ͨ w(PIUUQTHJUIVCDPN%BUB%PHPQFODFOTVTHPFYQPSUFSEBUBEPH  w3VCZIUUQTHJUIVCDPNNVOJTZTUFNPQFODFOTVTEBUBEPH  w&SMBOHIUUQTHJUIVCDPNPQFODFOTVTCFBNPQFODFOTVT@EBUBEPH 

    0QFO$FOTVT %BUBEPH"1.
  6. ©2018 Wantedly, Inc. func main() { exporter, err := datadog.NewExporter(datadog.Options{Service:

    "my-app"}) if err != nil { log.Fatal(err) } defer exporter.Stop() trace.RegisterExporter(exporter) // For demoing purposes, always sample. trace.ApplyConfig(trace.Config{ DefaultSampler: trace.AlwaysSample(), }) ctx, span := trace.StartSpan(context.Background(), "/foo") bar(ctx) span.End() } https://github.com/DataDog/opencensus-go-exporter-datadog/blob/master/examples/trace/main.go 0QFO$FOTVT(P%BUBEPHͷ࢖͍ํ
  7. ©2018 Wantedly, Inc. func main() { exporter, err := datadog.NewExporter(datadog.Options{Service:

    "my-app"}) if err != nil { log.Fatal(err) } defer exporter.Stop() trace.RegisterExporter(exporter) // For demoing purposes, always sample. trace.ApplyConfig(trace.Config{ DefaultSampler: trace.AlwaysSample(), }) ctx, span := trace.StartSpan(context.Background(), "/foo") bar(ctx) span.End() } https://github.com/DataDog/opencensus-go-exporter-datadog/blob/master/examples/trace/main.go FYQPSUFSͷॳظԽ 0QFO$FOTVT(P%BUBEPHͷ࢖͍ํ
  8. ©2018 Wantedly, Inc. func main() { exporter, err := datadog.NewExporter(datadog.Options{Service:

    "my-app"}) if err != nil { log.Fatal(err) } defer exporter.Stop() trace.RegisterExporter(exporter) // For demoing purposes, always sample. trace.ApplyConfig(trace.Config{ DefaultSampler: trace.AlwaysSample(), }) ctx, span := trace.StartSpan(context.Background(), "/foo") bar(ctx) span.End() } https://github.com/DataDog/opencensus-go-exporter-datadog/blob/master/examples/trace/main.go ઃఆ͕ඞཁͳͷ͸4FSWJDF͘Β͍ 0QFO$FOTVT(P%BUBEPHͷ࢖͍ํ
  9. ©2018 Wantedly, Inc. func main() { exporter, err := datadog.NewExporter(datadog.Options{Service:

    "my-app"}) if err != nil { log.Fatal(err) } defer exporter.Stop() trace.RegisterExporter(exporter) // For demoing purposes, always sample. trace.ApplyConfig(trace.Config{ DefaultSampler: trace.AlwaysSample(), }) ctx, span := trace.StartSpan(context.Background(), "/foo") bar(ctx) span.End() } https://github.com/DataDog/opencensus-go-exporter-datadog/blob/master/examples/trace/main.go USBDFSʹొ࿥ TQBOΛ࡞Δͱ%BUBEPHʹૹΒΕΔΑ͏ʹͳΔ 0QFO$FOTVT(P%BUBEPHͷ࢖͍ํ
  10. ©2018 Wantedly, Inc. func main() { exporter, err := datadog.NewExporter(datadog.Options{Service:

    "my-app"}) if err != nil { log.Fatal(err) } defer exporter.Stop() trace.RegisterExporter(exporter) // For demoing purposes, always sample. trace.ApplyConfig(trace.Config{ DefaultSampler: trace.AlwaysSample(), }) ctx, span := trace.StartSpan(context.Background(), "/foo") bar(ctx) span.End() } https://github.com/DataDog/opencensus-go-exporter-datadog/blob/master/examples/trace/main.go 0QFO$FOTVTͰ͸αϯϓϦϯά͠ͳ͍ %BUBEPHଆͰαϯϓϦϯά͢Δ 0QFO$FOTVT(P%BUBEPHͷ࢖͍ํ
  11. ©2018 Wantedly, Inc. 0QFO$FOTVT(P%BUBEPHͷ࢖͍ํ func main() { exporter, err :=

    datadog.NewExporter(datadog.Options{Service: "my-app"}) if err != nil { log.Fatal(err) } defer exporter.Stop() trace.RegisterExporter(exporter) // For demoing purposes, always sample. trace.ApplyConfig(trace.Config{ DefaultSampler: trace.AlwaysSample(), }) ctx, span := trace.StartSpan(context.Background(), "/foo") bar(ctx) span.End() } https://github.com/DataDog/opencensus-go-exporter-datadog/blob/master/examples/trace/main.go
  12. ©2018 Wantedly, Inc. %BUBEPHͰαϯϓϦϯά͢Δཧ༝ 1.τϨʔεͷܽଛΛආ͚Δ Datadog͸উखʹαϯϓϦϯά͢ΔͷͰ
 σʔλ͕ফ͍͑ͯΔ͜ͱ͕͋Δ 2.ਖ਼֬ͳ౷ܭ৘ใΛऔΔ APMʹ͸τϨʔε͔ΒऔΕΔ౷ܭ৘ใͷUI΋͋Δ ຊདྷΑΓ΋τϨʔε͕গͳ͘ͳΔͷͰ౷ܭ஋΋มΘΔ

    4BNQMJOH$POGJHVSBUJPO
  13. ©2018 Wantedly, Inc. BUUSJCVUF UBH Λઃఆ͢Δͱ6*ʹద༻ͯ͘͠ΕΔ https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext ʹattributeҰཡ͕͋Δ ៉ྷʹݟͤΔͨΊʹ •

    env • service.name • span.type • http.method • http.url • http.status_code • sql.query • error.type • error.name • error.stack
  14. ©2018 Wantedly, Inc. BUUSJCVUF UBH Λઃఆ͢Δͱ6*ʹద༻ͯ͘͠ΕΔ https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext ʹattributeҰཡ͕͋Δ • env

    • service.name • span.type • http.method • http.url • http.status_code • sql.query • error.type • error.name • error.stack ៉ྷʹݟͤΔͨΊʹ
  15. ©2018 Wantedly, Inc. BUUSJCVUF UBH Λઃఆ͢Δͱ6*ʹ൓ө͞ΕΔ https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext ʹattributeҰཡ͕͋Δ • env

    • service.name • span.type • http.method • http.url • http.status_code • sql.query • error.type • error.name • error.stack ៉ྷʹݟͤΔͨΊʹ
  16. ©2018 Wantedly, Inc. BUUSJCVUF UBH Λઃఆ͢Δͱ6*ʹద༻ͯ͘͠ΕΔ https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext ʹattributeҰཡ͕͋Δ • env

    • service.name • span.type • http.method • http.url • http.status_code • sql.query • error.type • error.name • error.stack ៉ྷʹݟͤΔͨΊʹ
  17. ©2018 Wantedly, Inc. BUUSJCVUF UBH Λઃఆ͢Δͱ6*ʹద༻ͯ͘͠ΕΔ https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext ʹattributeҰཡ͕͋Δ • env

    • service.name • span.type • http.method • http.url • http.status_code • sql.query • error.type • error.name • error.stack https://docs.datadoghq.com/tracing/visualization/trace/#traces-special-meaning-tags ៉ྷʹݟͤΔͨΊʹ
  18. ©2018 Wantedly, Inc. BUUSJCVUF UBH Λઃఆ͢Δͱ6*ʹద༻ͯ͘͠ΕΔ https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext ʹattributeҰཡ͕͋Δ • span.name

    ៉ྷʹݟͤΔͨΊʹ
  19. ©2018 Wantedly, Inc. ࠷্Ґεύϯʹ͸ಉ͡3FTPVSDF/BNFΛ෇͚Δඞཁ͕͋Δ w %BUBEPHͰ͸εύϯ໊3FTPVSDF/BNF w ݹ͍࣮૷ͩͱ3FTPVSDF/BNF͕όϥόϥͰ6*͕յΕΔ w ࠓ͸σϑΥϧτͰPQFODFOTVT͕ࢦఆ͞ΕΔ

    w εύϯ໊ʹ΋࿈ಈ͍ͯͯ͢͠΂ͯPQFODFOTVTʹͳΔ w ʮεύϯ໊Λม͍͑ͨਓ͸TQBOOBNFBUUSJCVUFΛ࢖ͬͯͶʯ ៉ྷʹݟͤΔͨΊʹ
  20. ©2018 Wantedly, Inc. w (PͰ ࢖͏ͷ͸؆୯ wαϯϓϦϯά͸%BUBEPHʹ೚ͤΔ w؀ڥʹ͋ΘͤͯBUUSJCVUFΛઃఆ͢Δ ·ͱΊ

  21. .JDSPTFSWJDFT.POEBZ ຖि݄༵೔ʹϚΠΫϩαʔϏεʹ͍ͭͯ
 ΏΔ͘࿩͢ձΛ͍ͯ͠·͢ IUUQTXXXXBOUFEMZDPNQSPKFDUT ©2019 Wantedly, Inc.