Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add datadog apm support #205

Merged
merged 1 commit into from
Jan 30, 2019
Merged

Add datadog apm support #205

merged 1 commit into from
Jan 30, 2019

Conversation

zhouzhuojie
Copy link
Collaborator

Description

Adding supprt of datadog APM. It's by default disabled. Docs:https://docs.datadoghq.com/tracing/languages/go/

Motivation and Context

To support APM

How Has This Been Tested?

Local, unit and integration tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@zhouzhuojie zhouzhuojie requested review from ziru and michberr January 25, 2019 22:18
Copy link

@ziru ziru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

not sure how dd-apm works for go projects. ok to try and see.

hopefully, we will follow the similar service naming conventions.
https://app.datadoghq.com/apm/services?end=1548721474596&env=prod&paused=false&start=1548720574596

also, do you mind adding the instructions for golang project to this guru card?
https://app.getguru.com/card/czKok5ji/Enable-Datadog-APM-for-a-project


if Config.StatsdAPMEnabled {
tracer.Start(
tracer.WithAgentAddr(fmt.Sprintf("%s:%s", Config.StatsdHost, Config.StatsdPort)),
Copy link

@ziru ziru Jan 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhouzhuojie apm uses tcp port 8126, not udp port 8125.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will add another config then, is it by design that we use different ports in the agent setup?

@@ -17,8 +17,17 @@ import (
"github.com/sirupsen/logrus"
"github.com/urfave/negroni"
"github.com/yadvendar/negroni-newrelic-go-agent"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this lib includes tracers for http/gRPC out of the box? No need for further config

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it doesn't trace further. It logs the whole span. If we want to trace internal spans, we need to instrument the http client, DB, or other clients. Datadog provides wrappers for those clients.

And also, Flagr has no dependencies in the evaluation requests.

@zhouzhuojie zhouzhuojie force-pushed the zz/add-dd-apm-support branch from a008848 to 6aed959 Compare January 29, 2019 00:41
@codecov-io
Copy link

Codecov Report

Merging #205 into master will decrease coverage by 0.51%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #205      +/-   ##
==========================================
- Coverage   86.66%   86.14%   -0.52%     
==========================================
  Files          23       23              
  Lines        1327     1335       +8     
==========================================
  Hits         1150     1150              
- Misses        128      135       +7     
- Partials       49       50       +1
Impacted Files Coverage Δ
pkg/config/middleware.go 89.09% <0%> (-6.99%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4188c6...6aed959. Read the comment docs.

@zhouzhuojie zhouzhuojie merged commit 1a7397a into master Jan 30, 2019
@zhouzhuojie zhouzhuojie deleted the zz/add-dd-apm-support branch January 30, 2019 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants