# ShadowTraffic

A video walkthrough can be found below:

{% embed url="<https://youtu.be/xHIk8p9Mp2Y>" %}

## Prerequisites

This guide does not instruct you on using ShadowTraffic; please refer to their [docs](https://docs.shadowtraffic.io/connections/kafka/) for details. You'll need:

1. WarpStream account - get access to WarpStream by registering [here](https://console.warpstream.com/signup).
2. WarpStream cluster up and running.
3. A ShadowTraffic [account](https://shadowtraffic.io/pricing.html).

## Step 1: Retrieve the WarpStream Bootstrap Broker URL and SASL credentials

Obtain the Bootstrap Broker from the WarpStream console by navigating to your cluster and clicking the Connect tab. If you don't have SASL credentials, you can also [create a set of credentials](https://docs.warpstream.com/warpstream/configuration/enable-agent-auth#sasl-authentication) from the console.

Save these values as you will need them in the next step:

```sh
export BOOTSTRAP_HOST=<YOUR_BOOTSTRAP_BROKER> \
SASL_USERNAME=<YOUR_SASL_USERNAME> \
SASL_PASSWORD=<YOUR_SASL_PASSWORD>;
```

## Step 2: Configure ShadowTraffic JSON

Open the following file with your favorite editor and with the required permissions to edit it:

```json
{
  "generators" : [ {
    "topic" : "<YOUR_TOPIC>",
    "value" : {
      "customerId" : {
        "_gen" : "uuid"
      },
```

Next, set up your credentials in the `connections` section of the JSON, as noted below:

```json
  "connections" : {
    "warpstream" : {
      "kind" : "kafka",
      "producerConfigs" : {
        "bootstrap.servers" : "<YOUR_BOOTSTRAP_BROKER>",
        "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username='<YOUR_SASL_USERNAME>' password='<YOUR_SASL_PASSWORD>';",
        "value.serializer": "io.shadowtraffic.kafka.serdes.JsonSerializer",
        "key.serializer": "io.shadowtraffic.kafka.serdes.JsonSerializer",
        "sasl.mechanism": "PLAIN",
        "security.protocol": "SASL_SSL"
      }
    }
  }
```

Save the JSON file.

## Step 3: Run ShadowTraffic

With your ShadowTraffic JSON configured, you can now produce your sample data to WarpStream. Follow the ShadowTraffic instructions, but the command will be something like this:

```sh
docker run   --env-file license.env   -v $(pwd)/parade.json:/home/<YOUR_JSON>.json   shadowtraffic/shadowtraffic:latest   --config /home/config.json   --watch
```

## Next steps

ShadowTraffic can now produce data to topics in your WarpStream cluster.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.warpstream.com/warpstream/reference/integrations/shadowtraffic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
