Skip to content

Commit 5e4a429

Browse files
authored
Fix Upstream Service Mapping (#418)
* debugging why mapping wont work in js * add service.name tag which is honored at intake * Delete formating diffs * format * format * fix tests and remove log * snapshots * lint
1 parent 1ccb198 commit 5e4a429

File tree

9 files changed

+72
-39
lines changed

9 files changed

+72
-39
lines changed

integration_tests/serverless.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ provider:
77
environment:
88
DD_INTEGRATION_TEST: true
99
DD_API_KEY: ${env:DD_API_KEY}
10+
DD_SERVICE_MAPPING: "lambda_api_gateway:remappedApiGatewayServiceName,lambda_sns:remappedSnsServiceName,lambda_sqs:remappedSqsServiceName,lambda_s3:remappedS3ServiceName,lambda_eventbridge:remappedEventBridgeServiceName,lambda_kinesis:remappedKinesisServiceName,lambda_dynamodb:remappedDynamoDbServiceName,lambda_url:remappedUrlServiceName"
1011
timeout: 15
1112
deploymentBucket:
1213
name: integration-tests-serververless-deployment-bucket

integration_tests/snapshots/logs/process-input-traced_node14.log

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ START
3636
"error": 0,
3737
"meta": {
3838
"_dd.p.dm": "-0",
39+
"service": "remappedApiGatewayServiceName",
3940
"runtime-id":"XXXX",
4041
"operation_name": "aws.apigateway",
4142
"http.url": "undefined",
@@ -57,6 +58,7 @@ START
5758
},
5859
"start":XXXX,
5960
"duration":XXXX,
61+
"service": "remappedApiGatewayServiceName",
6062
"type": "http"
6163
},
6264
{
@@ -201,7 +203,7 @@ START
201203
"error": 0,
202204
"meta": {
203205
"_dd.p.dm": "-0",
204-
"service": "sns",
206+
"service": "remappedSnsServiceName",
205207
"runtime-id":"XXXX",
206208
"operation_name": "aws.sns",
207209
"resource_names": "sns-lambda",
@@ -224,7 +226,7 @@ START
224226
},
225227
"start":XXXX,
226228
"duration":XXXX,
227-
"service": "integration-tests-js-XXXX-process-input-traced_node14",
229+
"service": "remappedSnsServiceName",
228230
"type": "sns"
229231
},
230232
{
@@ -323,7 +325,7 @@ START
323325
"error": 0,
324326
"meta": {
325327
"_dd.p.dm": "-0",
326-
"service": "sqs",
328+
"service": "remappedSqsServiceName",
327329
"runtime-id":"XXXX",
328330
"operation_name": "aws.sqs",
329331
"resource_names": "my-queue",
@@ -345,7 +347,7 @@ START
345347
},
346348
"start":XXXX,
347349
"duration":XXXX,
348-
"service": "my-queue",
350+
"service": "remappedSqsServiceName",
349351
"type": "web"
350352
},
351353
{

integration_tests/snapshots/logs/process-input-traced_node16.log

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ START
3636
"error": 0,
3737
"meta": {
3838
"_dd.p.dm": "-0",
39+
"service": "remappedApiGatewayServiceName",
3940
"version": "1.0.0",
4041
"runtime-id":"XXXX",
4142
"operation_name": "aws.apigateway",
@@ -58,6 +59,7 @@ START
5859
},
5960
"start":XXXX,
6061
"duration":XXXX,
62+
"service": "remappedApiGatewayServiceName",
6163
"type": "http"
6264
},
6365
{
@@ -206,7 +208,7 @@ START
206208
"error": 0,
207209
"meta": {
208210
"_dd.p.dm": "-0",
209-
"service": "sns",
211+
"service": "remappedSnsServiceName",
210212
"version": "1.0.0",
211213
"runtime-id":"XXXX",
212214
"operation_name": "aws.sns",
@@ -230,7 +232,7 @@ START
230232
},
231233
"start":XXXX,
232234
"duration":XXXX,
233-
"service": "integration-tests-js-XXXX-process-input-traced_node16",
235+
"service": "remappedSnsServiceName",
234236
"type": "sns"
235237
},
236238
{
@@ -331,7 +333,7 @@ START
331333
"error": 0,
332334
"meta": {
333335
"_dd.p.dm": "-0",
334-
"service": "sqs",
336+
"service": "remappedSqsServiceName",
335337
"version": "1.0.0",
336338
"runtime-id":"XXXX",
337339
"operation_name": "aws.sqs",
@@ -354,7 +356,7 @@ START
354356
},
355357
"start":XXXX,
356358
"duration":XXXX,
357-
"service": "my-queue",
359+
"service": "remappedSqsServiceName",
358360
"type": "web"
359361
},
360362
{

integration_tests/snapshots/logs/process-input-traced_node18.log

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ START
3636
"error": 0,
3737
"meta": {
3838
"_dd.p.dm": "-0",
39+
"service": "remappedApiGatewayServiceName",
3940
"version": "1.0.0",
4041
"runtime-id":"XXXX",
4142
"operation_name": "aws.apigateway",
@@ -58,6 +59,7 @@ START
5859
},
5960
"start":XXXX,
6061
"duration":XXXX,
62+
"service": "remappedApiGatewayServiceName",
6163
"type": "http"
6264
},
6365
{
@@ -206,7 +208,7 @@ START
206208
"error": 0,
207209
"meta": {
208210
"_dd.p.dm": "-0",
209-
"service": "sns",
211+
"service": "remappedSnsServiceName",
210212
"version": "1.0.0",
211213
"runtime-id":"XXXX",
212214
"operation_name": "aws.sns",
@@ -230,7 +232,7 @@ START
230232
},
231233
"start":XXXX,
232234
"duration":XXXX,
233-
"service": "integration-tests-js-XXXX-process-input-traced_node18",
235+
"service": "remappedSnsServiceName",
234236
"type": "sns"
235237
},
236238
{
@@ -331,7 +333,7 @@ START
331333
"error": 0,
332334
"meta": {
333335
"_dd.p.dm": "-0",
334-
"service": "sqs",
336+
"service": "remappedSqsServiceName",
335337
"version": "1.0.0",
336338
"runtime-id":"XXXX",
337339
"operation_name": "aws.sqs",
@@ -354,7 +356,7 @@ START
354356
},
355357
"start":XXXX,
356358
"duration":XXXX,
357-
"service": "my-queue",
359+
"service": "remappedSqsServiceName",
358360
"type": "web"
359361
},
360362
{

integration_tests/snapshots/logs/status-code-500s_node14.log

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ START
4242
"error": 0,
4343
"meta": {
4444
"_dd.p.dm": "-0",
45+
"service": "remappedApiGatewayServiceName",
4546
"runtime-id":"XXXX",
4647
"operation_name": "aws.apigateway",
4748
"http.url": "undefined",
@@ -63,6 +64,7 @@ START
6364
},
6465
"start":XXXX,
6566
"duration":XXXX,
67+
"service": "remappedApiGatewayServiceName",
6668
"type": "http"
6769
},
6870
{
@@ -152,7 +154,7 @@ START
152154
"error": 0,
153155
"meta": {
154156
"_dd.p.dm": "-0",
155-
"service": "sns",
157+
"service": "remappedSnsServiceName",
156158
"runtime-id":"XXXX",
157159
"operation_name": "aws.sns",
158160
"resource_names": "sns-lambda",
@@ -175,7 +177,7 @@ START
175177
},
176178
"start":XXXX,
177179
"duration":XXXX,
178-
"service": "integration-tests-js-XXXX-status-code-500s_node14",
180+
"service": "remappedSnsServiceName",
179181
"type": "sns"
180182
},
181183
{
@@ -241,7 +243,7 @@ START
241243
"error": 0,
242244
"meta": {
243245
"_dd.p.dm": "-0",
244-
"service": "sqs",
246+
"service": "remappedSqsServiceName",
245247
"runtime-id":"XXXX",
246248
"operation_name": "aws.sqs",
247249
"resource_names": "my-queue",
@@ -263,7 +265,7 @@ START
263265
},
264266
"start":XXXX,
265267
"duration":XXXX,
266-
"service": "my-queue",
268+
"service": "remappedSqsServiceName",
267269
"type": "web"
268270
},
269271
{

integration_tests/snapshots/logs/status-code-500s_node16.log

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ START
4242
"error": 0,
4343
"meta": {
4444
"_dd.p.dm": "-0",
45+
"service": "remappedApiGatewayServiceName",
4546
"version": "1.0.0",
4647
"runtime-id":"XXXX",
4748
"operation_name": "aws.apigateway",
@@ -64,6 +65,7 @@ START
6465
},
6566
"start":XXXX,
6667
"duration":XXXX,
68+
"service": "remappedApiGatewayServiceName",
6769
"type": "http"
6870
},
6971
{
@@ -155,7 +157,7 @@ START
155157
"error": 0,
156158
"meta": {
157159
"_dd.p.dm": "-0",
158-
"service": "sns",
160+
"service": "remappedSnsServiceName",
159161
"version": "1.0.0",
160162
"runtime-id":"XXXX",
161163
"operation_name": "aws.sns",
@@ -179,7 +181,7 @@ START
179181
},
180182
"start":XXXX,
181183
"duration":XXXX,
182-
"service": "integration-tests-js-XXXX-status-code-500s_node16",
184+
"service": "remappedSnsServiceName",
183185
"type": "sns"
184186
},
185187
{
@@ -246,7 +248,7 @@ START
246248
"error": 0,
247249
"meta": {
248250
"_dd.p.dm": "-0",
249-
"service": "sqs",
251+
"service": "remappedSqsServiceName",
250252
"version": "1.0.0",
251253
"runtime-id":"XXXX",
252254
"operation_name": "aws.sqs",
@@ -269,7 +271,7 @@ START
269271
},
270272
"start":XXXX,
271273
"duration":XXXX,
272-
"service": "my-queue",
274+
"service": "remappedSqsServiceName",
273275
"type": "web"
274276
},
275277
{

integration_tests/snapshots/logs/status-code-500s_node18.log

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ START
4242
"error": 0,
4343
"meta": {
4444
"_dd.p.dm": "-0",
45+
"service": "remappedApiGatewayServiceName",
4546
"version": "1.0.0",
4647
"runtime-id":"XXXX",
4748
"operation_name": "aws.apigateway",
@@ -64,6 +65,7 @@ START
6465
},
6566
"start":XXXX,
6667
"duration":XXXX,
68+
"service": "remappedApiGatewayServiceName",
6769
"type": "http"
6870
},
6971
{
@@ -155,7 +157,7 @@ START
155157
"error": 0,
156158
"meta": {
157159
"_dd.p.dm": "-0",
158-
"service": "sns",
160+
"service": "remappedSnsServiceName",
159161
"version": "1.0.0",
160162
"runtime-id":"XXXX",
161163
"operation_name": "aws.sns",
@@ -179,7 +181,7 @@ START
179181
},
180182
"start":XXXX,
181183
"duration":XXXX,
182-
"service": "integration-tests-js-XXXX-status-code-500s_node18",
184+
"service": "remappedSnsServiceName",
183185
"type": "sns"
184186
},
185187
{
@@ -246,7 +248,7 @@ START
246248
"error": 0,
247249
"meta": {
248250
"_dd.p.dm": "-0",
249-
"service": "sqs",
251+
"service": "remappedSqsServiceName",
250252
"version": "1.0.0",
251253
"runtime-id":"XXXX",
252254
"operation_name": "aws.sqs",
@@ -269,7 +271,7 @@ START
269271
},
270272
"start":XXXX,
271273
"duration":XXXX,
272-
"service": "my-queue",
274+
"service": "remappedSqsServiceName",
273275
"type": "web"
274276
},
275277
{

0 commit comments

Comments
 (0)