Skip to content

Commit 4251379

Browse files
authored
Add prefer-blockquote-vs-docsy-alerts rule, apply rule to en pages, plus some copyedits (#9659)
1 parent 5e4cbac commit 4251379

File tree

22 files changed

+241
-68
lines changed

22 files changed

+241
-68
lines changed

.cspell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ words:
8989
- Crossplane
9090
- crosspost
9191
- desaturate
92-
- Docsy
92+
- docsy
9393
- errorf
9494
- excerpter
9595
- favicons

.cspell/en-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ autoloaded
1616
autoloader
1717
autoloading
1818
backoff
19+
blockquotes
1920
caml
2021
cartservice
2122
cassandra

.markdownlint-cli2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
customRules:
2+
- ./scripts/_md-rules/prefer-blockquote-vs-docsy-alerts/index.mjs
23
- ./scripts/_md-rules/alert-type-not-translated.mjs
34
- ./scripts/_md-rules/unindent-code-blocks.js
45
- ./scripts/_md-rules/trim-code-blank-lines.js

.markdownlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ table-column-style: false # Causes problems in ja and zh pages
4141

4242
gh-url-hash: false
4343

44+
# Prefer blockquote alerts in English docs; enabled under content/en only. See
45+
# content/en/.markdownlint.yaml.
46+
prefer-blockquote-vs-docsy-alerts: false
47+
4448
# Custom rules registered in .markdownlint-cli2.yaml are enabled by default
4549
# (via `default: true` above). Only list custom rules here to disable them or
4650
# to provide configuration. Rules that need no config can be omitted.

content/en/.markdownlint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extends: ../../.markdownlint.yaml
2+
3+
prefer-blockquote-vs-docsy-alerts: true

content/en/docs/contributing/sig-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description:
55
Learn how approvers and maintainers manage issues and contributions.
66
weight: 999
77
# prettier-ignore
8-
cSpell:ignore: Comms contribfest docsy hotfixes inactivitiy onboarded triager triagers
8+
cSpell:ignore: Comms contribfest hotfixes inactivitiy onboarded triager triagers
99
---
1010

1111
This pages includes guidelines and some common practices used by approvers and

content/en/docs/contributing/style-guide.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ To enforce standards and consistency for Markdown files, all files should follow
130130
certain rules, enforced by [markdownlint][]. For a full list, check the
131131
[.markdownlint.yaml][] and [.markdownlint-cli2.yaml][] files.
132132

133+
When legitimate exceptions to a rule exists, use `markdownlint-disable`
134+
directive to suppress the rule warnings. For details, see the
135+
[markdownlint documentation](https://github.com/DavidAnson/markdownlint#configuration).
136+
133137
We also enforce Markdown [file format](#file-format) and strip files of trailing
134138
whitespace. This precludes the [line break syntax][] of 2+ spaces; use `<br>`
135139
instead or reformat your text.

content/en/docs/languages/dotnet/exporters.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -275,34 +275,30 @@ var meterProvider = Sdk.CreateMeterProviderBuilder()
275275
.Build();
276276
```
277277

278-
{{% alert title=Note %}}
279-
280-
Make sure Prometheus is started with the OTLP receiver enabled:
281-
282-
```sh
283-
./prometheus --web.enable-otlp-receiver
284-
```
285-
286-
Or when using Docker:
287-
288-
```sh
289-
docker run -p 9090:9090 prom/prometheus --web.enable-otlp-receiver
290-
```
291-
292-
{{% /alert %}}
278+
> [!NOTE]
279+
>
280+
> Make sure Prometheus is started with the OTLP receiver enabled:
281+
>
282+
> ```sh
283+
> ./prometheus --web.enable-otlp-receiver
284+
> ```
285+
>
286+
> Or when using Docker:
287+
>
288+
> ```sh
289+
> docker run -p 9090:9090 prom/prometheus --web.enable-otlp-receiver
290+
> ```
293291
294292
#### Using Prometheus Exporter (Pull/Scrape) {#prometheus-exporter}
295293
296294
This approach exposes a metrics endpoint in your application (e.g., `/metrics`)
297295
that Prometheus scrapes at regular intervals.
298296
299-
{{% alert color="warning" title="Warning" %}}
300-
301-
This exporter is still under development and doesn't support exemplars. For
302-
production environments, consider using the
303-
[OTLP exporter approach](#prometheus-otlp) instead.
304-
305-
{{% /alert %}}
297+
> [!WARNING]
298+
>
299+
> This exporter is still under development and doesn't support exemplars. For
300+
> production environments, consider using the
301+
> [OTLP exporter approach](#prometheus-otlp) instead.
306302
307303
##### Dependencies {#prometheus-dependencies}
308304

content/en/docs/languages/go/exporters.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,20 @@ func main() {
7070
}
7171
```
7272

73-
{{% alert title="Note" color="info" %}}
74-
75-
The standard OTLP exporter packages (`otlptracegrpc`, `otlptracehttp`, etc.)
76-
already read most OTLP environment variables such as
77-
`OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_HEADERS`,
78-
`OTEL_EXPORTER_OTLP_TIMEOUT`, and `OTEL_EXPORTER_OTLP_COMPRESSION`.
79-
80-
The `autoexport` package adds support for the **exporter selector variables**
81-
(`OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`) that
82-
choose _which_ exporter implementation to use. This separation keeps binary
83-
sizes smaller by not bundling exporter dependencies (like gRPC) unless
84-
explicitly imported.
85-
86-
Also note that `OTEL_SDK_DISABLED` is not currently supported by the Go SDK.
87-
88-
{{% /alert %}}
73+
> [!NOTE]
74+
>
75+
> The standard OTLP exporter packages (`otlptracegrpc`, `otlptracehttp`, etc.)
76+
> already read most OTLP environment variables such as
77+
> `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_HEADERS`,
78+
> `OTEL_EXPORTER_OTLP_TIMEOUT`, and `OTEL_EXPORTER_OTLP_COMPRESSION`.
79+
>
80+
> The `autoexport` package adds support for the **exporter selector variables**
81+
> (`OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`) that
82+
> choose _which_ exporter implementation to use. This separation keeps binary
83+
> sizes smaller by not bundling exporter dependencies (like gRPC) unless
84+
> explicitly imported.
85+
>
86+
> Also note that `OTEL_SDK_DISABLED` is not currently supported by the Go SDK.
8987
9088
For a complete overview of which environment variables are supported by the Go
9189
SDK and contrib packages, see the

content/en/docs/languages/go/sampling.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ spans that are generated by a system. The exact sampler you should use depends
88
on your specific needs, but in general you should make a decision at the start
99
of a trace, and allow the sampling decision to propagate to other services.
1010

11-
A [`Sampler`](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#Sampler) can
12-
be set on the tracer provider using the
11+
A [`Sampler`][] can be set on the tracer provider using the
1312
[`WithSampler`](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#WithSampler)
1413
option, as follows:
1514

@@ -46,31 +45,27 @@ the `TraceIDRatioBased` sampler.
4645
## Custom samplers
4746

4847
If the built-in samplers don't meet your needs, you can create a custom sampler
49-
by implementing the
50-
[`Sampler`](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#Sampler)
51-
interface. A custom sampler must implement two methods:
48+
by implementing the [`Sampler`][] interface. A custom sampler must implement two
49+
methods:
5250

5351
- `ShouldSample(parameters SamplingParameters) SamplingResult`: Makes the
5452
sampling decision based on the provided parameters.
5553
- `Description() string`: Returns a description of the sampler.
5654

57-
### Preserving tracestate
58-
59-
{{% alert title="Critical: Preserve tracestate" color="warning" %}}
60-
61-
When implementing a custom sampler, you **must** preserve the parent's
62-
tracestate in your `SamplingResult`. Failing to do so breaks context propagation
63-
in distributed systems that rely on tracestate for passing vendor-specific or
64-
application-specific trace data.
65-
66-
Always extract the tracestate from the parent span context:
67-
68-
```go
69-
psc := trace.SpanContextFromContext(parameters.ParentContext)
70-
// Use psc.TraceState() in your SamplingResult
71-
```
72-
73-
{{% /alert %}}
55+
> [!IMPORTANT] Preserve parent tracestate
56+
>
57+
> In `ShouldSample`, you _must_ preserve the parent's tracestate in your
58+
> `SamplingResult`. Failing to do so breaks context propagation in distributed
59+
> systems that rely on tracestate for passing vendor-specific or
60+
> application-specific trace data.
61+
>
62+
> Extract the tracestate from the parent span context:
63+
>
64+
> ```go
65+
> psc := trace.SpanContextFromContext(parameters.ParentContext)
66+
> ```
67+
>
68+
> Pass `psc.TraceState()` through when you build your `SamplingResult`.
7469
7570
### Example
7671
@@ -167,3 +162,5 @@ When implementing custom samplers, keep these points in mind:
167162
2. **Heavy computations in ShouldSample**: The `ShouldSample` function is called
168163
synchronously for every span creation. Avoid expensive operations like
169164
network calls or complex computations that could impact performance.
165+
166+
[`Sampler`]: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#Sampler

0 commit comments

Comments
 (0)