Skip to content

Commit

Permalink
Push Pyroscope profiles instead of scraping them
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewslotin committed Jul 5, 2024
1 parent 300f12b commit e0e562e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 40 deletions.
13 changes: 0 additions & 13 deletions contrib/agent-cloud.river
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,6 @@ prometheus.scrape "default" {
]
}

pyroscope.scrape "scrape_profiles" {
targets = [
{
"__address__" = env("QUICKPIZZA_HOST"),
"service_name" = "quickpizza",
"instance" = "local",
},
]
forward_to = [
module.git.grafana_cloud.exports.profiles_receiver,
]
}

discovery.docker "all_containers" {
host = "unix:///var/run/docker.sock"
}
Expand Down
20 changes: 0 additions & 20 deletions contrib/agent-local.river
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,6 @@ prometheus.remote_write "default" {
}
}

pyroscope.scrape "scrape_profiles" {
targets = [
{
"__address__" = env("QUICKPIZZA_HOST"),
"service_name" = "quickpizza",
"instance" = "local",
},
]
forward_to = [
pyroscope.write.default.receiver,
]
}

pyroscope.write "default" {
endpoint {
// TODO: Replace this with your pyroscpoe instance endpoint
url = env("PROFILES_ENDPOINT")
}
}

discovery.docker "all_containers" {
host = "unix:///var/run/docker.sock"
}
Expand Down
14 changes: 7 additions & 7 deletions docker-compose-local.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

version: '3.8'
version: "3.8"

services:
quickpizza:
Expand All @@ -11,6 +10,7 @@ services:
environment:
QUICKPIZZA_OTLP_ENDPOINT: http://agent:4318
QUICKPIZZA_TRUST_CLIENT_TRACEID: 1
QUICKPIZZA_PYROSCOPE_ADDR: http://pyroscope:4040

loki:
image: grafana/loki:2.8.3
Expand All @@ -34,10 +34,10 @@ services:
tempo:
image: grafana/tempo:2.1.0
command:
- "-storage.trace.backend=local" # tell tempo where to permanently put traces
- "-storage.trace.backend=local" # tell tempo where to permanently put traces
- "-storage.trace.local.path=/tmp/tempo/traces"
- "-storage.trace.wal.path=/tmp/tempo/wal" # tell tempo where to store the wal
- "-auth.enabled=false" # disables the requirement for the X-Scope-OrgID header
- "-storage.trace.wal.path=/tmp/tempo/wal" # tell tempo where to store the wal
- "-auth.enabled=false" # disables the requirement for the X-Scope-OrgID header
- "-server.http-listen-port=3200"
ports:
- "3200:3200"
Expand All @@ -60,7 +60,8 @@ services:
volumes:
- "./contrib/agent-local.river:/grafana-agent.river:Z"
- "${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock"
command: ["run", "/grafana-agent.river", "--server.http.listen-addr=0.0.0.0:12345"]
command:
["run", "/grafana-agent.river", "--server.http.listen-addr=0.0.0.0:12345"]
ports:
- "12345:12345"
environment:
Expand All @@ -69,7 +70,6 @@ services:
METRICS_ENDPOINT: http://prometheus:9090/api/v1/write
TRACES_ENDPOINT: http://tempo:4317
LOGS_ENDPOINT: http://loki:3100/loki/api/v1/push
PROFILES_ENDPOINT: http://pyroscope:4040
depends_on:
- prometheus
- quickpizza
Expand Down

0 comments on commit e0e562e

Please sign in to comment.