Skip to content

Commit d525af9

Browse files
committed
Moved permissions setup steps into setup script
1 parent c8221a9 commit d525af9

File tree

2 files changed

+109
-2
lines changed

2 files changed

+109
-2
lines changed

content/en/conf/1-advanced-collector/prerequisites.md

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ curl -L https://github.com/splunk/observability-workshop/raw/refs/heads/main/wor
3636
curl -L https://github.com/splunk/observability-workshop/raw/refs/heads/main/workshop/ninja/advanced-otel/setup-workshop.sh -o setup-workshop.sh
3737
```
3838

39+
<!--
3940
{{% notice style="warning" title="macOS Users" icon="desktop" %}}
4041
Before running the binaries on macOS, you need to remove the quarantine attribute that macOS applies to downloaded files. This step ensures they can execute without restrictions.
4142
@@ -47,10 +48,11 @@ xattr -dr com.apple.quarantine loadgen
4748
```
4849
4950
{{% /notice %}}
50-
51+
-->
5152
{{% /tab %}}
5253
{{% /tabs %}}
5354

55+
<!--
5456
**Update file permissions**: Once downloaded, update the file permissions to make all files executable:
5557
5658
```bash
@@ -59,8 +61,89 @@ chmod +x otelcol loadgen setup-workshop.sh && \
5961
./loadgen --help && \
6062
./setup-workshop.sh
6163
```
64+
-->
65+
66+
Run the `setup-workshop.sh` script which will configure the correct permissions and also create the initial configurations for the **Agent** and the **Gateway**.
67+
68+
{{% tabs %}}
69+
{{% tab title="Setup Workshop" %}}
70+
71+
```bash
72+
sh setup-workshop.sh
73+
```
74+
75+
{{% /tab %}}
76+
{{% tab title="Verify Setup" %}}
77+
78+
```text
79+
███████╗██████╗ ██╗ ██╗ ██╗███╗ ██╗██╗ ██╗ ██╗
80+
██╔════╝██╔══██╗██║ ██║ ██║████╗ ██║██║ ██╔╝ ╚██╗
81+
███████╗██████╔╝██║ ██║ ██║██╔██╗ ██║█████╔╝ ╚██╗
82+
╚════██║██╔═══╝ ██║ ██║ ██║██║╚██╗██║██╔═██╗ ██╔╝
83+
███████║██║ ███████╗╚██████╔╝██║ ╚████║██║ ██╗ ██╔╝
84+
╚══════╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝
85+
86+
Welcome to the Splunk Advanced OpenTelemetry Workshop!
87+
======================================================
88+
89+
macOS detected. Removing quarantine attributes...
90+
otelcol version v0.126.0
91+
Usage: loadgen [OPTIONS]
92+
Options:
93+
-base Send base traces (enabled by default)
94+
-health Send health traces
95+
-security Send security traces
96+
-logs Enable logging of random quotes to quotes.log
97+
-json Output logs in JSON format (only applicable with -logs)
98+
-count Number of traces or logs to send (default: infinite)
99+
-h, --help Display this help message
100+
101+
Example:
102+
loadgen -health -security -count 10 Send 10 health and security traces
103+
loadgen -logs -json -count 5 Write 5 random quotes in JSON format to quotes.log
104+
Creating workshop directories...
105+
✓ Created subdirectories:
106+
├── 1-agent-gateway
107+
├── 2-building-resilience
108+
├── 3-dropping-spans
109+
├── 4-sensitive-data
110+
├── 5-transform-data
111+
└── 6-routing-data
112+
113+
Creating configuration files for 1-agent-gateway...
114+
Creating OpenTelemetry Collector agent configuration file: 1-agent-gateway/agent.yaml
115+
✓ Configuration file created successfully: 1-agent-gateway/agent.yaml
116+
✓ File size: 4355 bytes
117+
118+
Creating OpenTelemetry Collector gateway configuration file: 1-agent-gateway/gateway.yaml
119+
✓ Configuration file created successfully: 1-agent-gateway/gateway.yaml
120+
✓ File size: 3376 bytes
121+
122+
✓ Completed configuration files for 1-agent-gateway
123+
124+
Creating configuration files for 2-building-resilience...
125+
Creating OpenTelemetry Collector agent configuration file: 2-building-resilience/agent.yaml
126+
✓ Configuration file created successfully: 2-building-resilience/agent.yaml
127+
✓ File size: 4355 bytes
128+
129+
Creating OpenTelemetry Collector gateway configuration file: 2-building-resilience/gateway.yaml
130+
✓ Configuration file created successfully: 2-building-resilience/gateway.yaml
131+
✓ File size: 3376 bytes
132+
133+
✓ Completed configuration files for 2-building-resilience
134+
135+
Workshop environment setup complete!
136+
Configuration files created in the following directories:
137+
1-agent-gateway/
138+
├── agent.yaml
139+
└── gateway.yaml
140+
2-building-resilience/
141+
├── agent.yaml
142+
└── gateway.yaml
143+
```
62144

63-
The `setup-workshop.sh` script will create the necessary directories and generate the initial configuration files for the **Agent** and the **Gateway**.
145+
{{% /tab %}}
146+
{{% /tabs %}}
64147

65148
```text { title="Initial Directory Structure" }
66149
[WORKSHOP]

workshop/ninja/advanced-otel/setup-workshop.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ echo "Welcome to the Splunk Advanced OpenTelemetry Workshop!"
1515
echo "======================================================"
1616
echo ""
1717

18+
# Function to run common commands
19+
run_commands() {
20+
chmod +x otelcol loadgen && \
21+
./otelcol -v && \
22+
./loadgen --help
23+
}
24+
25+
# Platform-specific setup
26+
case "$OSTYPE" in
27+
darwin*)
28+
echo "macOS detected. Removing quarantine attributes..."
29+
xattr -dr com.apple.quarantine otelcol loadgen 2>/dev/null
30+
run_commands
31+
;;
32+
linux-gnu*)
33+
echo "Linux detected."
34+
run_commands
35+
;;
36+
*)
37+
echo "Unsupported platform ($OSTYPE). This script only works on macOS and Linux."
38+
exit 1
39+
;;
40+
esac
41+
1842
# Create workshop directories
1943
echo "Creating workshop directories..."
2044

0 commit comments

Comments
 (0)