Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
marcsanmi committed Dec 12, 2024
1 parent d1033c0 commit 6b80f3d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ Refer to the [data source configuration documentation](https://grafana.com/docs/

## Examples

Check out the [examples](https://github.com/grafana/pyroscope/tree/main/examples/tracing/tempo) directory for a complete demo application of span profiles in multiple languages.
Check out these demo applications for span profiles:
- [Python example](https://github.com/grafana/pyroscope/tree/main/examples/tracing/tempo/python)
- [Other examples](https://github.com/grafana/pyroscope/tree/main/examples/tracing/tempo) in multiple languages
7 changes: 2 additions & 5 deletions examples/tracing/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The docker compose consists of:
- Pyroscope for continuous profiling
- Grafana for visualization
- Load Generator for simulating traffic

For a detailed guide about Python span profiles configuration, refer to the docs [Pyroscope documentation](https://grafana.com/docs/pyroscope/latest/configure-client/trace-span-profiles/python-span-profiles/).

The `rideshare` app generates traces and profiling data that should be available in Grafana.
Pyroscope and Tempo datasources are provisioned automatically.
Expand Down Expand Up @@ -35,11 +37,6 @@ Please note that presence of the attribute does not necessarily
indicate that the span has a profile: stack trace samples might not be collected, if the utilized CPU time is
less than the sample interval (10ms).

### Instrumentation

- `rideshare` demo application instrumented with OpenTelemetry: [OTel integration](https://github.com/grafana/otel-profiling-python)
- `pyroscope` itself is instrumented with opentracing-go SDK and [spanprofiler](https://github.com/grafana/dskit/tree/main/spanprofiler) for profiling integration.

### Grafana Tempo configuration

In order to correlate trace spans with profiling data, the Tempo datasource should have the following configured:
Expand Down
24 changes: 12 additions & 12 deletions examples/tracing/python/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
ports:
- "4040:4040"

rideshare-python-us-east:
us-east:
ports:
- "5000"
hostname: rideshare-python-us-east
hostname: us-east
environment: &env
OTLP_URL: tempo:4318
OTLP_INSECURE: 1
Expand All @@ -18,32 +18,32 @@ services:
OTEL_METRICS_EXPORTER: none
OTEL_TRACES_SAMPLER: always_on
OTEL_PROPAGATORS: tracecontext
PYROSCOPE_LABELS: hostname=rideshare-python-us-east
PYROSCOPE_LABELS: hostname=us-east
REGION: us-east
PYROSCOPE_SERVER_ADDRESS: http://pyroscope:4040
PYTHONUNBUFFERED: 1 # Python-specific: Ensures logging output isn't buffered
build:
context: .

rideshare-python-eu-north:
eu-north:
ports:
- "5000"
hostname: rideshare-python-eu-north
hostname: eu-north
environment:
<<: *env
REGION: eu-north
PYROSCOPE_LABELS: hostname=rideshare-python-eu-north
PYROSCOPE_LABELS: hostname=eu-north
build:
context: .

rideshare-python-ap-south:
ap-south:
ports:
- "5000"
hostname: rideshare-python-ap-south
hostname: ap-south
environment:
<<: *env
REGION: ap-south
PYROSCOPE_LABELS: hostname=rideshare-python-ap-south
PYROSCOPE_LABELS: hostname=ap-south
build:
context: .

Expand All @@ -54,9 +54,9 @@ services:
dockerfile: Dockerfile.load-generator
command:
- ./loadgen
- http://rideshare-python-ap-south:5000
- http://rideshare-python-eu-north:5000
- http://rideshare-python-us-east:5000
- http://ap-south:5000
- http://eu-north:5000
- http://us-east:5000

grafana:
image: grafana/grafana:latest
Expand Down

0 comments on commit 6b80f3d

Please sign in to comment.