Skip to content

Commit 609a637

Browse files
authored
Fix lint check in makefile, fix errors (#837)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
1 parent 956dd76 commit 609a637

File tree

15 files changed

+45
-41
lines changed

15 files changed

+45
-41
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# All documents to be used in spell check.
2-
ALL_DOCS := $(shell find . -name '*.md' -type f | grep -v ^./node_modules | sort)
2+
ALL_DOCS := $(shell find . -name '*.md' -not -path './.github/*' -type f | grep -v ^./node_modules | sort)
33

44
TOOLS_DIR := ./.tools
55
MISSPELL_BINARY=$(TOOLS_DIR)/misspell
@@ -32,4 +32,5 @@ install-markdown-lint:
3232

3333
.PHONY: markdown-lint
3434
markdown-lint:
35-
@for f in $(ALL_DOCS); do echo $$f; $(MARKDOWN_LINT) -c .markdownlint.yaml $$f; done
35+
@echo $(ALL_DOCS)
36+
@for f in $(ALL_DOCS); do echo $$f; $(MARKDOWN_LINT) -c .markdownlint.yaml $$f || exit 1; done

experimental/metrics/config-service.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
2222

23-
2423
## Overview
24+
2525
The OpenTelemetry Metric Configuration Service adds the ability to dynamically
2626
and remotely configure metric collection schedules. A user may specify
2727
collection periods at runtime, and propagate these changes to instrumented
@@ -35,8 +35,8 @@ third-party metric provider has an existing metric configuration service (or
3535
would like to implement one in the future), and if it communicates using this
3636
protocol, it may speak directly with our instrumented applications.
3737

38-
3938
## Service Protocol
39+
4040
Configuration data is communicated between an SDK and a backend (either directly
4141
or indirectly through a Collector) using the following protocol specification.
4242
The SDK is assumed to be the client, and makes the metric config requests. The
@@ -45,6 +45,7 @@ responses. For more details on this arrangement, see
4545
[below](#push-vs-pull-metric-model).
4646

4747
### Metric Config Request
48+
4849
A request consists of two fields: `resource` and an optional
4950
`last_known_fingerprint`.
5051

@@ -63,10 +64,12 @@ If unspecified, the configuration backend will send the full schedules with each
6364
request.
6465

6566
### Metric Config Response
67+
6668
A response consists of three fields `schedules`, `fingerprint`, and
6769
`suggested_wait_time_sec`.
6870

6971
#### Schedules
72+
7073
`schedules` is a list of metric schedules. Each schedule consists of three
7174
components: `exclusion_patterns`, `inclusion_patterns`, and `period_sec`.
7275

@@ -85,6 +88,7 @@ periods that are divisible by the smallest period (see
8588
collected
8689

8790
#### Fingerprint
91+
8892
`fingerprint` is a sequence of bytes that corresponds to the set of schedules
8993
being sent. There are two requirements on computing fingerprints:
9094

@@ -97,12 +101,14 @@ is the same as the response’s `last_known_fingerprint`, then all other fields
97101
the response are optional.
98102

99103
#### Wait Time
104+
100105
`suggested_wait_time_sec` is a duration (in seconds) that the SDK should wait
101106
before sending the next metric config request. A response MAY have a
102107
`suggested_wait_time_sec`, but its use is optional, and the SDK need not obey
103108
it. As the name implies, it is simply a suggestion.
104109

105110
### Push vs Pull Metric Model
111+
106112
Note that the configuration service assumes a “push” model of metric export --
107113
that is, metrics are pushed from the SDK to a receiving backend. The backend
108114
serves incoming requests that contain metric data. This is in contrast to the
@@ -114,8 +120,8 @@ metrics, and the need for our configuration service is less relevant. We
114120
therefore assume that all systems using the configuration service deliver
115121
metrics on a push-based model.
116122

117-
118123
## Implementation Details
124+
119125
Because this specification is experimental, and may imply substantial changes to
120126
the existing system, we provide additional details on the example prototype
121127
implementations available on the
@@ -125,6 +131,7 @@ actual implementation in an SDK will likely differ. We offer these details not
125131
as formal specification, but as an example of how this system might look.
126132

127133
### Collection Periods
134+
128135
Though the protocol does not enforce specific collection periods, the SDK MAY
129136
assume that all larger collection periods will be divisible by the smallest
130137
period in a set of schedules, for the sake of optimization. Indeed, it is
@@ -149,6 +156,7 @@ However, the SDK MUST still be able to handle periods of any nonzero integer
149156
duration, even if they violate the divisibility suggestion.
150157

151158
### Go SDK
159+
152160
A prototype implementation of metric configuration is available for the Go SDK,
153161
currently hosted on the [contrib repo](https://github.com/vmingchen/opentelemetry-go-contrib). It provides an
154162
alternative push controller component with the ability to configure collection
@@ -166,6 +174,7 @@ controller, in place of OpenTelemetry’s version, to be able to have access to
166174
this feature.
167175

168176
### Collector Extension
177+
169178
An example configuration backend is implemented as an extension for the
170179
Collector, currently hosted on the [contrib repo](https://github.com/vmingchen/opentelemetry-collector-contrib). When this extension is enabled, the Collector
171180
functions as a potential endpoint for Agent/SDKs to retrieve configuration data.
@@ -184,6 +193,7 @@ The configuration data itself may be specified using one of two sources: a local
184193
file or a connection to a remote backend.
185194

186195
#### Local File
196+
187197
Configuration data can be specified in the form of a local file that the
188198
collector monitors. Changes to the file are immediately reflected in the
189199
Collector’s in-memory representation of the data, so there is no need to restart
@@ -213,6 +223,7 @@ ConfigBlocks:
213223
```
214224
215225
The following rules govern the file-based configurations:
226+
216227
* There MUST be 1 ConfigBlock or more in a ConfigBlocks list
217228
* Each ConfigBlock MAY have a field Resource
218229
* Resource MAY have one or more strings, each a string-representation of a key-value label in a resource. If no strings are specified, then this ConfigBlock matches with any request
@@ -222,6 +233,7 @@ The following rules govern the file-based configurations:
222233
* Each Schedule MUST have a field Period, corresponding to the collection period of the metrics matched by this Schedule
223234
224235
##### Matching Behavior
236+
225237
An incoming request specifies a resource for which configuration data should be
226238
returned. A ConfigBlock matches a resource if all strings listed under
227239
ConfigBlock::Resource exactly equal a key-value label in the resource. In the
@@ -236,11 +248,13 @@ across telemetry sources, unless superseded by a more specific ConfigBlock that
236248
asks for a shorter period.
237249
238250
##### Fingerprint Hashing
251+
239252
Fingerprints are generated using an FNVa 64 bit hashing scheme. The hash is
240253
uniquely determined by the contents of a ConfigBlock. The order of patterns and
241254
the order of schedules do not impact the resulting hash.
242255
243256
#### Remote Backend
257+
244258
Alternatively, instead of using a local file, the Collector may use another
245259
configuration service backend. This remote backend could be another Collector,
246260
or it could be a third party that implements the configuration service. In the

specification/common/common.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Table of Contents
77

88
- [Attributes](#attributes)
99
- [Attribute and Label Naming](#attribute-and-label-naming)
10+
1011
</details>
1112

1213
## Attributes
@@ -130,4 +131,3 @@ It is recommended to limit names to printable Basic Latin characters
130131
(more precisely to
131132
[U+0021 .. U+007E](https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)#Table_of_characters)
132133
subset of Unicode code points).
133-

specification/correlationcontext/api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,3 @@ otcorrelations: user=foo%40example.com,name=Example%20Name
136136

137137
If a new name/value pair is added and its name is the same as an existing name, than the new pair MUST take precedence. The value
138138
is replaced with the added value (regardless if it is locally generated or received from a remote peer).
139-

specification/error-handling.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,27 @@ SDKs MAY expose callbacks to allow end users to handle self-diagnostics separate
5656

5757
SDK implementations MUST allow end users to change the library's default error handling behavior for relevant errors.
5858
Application developers may want to run with strict error handling in a staging environment to catch invalid uses of the API, or malformed config.
59-
Note that configuring a custom error handler in this way is the only exception to the basic error handling principles outlined above.
60-
The mechanism by which end users set or register a custom error handler should follow language-specific conventions.
59+
Note that configuring a custom error handler in this way is the only exception to the basic error handling principles outlined above.
60+
The mechanism by which end users set or register a custom error handler should follow language-specific conventions.
6161

62-
### Examples
62+
### Examples
6363

64-
These are examples of how end users might register custom error handlers.
64+
These are examples of how end users might register custom error handlers.
6565
Examples are for illustration purposes only. Language library authors
66-
are free to deviate from these provided that their design matches the requirements outlined above.
66+
are free to deviate from these provided that their design matches the requirements outlined above.
6767

68-
##### Go
68+
#### Go
6969

7070
```go
7171
// The basic Error Handler interface
7272
type ErrorHandler interface {
73-
Handle(err error)
73+
Handle(err error)
7474
}
7575

7676
func Handler() ErrorHandler
7777
func SetHandler(handler ErrorHandler)
7878
```
7979

80-
8180
```go
8281
// Registering a custom Error Handler
8382
type IgnoreExporterErrorsHandler struct{}
@@ -91,7 +90,7 @@ func (IgnoreExporterErrorsHandler) Handle(err error) {
9190
}
9291

9392
func main() {
94-
// Other setup ...
93+
// Other setup ...
9594
opentelemetrysdk.SetHandler(IgnoreExporterErrorsHandler{})
9695
}
9796

@@ -100,11 +99,10 @@ func main() {
10099
##### Java
101100

102101
OpenTelemetry Java uses [java.util.logging](https://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html)
103-
to output and handle all logs, including errors. Custom handlers and filters can be registered both in code and using the
104-
Java logging configuration file.
102+
to output and handle all logs, including errors. Custom handlers and filters can be registered both in code and using the Java logging configuration file.
105103

106104
```properties
107-
## Turn off all error logging
105+
## Turn off all error logging
108106
io.opentelemetry.level = OFF
109107
```
110108

specification/glossary.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Some other fundamental terms are documented in the [overview document](overview.
3030

3131
<a name="in-band"></a>
3232
<a name="out-of-band"></a>
33+
3334
### In-band and Out-of-band Data
3435

3536
> In telecommunications, **in-band signaling** is the sending of control information within the same band or channel used for data such as voice or video. This is in contrast to **out-of-band signaling** which is sent over a different channel, or even over a separate network ([Wikipedia](https://en.wikipedia.org/wiki/In-band_signaling)).
@@ -46,15 +47,13 @@ usually asynchronously by background routines
4647
rather than from the critical path of the business logic.
4748
Metrics, logs, and traces exported to telemetry backends are examples of out-of-band data.
4849

49-
<a name="telemetry_sdk"></a>
5050
### Telemetry SDK
5151

5252
Denotes the library that implements the *OpenTelemetry API*.
5353

5454
See [Library Guidelines](library-guidelines.md#sdk-implementation) and
5555
[Library resource semantic conventions](resource/semantic_conventions/README.md#telemetry-sdk).
5656

57-
<a name="exporter_library"></a>
5857
### Exporter Library
5958

6059
Libraries which are compatible with the [Telemetry SDK](#telemetry-sdk) and provide functionality to emit telemetry to consumers.
@@ -68,8 +67,6 @@ or by another [Instrumentation Library](#instrumentation-library).
6867

6968
Example: `org.mongodb.client`.
7069

71-
<a name="instrumenting_library"></a>
72-
<a name="instrumentation_library"></a>
7370
### Instrumentation Library
7471

7572
Denotes the library that provides the instrumentation for a given [Instrumented Library](#instrumented-library).
@@ -82,8 +79,6 @@ Example: `io.opentelemetry.contrib.mongodb`.
8279

8380
Synonyms: *Instrumenting Library*.
8481

85-
<a name="tracer-name"></a>
86-
<a name="meter-name"></a>
8782
### Tracer Name / Meter Name
8883

8984
This refers to the `name` and (optional) `version` arguments specified when

specification/logs/overview.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ standard output.
411411
## Trace Context in Legacy Formats
412412

413413
Earlier we briefly mentioned that it is possible to modify existing applications
414-
so that they include the Request Context information in the emitted logs.
414+
so that they include the Request Context information in the emitted logs.
415415

416416
[OTEP0114](https://github.com/open-telemetry/oteps/pull/114) defines how the
417417
trace context should be recorded in logs. To summarize, the following field
@@ -425,9 +425,7 @@ names should be used in legacy formats:
425425
All 3 fields are optional (see the [data model](data-model.md) for details of
426426
which combination of fields is considered valid).
427427

428-
Here are examples for some legacy formats:
429-
430-
**Syslog RFC5424**
428+
### Syslog RFC5424
431429

432430
Trace id, span id and traceflags SHOULD be recorded via SD-ID "opentelemetry".
433431

@@ -437,7 +435,7 @@ For example:
437435
[opentelemetry traceid="102981ABCD2901" spanid="abcdef1010" traceflags="01"]
438436
```
439437

440-
**Plain Text Formats**
438+
### Plain Text Formats
441439

442440
The fields should be recorded according to the customary approach used for a
443441
particular format (e.g. field:value format for LTSV). For example:
@@ -446,7 +444,7 @@ particular format (e.g. field:value format for LTSV). For example:
446444
host:192.168.0.1<TAB>traceid:102981ABCD2901<TAB>spanid:abcdef1010<TAB>time:[01/Jan/2010:10:11:23 -0400]<TAB>req:GET /health HTTP/1.0<TAB>status:200
447445
```
448446

449-
**JSON Formats**
447+
### JSON Formats
450448

451449
The fields should be recorded as top-level fields in the JSON structure. For example:
452450

@@ -459,7 +457,7 @@ The fields should be recorded as top-level fields in the JSON structure. For exa
459457
}
460458
```
461459

462-
***Other Structured Formats***
460+
### Other Structured Formats
463461

464462
The fields should be recorded as top-level structured attributes of the log
465463
record as it is customary for the particular format.

specification/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Vision](https://github.com/open-telemetry/opentelemetry-collector/blob/master/do
306306

307307
## Instrumentation Libraries
308308

309-
See [Instrumentation Library](glossary.md#instrumentation_library)
309+
See [Instrumentation Library](glossary.md#instrumentation-library)
310310

311311
The inspiration of the project is to make every library and application
312312
observable out of the box by having them call OpenTelemetry API directly. However,
@@ -316,7 +316,7 @@ wrapping interfaces, subscribing to library-specific callbacks, or translating
316316
existing telemetry into the OpenTelemetry model.
317317

318318
A library that enables OpenTelemetry observability for another library is called
319-
an [Instrumentation Library](glossary.md#instrumentation_library).
319+
an [Instrumentation Library](glossary.md#instrumentation-library).
320320

321321
An instrumentation library should be named to follow any naming conventions of
322322
the instrumented library (e.g. 'middleware' for a web framework).

specification/protocol/exporter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http
5252

5353
## Retry
5454

55-
[Transient errors](#transient-errors) MUST be handled with a retry strategy. This retry strategy MUST implement an exponential back-off with jitter to avoid overwhelming the destination until the network is restored or the destination has recovered.
55+
[Transient errors](#transient-errors) MUST be handled with a retry strategy. This retry strategy MUST implement an exponential back-off with jitter to avoid overwhelming the destination until the network is restored or the destination has recovered.
5656

5757
## Transient Errors
58+
5859
Transient errors are errors which expect the backend to recover. The following status codes are defined as transient errors:
5960

6061
| HTTP Status Code | Description |

specification/trace/api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ That is, "get_user" is a reasonable name, while "get_user/314159",
226226
where "314159" is a user ID, is not a good name due to its high cardinality.
227227
Generality SHOULD be prioritized over human-readability.
228228

229-
230229
For example, here are potential span names for an endpoint that gets a
231230
hypothetical account information:
232231

@@ -421,7 +420,6 @@ Note that [Samplers](sdk.md#sampler) can only consider information already
421420
present during span creation. Any changes done later, including new or changed
422421
attributes, cannot change their decisions.
423422

424-
425423
#### Add Events
426424

427425
A `Span` MUST have the ability to add events. Events have a time associated

0 commit comments

Comments
 (0)