Skip to content

Commit edc42e0

Browse files
committed
last changes to routing
1 parent 9348e8d commit edc42e0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

content/en/ninja-workshops/10-advanced-otel/80-routing/8-1-routing-test.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,23 @@ Make sure the are **NO** `*.out` files in the `[WORKSHOP]/8-routing` folder.
104104

105105
- **Send a Regular Span**:
106106
Find your `Test` terminal window and navigate to the `[WORKSHOP]/8-routing` folder. From there, send a regular span using the `trace.json` file to confirm that communication is functioning as expected.
107-
Both the `agent` and `gateway` should display debug information, including the span you just sent. Additionally, the gateway should generate a new `./gateway-traces-default.out` file, as this is now the destination for regular spans.
107+
Both the `agent` and `gateway` should display debug information, including the span you just sent. Additionally, the gateway should generate a new `gateway-traces-default.out` file, as this is now the destination for regular spans.
108108

109109
{{% notice title="Tip" style="primary" icon="lightbulb" %}}
110-
If you verify the `./gateway-traces-default.out` is should contain the span we send with the cURL command.
110+
If you check `gateway-traces-default.out`, it should contain the `span` sent using the `cURL` command. You will also see an empty `gateway-traces-security.out` file, as the routing configuration creates output files immediately, even if no matching spans have been processed yet.
111111
{{% /notice %}}
112112

113113
- **Send a Security Span**:
114114
Make sure both the `agent` and `gateway` are running, then send a security span using the `security.json` file to test the routing rule in the gateway.
115-
Both the `agent` and `gateway` should display debug information, including the span you just sent. Additionally, the gateway should generate a new `./gateway-traces-security.out` file, as this is the destination for spans where the `deployment.environment` resourceSpan attribute matches `"security_applications"`.
115+
Both the `agent` and `gateway` should display debug information, including the span you just sent. Additionally, the gateway should write a line to the `gateway-traces-security.out` file, as this is the destination for spans where the `deployment.environment` resourceSpan attribute matches `"security_applications"`.
116116

117117
{{% notice title="Tip" style="primary" icon="lightbulb" %}}
118118
If you verify the `./gateway-traces-security.out` is should only contain the spans from the `"security_applications"` deployment.environment.
119119
{{% /notice %}}
120120

121+
You can repeat this scenario multiple times, and each trace should be written to its corresponding output file.
122+
123+
121124
{{% /notice %}}
122125

123126
### Conclusion

content/en/ninja-workshops/10-advanced-otel/80-routing/_index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ To enable routing we need to define two pipelines for traces:
9393
receivers: [routing] # Only receives spans from the routing connector
9494
processors:
9595
- memory_limiter
96-
- batch
9796
- resource/add_mode
9897
exporters: [file/traces/standard] # Location for spans not matching rule
9998
```
@@ -108,11 +107,11 @@ To enable routing we need to define two pipelines for traces:
108107
receivers: [routing] # Only receives spans from the routing connector
109108
processors:
110109
- memory_limiter
111-
- batch
112110
- resource/add_mode
113111
exporters: [file/traces/security] # Location for spans matching rule
114112
#metrics:
115113
```
114+
116115

117116
- **Update the `traces` pipeline to handle routing**:
118117
To enable `routing`, you need to update the original `traces` pipeline by adding `routing` as an exporter. This will send your span data through the `routing connector` for evaluation.
@@ -127,6 +126,8 @@ To enable `routing`, you need to update the original `traces` pipeline by adding
127126
{{% notice title="Tip" style="primary" icon="lightbulb" %}}
128127

129128
Keep in mind that any existing processors have been removed from this pipeline. They are now handled by either the standard pipeline or the target pipelines, depending on the routing rules.
129+
130+
Additionally, the `batch` processor has been removed from the new pipelines. This ensures that `spans` are written immediately, rather than waiting for multiple spans to arrive before processing. This change speeds up the workshop and allows you to see results faster.
130131
{{% /notice %}}
131132

132133
{{% /notice %}}

0 commit comments

Comments
 (0)