Loading...
Loading...
Configure the OpenTelemetry Collector with Sentry Exporter for multi-project routing and automatic project creation. Use when setting up OTel with Sentry, configuring collector pipelines for traces and logs, or routing telemetry from multiple services to Sentry projects.
npx skill4agent add jaffrepaul/agent-skills sentry-otel-exporter-setupQuestion: "How do you want to run the OpenTelemetry Collector?"
Header: "Collector"
Options:
- label: "Binary"
description: "Download from GitHub releases. No Docker required."
- label: "Docker"
description: "Run as a container. Requires Docker installed."uname -suname -mdarwin_arm64darwin_amd64linux_amd64linux_arm64curl -LO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.145.0/otelcol-contrib_0.145.0_<os>_<arch>.tar.gz
tar -xzf otelcol-contrib_0.145.0_<os>_<arch>.tar.gz
chmod +x otelcol-contribdocker --versiondocker pull otel/opentelemetry-collector-contrib:0.145.0docker runQuestion: "Do you want Sentry to automatically create projects when telemetry arrives?"
Header: "Auto-create"
Options:
- label: "Yes"
description: "Projects created from service.name. Requires at least one team in your Sentry org. All new projects are assigned to the first team found. Initial data may be dropped during creation."
- label: "No"
description: "Projects must exist in Sentry before telemetry arrives."collector-config.yamlreceivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
sentry:
url: https://sentry.io
org_slug: ${env:SENTRY_ORG_SLUG}
auth_token: ${env:SENTRY_AUTH_TOKEN}
processors:
batch:
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [sentry]
logs:
receivers: [otlp]
processors: [batch]
exporters: [sentry]auto_create_projects: trueexporters:
sentry:
# ... existing config
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [sentry, debug] # Add debug here
logs:
receivers: [otlp]
processors: [batch]
exporters: [sentry, debug] # Add debug heredebugrouting.attribute_to_project_mappingservice.nameauto_create_projects.env**/.envQuestion: "Where should I add the Sentry credentials?"
Header: "Env file"
Options:
- label: "<path/to/.env>" # One option per discovered .env file
description: "Add to existing file"
- label: "Create new at root"
description: "Create .env in project root"SENTRY_ORG_SLUG=your-org-slug
SENTRY_AUTH_TOKEN=your-token-heresentry.io/organizations/{slug}/.env.gitignore./otelcol-contrib --config collector-config.yamldocker run -d \
--name otel-collector \
-p 4317:4317 \
-p 4318:4318 \
-p 13133:13133 \
-v $(pwd)/collector-config.yaml:/etc/otelcol-contrib/config.yaml \
--env-file .env \
otel/opentelemetry-collector-contrib:0.145.0