Local Dev Environment
Set up a Scout collector locally for development and testing purposes. It includes:
- Scout Collector: For collecting, processing, and exporting telemetry data to Scout Backend
This environment allows you to:
- Process logs, metrics, and traces through the Scout Collector
- Test your instrumentation code locally before deploying to production
Requirements​
- Docker Installed.
Scout Collector config​
Copy the below content to otel-collector-config.yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
debug:
verbosity: detailed
otlphttp/b14:
endpoint: ${SCOUT_ENDPOINT}
auth:
authenticator: oauth2client
tls:
insecure_skip_verify: true
compression: gzip
processors:
resource/env:
attributes:
- key: environment
value: development
action: upsert
extensions:
oauth2client:
client_id: ${SCOUT_CLIENT_ID}
client_secret: ${SCOUT_CLIENT_SECRET}
endpoint_params:
audience: b14collector
token_url: ${SCOUT_TOKEN_URL}
tls:
insecure_skip_verify: true
service:
extensions: [oauth2client]
pipelines:
traces:
receivers: [otlp]
processors: [resource/env]
exporters: [otlphttp/b14]
metrics:
receivers: [otlp]
processors: [resource/env]
exporters: [otlphttp/b14]
logs:
receivers: [otlp]
processors: [resource/env]
exporters: [otlphttp/b14]
Replace the placeholders with your Scout credentials. For Adding Receiver, Processor, Exporter, and Service Extensions, please refer to Scout Collector Configuration
Start the Containers​
- Using Docker Compose
- Using Docker Run
Create a Docker compose file compose.yml
version: "3.8"
services:
otel-collector:
image: otel/opentelemetry-collector-contrib:0.130.0
container_name: otel-collector
restart: unless-stopped
command: ["--config=/etc/otelcol/config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otelcol/config.yaml
ports:
- "4317:4317"
- "4318:4318"
Run the below command to start the local development setup
docker-compose up -d
Run the below command to start the local development setup
docker run -d \
--name otel-collector \
--restart unless-stopped \
-p 4317:4317 \
-p 4318:4318 \
-v $(pwd)/otel-collector-config.yaml:/etc/otelcol/config.yaml \
otel/opentelemetry-collector-contrib:0.130.0 \
--config=/etc/otelcol/config.yaml
That's it! Navigate to Scout Grafana dashboards to visualize the data.
Related Guides​
- Docker Compose Setup - Complete Docker Compose example with Grafana
- Scout Exporter Configuration - Authentication and endpoint configuration
- Express.js Instrumentation - Test with a sample application
Was this page helpful?