-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'aws-observability:main' into main
- Loading branch information
Showing
26 changed files
with
2,715 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
aws-distro-opentelemetry-node-autoinstrumentation/.eslintignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build | ||
node_modules | ||
.eslintrc.js | ||
version.ts | ||
version.ts | ||
src/third-party |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
aws-distro-opentelemetry-node-autoinstrumentation/src/patches/aws/services/secretsmanager.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Attributes, Span, SpanKind, Tracer } from '@opentelemetry/api'; | ||
import { | ||
AwsSdkInstrumentationConfig, | ||
NormalizedRequest, | ||
NormalizedResponse, | ||
} from '@opentelemetry/instrumentation-aws-sdk'; | ||
import { AWS_ATTRIBUTE_KEYS } from '../../../aws-attribute-keys'; | ||
import { RequestMetadata, ServiceExtension } from '../../../third-party/otel/aws/services/ServiceExtension'; | ||
|
||
export class SecretsManagerServiceExtension implements ServiceExtension { | ||
requestPreSpanHook(request: NormalizedRequest, _config: AwsSdkInstrumentationConfig): RequestMetadata { | ||
const secretId = request.commandInput?.SecretId; | ||
|
||
const spanKind: SpanKind = SpanKind.CLIENT; | ||
let spanName: string | undefined; | ||
|
||
const spanAttributes: Attributes = {}; | ||
|
||
if (typeof secretId === 'string' && secretId.startsWith('arn:aws:secretsmanager:')) { | ||
spanAttributes[AWS_ATTRIBUTE_KEYS.AWS_SECRETSMANAGER_SECRET_ARN] = secretId; | ||
} | ||
|
||
const isIncoming = false; | ||
|
||
return { | ||
isIncoming, | ||
spanAttributes, | ||
spanKind, | ||
spanName, | ||
}; | ||
} | ||
|
||
responseHook(response: NormalizedResponse, span: Span, tracer: Tracer, config: AwsSdkInstrumentationConfig): void { | ||
const secretArn = response.data.ARN; | ||
|
||
if (secretArn) { | ||
span.setAttribute(AWS_ATTRIBUTE_KEYS.AWS_SECRETSMANAGER_SECRET_ARN, secretArn); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
aws-distro-opentelemetry-node-autoinstrumentation/src/patches/aws/services/step-functions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Attributes, SpanKind } from '@opentelemetry/api'; | ||
import { AwsSdkInstrumentationConfig, NormalizedRequest } from '@opentelemetry/instrumentation-aws-sdk'; | ||
import { AWS_ATTRIBUTE_KEYS } from '../../../aws-attribute-keys'; | ||
import { RequestMetadata, ServiceExtension } from '../../../third-party/otel/aws/services/ServiceExtension'; | ||
|
||
export class StepFunctionsServiceExtension implements ServiceExtension { | ||
requestPreSpanHook(request: NormalizedRequest, _config: AwsSdkInstrumentationConfig): RequestMetadata { | ||
const stateMachineArn = request.commandInput?.stateMachineArn; | ||
const activityArn = request.commandInput?.activityArn; | ||
|
||
const spanKind: SpanKind = SpanKind.CLIENT; | ||
let spanName: string | undefined; | ||
|
||
const spanAttributes: Attributes = {}; | ||
|
||
if (stateMachineArn) { | ||
spanAttributes[AWS_ATTRIBUTE_KEYS.AWS_STEPFUNCTIONS_STATEMACHINE_ARN] = stateMachineArn; | ||
} | ||
|
||
if (activityArn) { | ||
spanAttributes[AWS_ATTRIBUTE_KEYS.AWS_STEPFUNCTIONS_ACTIVITY_ARN] = activityArn; | ||
} | ||
|
||
const isIncoming = false; | ||
|
||
return { | ||
isIncoming, | ||
spanAttributes, | ||
spanKind, | ||
spanName, | ||
}; | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.