Skip to content

Commit aef4046

Browse files
authored
Cleanup tracing docs (#861)
Fixing broken links and spelling <!-- Explain the changes introduced in your PR --> ## Pull Request approval You will need to get your PR approved by at least one member of the Sourcegraph team. For reviews of docs formatting, styles, and component usage, please tag the docs team via the #docs Slack channel.
1 parent eca7a30 commit aef4046

File tree

6 files changed

+42
-37
lines changed

6 files changed

+42
-37
lines changed

docs/admin/deploy/kubernetes/azure.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Sourcegraph with Kubernetes on Azure
22

33
> WARNING: This guide applies exclusively to a Kubernetes deployment **without** Helm.
4-
> If you have not deployed Sourcegraph yet, it is higly recommended to use Helm as it simplifies the configuration and greatly simplifies the later upgrade process. See our guidance on [using Helm to deploy to Azure AKS](/admin/deploy/kubernetes#configure-sourcegraph-on-azure-managed-kubernetes-service-aks).
4+
> If you have not deployed Sourcegraph yet, it is highly recommended to use Helm as it simplifies the configuration and greatly simplifies the later upgrade process. See our guidance on [using Helm to deploy to Azure AKS](/admin/deploy/kubernetes#configure-sourcegraph-on-azure-managed-kubernetes-service-aks).
55
66
Install the [Azure CLI tool](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and log in:
77

@@ -63,5 +63,5 @@ az aks browse --resource-group sourcegraphResourceGroup --name sourcegraphCluste
6363
Set up a load balancer to make the main web server accessible over the network to external users:
6464

6565
```
66-
kubectl expose deployment sourcegraph-frontend --type=LoadBalancer --name=sourcegraphloadbalancer --port=80 --target-port=3080
66+
kubectl expose deployment sourcegraph-frontend --type=LoadBalancer --name=sourcegraph-load-balancer --port=80 --target-port=3080
6767
```

docs/admin/deploy/kubernetes/configure.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ Sourcegraph will clone repositories using SSH credentials when the `id_rsa` and
11371137

11381138
To mount the files through Kustomize:
11391139

1140-
**Step 1:** Copy the required files to the `configs` folder at the same level as your overylay's kustomization.yaml file
1140+
**Step 1:** Copy the required files to the `configs` folder at the same level as your overlay's kustomization.yaml file
11411141

11421142
**Step 2:** Include the following in your overlay to [generate secrets](https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kustomize/) that base64 encoded the values in those files
11431143

docs/admin/deploy/kubernetes/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ Although not recommended, credentials can also be configured directly in the hel
156156

157157
```yaml
158158
pgsql:
159-
enabled: false # disable internal pgsql database
159+
enabled: false # Disable internal pgsql database
160160
auth:
161-
database: "customdb"
162-
host: pgsql.database.company.com # external pgsql host
163-
user: "newuser"
164-
password: "newpassword"
161+
database: "custom-db"
162+
host: pgsql.database.company.com # External pgsql host
163+
user: "new-user"
164+
password: "new-password"
165165
port: "5432"
166166
```
167167

docs/admin/deploy/kubernetes/kustomize.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ A storage class must be created and configured before deploying Sourcegraph. SSD
8585
8686
#### Option 1: Create a new storage class
8787
88-
We recommend using a preconfigured storage class component for your cloud provider if you can create cluster-wide resources:
88+
We recommend using a pre-configured storage class component for your cloud provider if you can create cluster-wide resources:
8989
9090
```yaml
9191
# instances/my-sourcegraph/kustomization.yaml

docs/admin/observability/opentelemetry.mdx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Sourcegraph's bundled otel-collector is deployed via Docker image, and is config
1616

1717
For details on how to deploy the otel-collector, and where to find its configuration file, refer to the docs page specific to your deployment type:
1818

19-
- [Kubernetes via Helm](/admin/deploy/kubernetes#opentelemetry-collector)
20-
- [Kubernetes via Kustomize](/admin/deploy/kubernetes/configure#tracing)
21-
- [Docker Compose](/admin/deploy/docker-compose/operations#opentelemetry-collector)
19+
- [Kubernetes with Helm](/admin/deploy/kubernetes#configure-opentelemetry-collector-to-use-an-external-tracing-backend)
20+
- [Kubernetes with Kustomize](/admin/deploy/kubernetes/configure#deploy-opentelemetry-collector-to-use-an-external-tracing-backend)
21+
- [Docker Compose](/admin/deploy/docker-compose/configuration#configure-an-external-tracing-backend)
2222

2323
## HTTP Tracing Backends
2424

@@ -61,7 +61,7 @@ service:
6161
6262
## Sampling traces
6363
64-
To reduce the volume of traces exported, the collector can be configured to apply sampling. Sourcegraph includes the [probabilistic](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/probabilisticsamplerprocessor) and [tail](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/README) samplers in the bundled collector.
64+
To reduce the volume of traces exported, the collector can be configured to apply sampling. Sourcegraph includes the [probabilistic](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/probabilisticsamplerprocessor) and [tail](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/README.md) samplers in the bundled collector.
6565
6666
> NOTE: If sampling is enabled, the sampling mechanism will be applied to all traces, regardless if a request was explicitly requested to be traced.
6767
@@ -90,7 +90,7 @@ service:
9090

9191
### Tail sampling
9292

93-
The tail sampler samples traces according to policies and the sampling decision of whether a trace should be sampled is determined at the _tail end_ of a pipeline. For more information on the supported policies and other configuration options of the sampler see [tail sampler configuration](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/README).
93+
The tail sampler samples traces according to policies and the sampling decision of whether a trace should be sampled is determined at the _tail end_ of a pipeline. For more information on the supported policies and other configuration options of the sampler see [tail sampler configuration](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/README.md).
9494

9595
The sampler waits for a certain amount of spans before making applying the configured policy. Due to it keeping a certain amount of spans in memory, the sampler incurs as slight performance cost compared to the probabilistic sampler.
9696

@@ -121,7 +121,7 @@ processors:
121121
},
122122
{
123123
# Only keep 10% of the traces.
124-
name: policy-probalistic,
124+
name: policy-probabilistic,
125125
type: probabilistic,
126126
probabilistic: {sampling_percentage: 10}
127127
}
@@ -136,7 +136,7 @@ service:
136136
137137
## Filtering traces
138138
139-
The bundled otel-collector also includes the [filter processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/filterprocessor/README). The following example only allows traces with the service name "foobar". All other traces will be dropped.
139+
The bundled otel-collector also includes the [filter processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/filterprocessor/README.md). The following example only allows traces with the service name "foobar". All other traces will be dropped.
140140
141141
```yaml
142142
exporters:
@@ -170,7 +170,7 @@ This section outlines some common exporter configurations. For details, see Open
170170
171171
### OTLP-compatible backends
172172
173-
Backends compatible with the [OpenTelemetry Protocol (OTLP)](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp) include services such as:
173+
Backends compatible with the [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp/) include services such as:
174174
175175
- [Honeycomb](https://docs.honeycomb.io/getting-data-in/opentelemetry-overview/)
176176
- [Grafana Tempo](https://grafana.com/blog/2021/04/13/how-to-send-traces-to-grafana-clouds-tempo-service-with-opentelemetry-collector/)
@@ -179,24 +179,24 @@ OTLP-compatible backends typically accept the [OTLP gRPC protocol](#otlp-grpc-ba
179179
180180
#### OTLP gRPC backends
181181
182-
Refer to the [otlp exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/README) documentation for available options.
182+
Refer to the [otlp exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/README.md) documentation for available options.
183183
184184
```yaml
185185
exporters:
186186
otlp:
187-
endpoint: otelcol2:4317
187+
endpoint: secure-otel-collector:4317
188188
tls:
189189
cert_file: file.cert
190190
key_file: file.key
191191
otlp/2:
192-
endpoint: otelcol2:4317
192+
endpoint: insecure-otel-collector:4317
193193
tls:
194194
insecure: true
195195
```
196196
197197
#### OTLP HTTP backends
198198
199-
Refer to the [otlphttp exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter/README) documentation for available options.
199+
Refer to the [otlphttp exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter/README.md) documentation for available options.
200200
201201
```yaml
202202
exporters:
@@ -208,7 +208,7 @@ exporters:
208208
209209
If you're looking for information about Sourcegraph's bundled Jaeger instance, head back to the [Tracing](/admin/observability/tracing) page to find the instructions for your deployment method.
210210
211-
Refer to the [jaeger exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/jaegerexporter/README) documentation for options.
211+
Refer to the [Jaeger](https://opentelemetry.io/docs/languages/js/exporters/#jaeger) documentation for options.
212212
213213
If you must use your own Jaeger instance, and if the bundled otel-collector's basic configuration with the Jaeger OTel exporter enabled meets your needs, configure the otel-collector's startup command to `/bin/otelcol-sourcegraph --config=/etc/otel-collector/configs/jaeger.yaml`. Note that this requires the environment variable `$JAEGER_HOST` to be set on the otel-collector service / container:
214214

@@ -220,14 +220,13 @@ exporters:
220220
endpoint: "$JAEGER_HOST:14250"
221221
tls:
222222
insecure: true
223-
224-
# Deployment environment variables:
225-
226223
```
227224

225+
The Sourcegraph frontend automatically proxies Jaeger's web UI to make it available at `/-/debug/jaeger`. You can proxy your own Jaeger instance instead by configuring the `JAEGER_SERVER_URL` environment variable on the `frontend` containers, and the `QUERY_BASE_PATH='/-/debug/jaeger'` environment variable on your `jaeger` container.
226+
228227
### Google Cloud
229228

230-
If you run Sourcegraph in GCP and wish to export your HTTP traces to Google Cloud Trace, otel-collector can use project authentication. See the [googlecloud exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/googlecloudexporter/README) documentation for available options.
229+
If you run Sourcegraph in GCP and wish to export your HTTP traces to Google Cloud Trace, otel-collector can use project authentication. See the [Google Cloud Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/googlecloudexporter/README.md) documentation for available options.
231230

232231
```yaml
233232
exporters:

docs/admin/observability/tracing.mdx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ The quickest way to get started with HTTP tracing is to deploy our bundled Jaege
1616

1717
To deploy our bundled Jaeger backend, follow the instructions for your deployment type:
1818

19-
- [Kubernetes with Helm](/admin/deploy/kubernetes/helm#enable-the-bundled-jaeger-deployment)
20-
- [Kubernetes with Kustomize](/admin/deploy/kubernetes/configure#deploy-opentelemetry-collector-with-jaeger-as-tracing-backend)
21-
- [Docker Compose](/admin/deploy/docker-compose/configuration#enable-http-tracing)
19+
- [Kubernetes with Helm](/admin/deploy/kubernetes#enable-the-bundled-jaeger-deployment)
20+
- [Kubernetes with Kustomize](/admin/deploy/kubernetes/configure#deploy-the-bundled-opentelemetry-collector-and-jaeger)
21+
- [Docker Compose](/admin/deploy/docker-compose/configuration#deploy-the-bundled-jaeger)
2222

2323
Then configure your Site Configuration:
2424

2525
1. Ensure your `externalURL` is configured
26-
2. Configure `urlTemplate`
26+
2. Configure `observability.tracing` > `urlTemplate`
2727
3. Optionally, configure `observability.client`, for Sourcegraph clients to also report traces, ex. src cli
2828

2929
```json
30-
"externalURL": "https://your-sourcegraph-instance.example.com",
30+
"externalURL": "https://sourcegraph.example.com",
3131
"observability.tracing": {
3232
"urlTemplate": "{{ .ExternalURL }}/-/debug/jaeger/trace/{{ .TraceID }}"
3333
},
@@ -43,22 +43,28 @@ Where:
4343
- `{{ .ExternalURL }}` is the value of the `externalURL` setting in your Sourcegraph instance's Site Configuration
4444
- `{{ .TraceID }}` is the TraceID which gets generated while processing the request
4545

46-
Once deployed, the Jaeger web UI will be accessible at `/-/debug/jaeger`.
47-
48-
The Sourcegraph frontend automatically proxies Jaeger's web UI to make it available at `/-/debug/jaeger`. You can proxy your own Jaeger instance instead by configuring the `JAEGER_SERVER_URL` environment variable on the `frontend` containers, and the `QUERY_BASE_PATH='/-/debug/jaeger'` environment variable on your `jaeger` container.
46+
Once deployed, the Jaeger web UI will be accessible at `/-/debug/jaeger`
4947

5048
### External OpenTelemetry-Compatible Platforms
5149

5250
If you prefer to use an external, OTel-compatible platform, you can configure Sourcegraph to export traces to it instead. See our [OpenTelemetry documentation](/admin/observability/opentelemetry) for further details.
5351

54-
Once your OTel backend is configured, configure the `urlTemplate` to link to your tracing backend.
52+
Then configure your Site Configuration:
53+
54+
1. Configure `observability.tracing` > `urlTemplate`
55+
2. Optionally, configure `observability.client`, for Sourcegraph clients to also report traces, ex. src cli
5556

56-
For example, if you [export your traces to Honeycomb](/admin/observability/opentelemetry#otlp-compatible-backends), your Site Configuration may look like:
57+
For example, if you export your traces to [Honeycomb](/admin/observability/opentelemetry#otlp-compatible-backends), your Site Configuration may look like:
5758

5859
```json
5960
"observability.tracing": {
6061
"urlTemplate": "https://ui.honeycomb.io/YOUR-HONEYCOMB-ORG/environments/YOUR-HONEYCOMB-DATASET/trace?trace_id={{ .TraceID }}"
61-
}
62+
},
63+
"observability.client": {
64+
"openTelemetry": {
65+
"endpoint": "/-/debug/otlp"
66+
}
67+
},
6268
```
6369

6470
Where:

0 commit comments

Comments
 (0)