Skip to content

Commit

Permalink
feat(api)!: make asAspect private, remove documentation
Browse files Browse the repository at this point in the history
Turn Lumigo.asAspect as private, as it cannot set the `lumigo:auto-trace` tags correctly: tags in CDK are themselves an aspect, and an aspect cannot call another.

BREAKING CHANGE: Lumigo.asAspect is now a private function.
  • Loading branch information
CircleCI committed Dec 8, 2022
1 parent 90e77b5 commit 5eec375
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
13 changes: 0 additions & 13 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,6 @@ new Lumigo({lumigoToken:SecretValue.secretsManager('LumigoToken')}).traceEveryth
app.synth();
```

The `Lumigo.traceEverything` functionality is built using CDK [Aspects](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Aspects.html), which can also be used directly as follows:

```typescript
import { Lumigo } from '@lumigo/cdk-constructs-v2';
import { App, Aspects, SecretValue } from 'aws-cdk-lib';

const app = new App();

// Add here stacks and constructs

Aspects.of(app).add(new Lumigo({lumigoToken:SecretValue.secretsManager('LumigoToken')}).asAspect());

app.synth();
```

### Instrumenting a CDK stack

The following code will apply Lumigo autotracing to all the [supported constructs](#supported-constructs) in the instrumented stack:
Expand Down
2 changes: 1 addition & 1 deletion src/lumigo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class Lumigo {
Aspects.of(root).add(this.asAspect(props));
}

public asAspect(props: LumigoAspectProps = {
private asAspect(props: LumigoAspectProps = {
lambdaEnableW3CTraceContext: false,
}): IAspect {
const lumigo = this;
Expand Down

0 comments on commit 5eec375

Please sign in to comment.