Skip to main content

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​

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​

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

That's it! Navigate to Scout Grafana dashboards to visualize the data.

Was this page helpful?