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

OpenCensus with Datadog APM

OpenCensus with Datadog APM

Atsushi Tanaka

June 27, 2019
Tweet

More Decks by Atsushi Tanaka

Other Decks in Technology

Transcript

  1. ©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ͷ࢖͍ํ
  2. ©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ͷ࢖͍ํ
  3. ©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ͷ࢖͍ํ
  4. ©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ͷ࢖͍ํ
  5. ©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ͷ࢖͍ํ
  6. ©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
  7. ©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
  8. ©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 ៉ྷʹݟͤΔͨΊʹ
  9. ©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 ៉ྷʹݟͤΔͨΊʹ
  10. ©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 ៉ྷʹݟͤΔͨΊʹ
  11. ©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 ៉ྷʹݟͤΔͨΊʹ