Skip to content

Commit

Permalink
[release-v2.4] Outdated documentation setting up a test app (#3533)
Browse files Browse the repository at this point in the history
* Outdated documentation setting up a test app (#3511)

* Update test app documentation

* update numbers

* Update docs/sources/tempo/setup/set-up-test-app.md

Co-authored-by: Joe Elliott <joe.elliott@grafana.com>

* Apply suggestions from code review

* Update docs/sources/tempo/setup/set-up-test-app.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

---------

Co-authored-by: Joe Elliott <joe.elliott@grafana.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
(cherry picked from commit 9dd51d9)

* Update docs/sources/tempo/setup/set-up-test-app.md

---------

Co-authored-by: ausias-armesto <ausiasarmesto@gmail.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 2, 2024
1 parent 48b2e51 commit 7333160
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions docs/sources/tempo/setup/set-up-test-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,54 @@ Replace these appropriately if you have altered the endpoint targets for the fol
1. Install `telemetrygen` using the [installation procedure](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/cmd/telemetrygen).
**NOTE**: You don't need to configure an OpenTelemetry Collector as we are using the Grafana Agent.

1. Generate traces using `telemtrygen`:
2. Generate traces using `telemetrygen`:
```bash
telemetrygen traces --otlp-insecure --rate 20 --duration 5s grafana-agent.grafana-agent.svc.cluster.local:4317
telemetrygen traces --otlp-insecure --rate 20 --duration 5s --otlp-endpoint grafana-agent.grafana-agent.svc.cluster.local:4317
```
This configuration sends traces to Grafana Agent for 5 seconds, at a rate of 20 traces per second.

Optionally, you can also send the trace directly to the Tempo database without using Grafana Agent as a collector by using the following:
```bash
telemetrygen traces --otlp-insecure --rate 20 --duration 5s tempo-cluster-distributor.tempo.svc.cluster.local:4317
telemetrygen traces --otlp-insecure --rate 20 --duration 5s --otlp-endpoint tempo-cluster-distributor.tempo.svc.cluster.local:4317
```

If you're running `telemetrygen` on your local machine, ensure that you first port-forward to the relevant Agent or Tempo distributor service, eg:
```bash
kubectl port-forward services/grafana-agent 4317:4317 --namespace grafana-agent
If you're running `telemetrygen` on your local machine, ensure that you first port-forward to the relevant Agent or Tempo distributor service, for example:
```bash
kubectl port-forward services/grafana-agent 4317:4317 --namespace grafana-agent
```
3. Alternatively, a cronjob can be created to send traces periodically based on this template:

```
apiVersion: batch/v1
kind: CronJob
metadata:
name: sample-traces
spec:
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 2
schedule: "0 * * * *"
jobTemplate:
spec:
backoffLimit: 0
ttlSecondsAfterFinished: 3600
template:
spec:
containers:
- name: traces
image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.96.0
args:
- traces
- --otlp-insecure
- --rate
- "20"
- --duration
- 5s
- --otlp-endpoint
- grafana-agent.grafana-agent.svc.cluster.local:4317
restartPolicy: Never
```


To view the tracing data:

Expand Down

0 comments on commit 7333160

Please sign in to comment.