-
Notifications
You must be signed in to change notification settings - Fork 36
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 tags to listener #107
add tags to listener #107
Conversation
Codecov Report
@@ Coverage Diff @@
## master #107 +/- ##
==========================================
+ Coverage 88.28% 88.30% +0.02%
==========================================
Files 28 28
Lines 913 915 +2
Branches 159 159
==========================================
+ Hits 806 808 +2
Misses 74 74
Partials 33 33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM - I'm interested in the integration tests + manual verification before merging+releasing
src/trace/listener.ts
Outdated
@@ -9,6 +9,8 @@ import { didFunctionColdStart } from "../utils/cold-start"; | |||
import { Source } from "./constants"; | |||
import { patchConsole } from "./patch-console"; | |||
import { SpanContext, TraceOptions, TracerWrapper } from "./tracer-wrapper"; | |||
const datadogLambdaVersion = "3.32.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could export these are reuse them in the spec file, so you only have to substitute once. Or put them in the constants.ts file. I'd also leave this as a dummy value, eg 'x.xx.x' so if we accidentally push a build with the wrong version we can catch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
scripts/build_layers.sh
Outdated
DATADOG_LAMBDA_VERSION=$(cat package.json | jq -r ".version") | ||
DD_TRACE_VERSION=$(cat package.json | jq -r ."devDependencies"'."dd-trace"') | ||
|
||
sed -i "" -E "s/(datadogLambdaVersion = )\"([0-9]*\.[0-9]*\.[0-9]*)\"/\1\""$DATADOG_LAMBDA_VERSION"\"/" ./src/trace/listener.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, we could apply this in build_layers but then running just yarn build, (which we do when deploying the npm package), wouldn't work. You could create a new script, say './update_dist_version.sh', and run that as a post-script to yarn build eg. https://gist.github.com/coryhouse/b7ff5e6d1e41b762c35b, and modify the dist directory instead of touching the src code every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
scripts/build_layers.sh
Outdated
@@ -11,6 +11,13 @@ set -e | |||
LAYER_DIR=".layers" | |||
LAYER_FILES_PREFIX="datadog_lambda_node" | |||
NODE_VERSIONS=("10.15" "12.13") | |||
DATADOG_LAMBDA_VERSION=$(cat package.json | jq -r ".version") | |||
DD_TRACE_VERSION=$(cat package.json | jq -r ."devDependencies"'."dd-trace"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version of dd-trace-js specified in the package.json can be just a suggestion. For instance ^0.20.0, would mean any minor version greater than 20, but not a major version, so 0.25.5 would match, but not 1.21.0. Right now it's locked in the package.json to an explicit version, but we might change that in the future. The place to actually search is the yarn.lock file, which usually has an entry like this: https://github.com/DataDog/datadog-lambda-js/blob/master/yarn.lock#L1341 . I think we can leave it for now though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
Add version tags to trace/listerner.ts rather than enhanced-metrics.
Motivation
Better debugging experience.
Testing Guidelines
Additional Notes
Types of Changes
Check all that apply