# TracingConfig

The tracing mode of an Amazon SNS topic.

- Source: [`aws-sns/lib/topic.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-sns/lib/topic.ts#L208)
- Type last changed: v2.138.0 · 18 Apr 2024

## Example

TypeScript:

```ts
const topic = new sns.Topic(this, 'MyTopic', {
  tracingConfig: sns.TracingConfig.ACTIVE,
});
```

Python:

```python
topic = sns.Topic(self, "MyTopic",
    tracing_config=sns.TracingConfig.ACTIVE
)
```

Java:

```java
Topic topic = Topic.Builder.create(this, "MyTopic")
        .tracingConfig(TracingConfig.ACTIVE)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var topic = new Topic(this, "MyTopic", new TopicProps {
    TracingConfig = TracingConfig.ACTIVE
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
topic := sns.NewTopic(this, jsii.String("MyTopic"), &TopicProps{
	TracingConfig: sns.TracingConfig_ACTIVE,
})
```

## Members

| Member | Description |
| --- | --- |
| `PASS_THROUGH` | The mode that topic passes trace headers received from the Amazon SNS publisher to its subscription. |
| `ACTIVE` | The mode that Amazon SNS vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. |

## Referenced by

- [`TopicProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sns.TopicProps.html).tracingConfig
