Skip to content

Commit b9ca87a

Browse files
chalinarminru
andauthored
[editorial] Setup Prettier and run it on some files (open-telemetry#192)
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
1 parent 82a6efb commit b9ca87a

File tree

12 files changed

+79
-51
lines changed

12 files changed

+79
-51
lines changed

.markdown_link_check_config.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,5 @@
1515
}
1616
],
1717
"retryOn429": true,
18-
"aliveStatusCodes": [
19-
200,
20-
403
21-
]
18+
"aliveStatusCodes": [200, 403]
2219
}

.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.github
2+
3+
# for the first iteration, we only reformat /docs/cloud* and will add the rest in individual PRs
4+
/docs/**
5+
!/docs/cloud*
6+
!/docs/cloud*/**
7+
/model
8+
/schemas

CHANGELOG.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ release.
1212
Note: This is the first release of Semantic Conventions separate from the Specification.
1313

1414
- Add GCP Bare Metal Solution as a cloud platform
15-
([#64](https://github.com/open-telemetry/semantic-conventions/pull/64))
15+
([#64](https://github.com/open-telemetry/semantic-conventions/pull/64))
1616
- Clarify the scope of the HTTP client span.
17-
([#3290](https://github.com/open-telemetry/opentelemetry-specification/pull/3290))
17+
([#3290](https://github.com/open-telemetry/opentelemetry-specification/pull/3290))
1818
- Add moratorium on relying on schema transformations for telemetry stability
1919
([#3380](https://github.com/open-telemetry/opentelemetry-specification/pull/3380))
2020
- Mark "Instrumentation Units" and "Instrumentation Types" sections of the general
@@ -34,15 +34,15 @@ Note: This is the first release of Semantic Conventions separate from the Specif
3434
([#3443](https://github.com/open-telemetry/opentelemetry-specification/pull/3443))
3535
- Rename `net.peer.*`, `net.host.*`, and `net.sock.*` attributes to align with ECS
3636
([#3402](https://github.com/open-telemetry/opentelemetry-specification/pull/3402))
37-
BREAKING: rename `net.peer.name` to `server.address` on client side and to `client.address` on server side,
38-
`net.peer.port` to `server.port` on client side and to `client.port` on server side,
39-
`net.host.name` and `net.host.port` to `server.address` and `server.port` (since `net.host.*` attributes only applied to server instrumentation),
40-
`net.sock.peer.addr` to `server.socket.address` on client side and to `client.socket.address` on server side,
41-
`net.sock.peer.port` to `server.socket.port` on client side and to `client.socket.port` on server side,
42-
`net.sock.peer.name` to `server.socket.domain` (since `net.sock.peer.name` only applied to client instrumentation),
43-
`net.sock.host.addr` to `server.socket.address` (since `net.sock.host.*` only applied to server instrumentation),
44-
`net.sock.host.port` to `server.socket.port` (similarly since `net.sock.host.*` only applied to server instrumentation),
45-
`http.client_ip` to `client.address`
37+
BREAKING: rename `net.peer.name` to `server.address` on client side and to `client.address` on server side,
38+
`net.peer.port` to `server.port` on client side and to `client.port` on server side,
39+
`net.host.name` and `net.host.port` to `server.address` and `server.port` (since `net.host.*` attributes only applied to server instrumentation),
40+
`net.sock.peer.addr` to `server.socket.address` on client side and to `client.socket.address` on server side,
41+
`net.sock.peer.port` to `server.socket.port` on client side and to `client.socket.port` on server side,
42+
`net.sock.peer.name` to `server.socket.domain` (since `net.sock.peer.name` only applied to client instrumentation),
43+
`net.sock.host.addr` to `server.socket.address` (since `net.sock.host.*` only applied to server instrumentation),
44+
`net.sock.host.port` to `server.socket.port` (similarly since `net.sock.host.*` only applied to server instrumentation),
45+
`http.client_ip` to `client.address`
4646
- BREAKING: Introduce `network.transport` defined as
4747
[OSI Transport Layer](https://osi-model.com/transport-layer/) or
4848
[Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication).
@@ -349,7 +349,7 @@ This and earlier versions were released as part of [the Specification](https://g
349349
([#2508](https://github.com/open-telemetry/opentelemetry-specification/pull/2508)).
350350
- Refactor jvm classes semantic conventions
351351
([#2550](https://github.com/open-telemetry/opentelemetry-specification/pull/2550)).
352-
- Add browser.* attributes
352+
- Add browser.\* attributes
353353
([#2353](https://github.com/open-telemetry/opentelemetry-specification/pull/2353)).
354354
- Change JVM runtime metric `process.runtime.jvm.memory.max`
355355
to `process.runtime.jvm.memory.limit`
@@ -487,13 +487,13 @@ This and earlier versions were released as part of [the Specification](https://g
487487
- Add `arch` to `host` semantic conventions ([#1483](https://github.com/open-telemetry/opentelemetry-specification/pull/1483))
488488
- Add `runtime` to `container` semantic conventions ([#1482](https://github.com/open-telemetry/opentelemetry-specification/pull/1482))
489489
- Rename `gcp_gke` to `gcp_kubernetes_engine` to have consistency with other
490-
Google products under `cloud.infrastructure_service` ([#1496](https://github.com/open-telemetry/opentelemetry-specification/pull/1496))
490+
Google products under `cloud.infrastructure_service` ([#1496](https://github.com/open-telemetry/opentelemetry-specification/pull/1496))
491491
- `http.url` MUST NOT contain credentials ([#1502](https://github.com/open-telemetry/opentelemetry-specification/pull/1502))
492492
- Add `aws.eks.cluster.arn` to EKS specific semantic conventions ([#1484](https://github.com/open-telemetry/opentelemetry-specification/pull/1484))
493493
- Rename `zone` to `availability_zone` in `cloud` semantic conventions ([#1495](https://github.com/open-telemetry/opentelemetry-specification/pull/1495))
494494
- Rename `cloud.infrastructure_service` to `cloud.platform` ([#1530](https://github.com/open-telemetry/opentelemetry-specification/pull/1530))
495495
- Add section describing that libraries and the collector should autogenerate
496-
the semantic convention keys. ([#1515](https://github.com/open-telemetry/opentelemetry-specification/pull/1515))
496+
the semantic convention keys. ([#1515](https://github.com/open-telemetry/opentelemetry-specification/pull/1515))
497497

498498
## v1.0.1 (2021-02-11)
499499

CONTRIBUTING.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Specification has a number of tools it uses to check things like style,
2222
spelling and link validity. Before using the tools:
2323

2424
- Install the latest LTS release of **[Node](https://nodejs.org/)**.
25-
For example, using **[nvm][]** under Linux run:
25+
For example, using **[nvm][]** under Linux run:
2626

2727
```bash
2828
nvm install --lts
@@ -41,14 +41,15 @@ make check
4141
```
4242

4343
Note: This can take a long time as it checks all links. You should use this
44-
prior to submitting a PR to ensure validity. However, you can run individual
44+
prior to submitting a PR to ensure validity. However, you can run individual
4545
checks directly.
4646

4747
See:
4848

4949
- [MarkdownStyle](#markdown-style)
5050
- [Misspell Check](#misspell-check)
5151
- Markdown link checking (docs TODO)
52+
- Prettier formatting
5253

5354
### YAML to Markdown
5455

@@ -125,7 +126,7 @@ make misspell-correction
125126

126127
## Making a Release
127128

128-
- Ensure the referenced specification version is up to date. Use
129+
- Ensure the referenced specification version is up to date. Use
129130
[tooling to update the spec](#updating-the-referenced-specification-version)
130131
if needed.
131132
- Create a staging branch for the release.

Makefile

+10-2
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,22 @@ table-check:
102102
schema-check:
103103
$(TOOLS_DIR)/schema_check.sh
104104

105+
.PHONY: check-format
106+
check-format:
107+
npm run check:format
108+
109+
.PHONY: fix-format
110+
fix-format:
111+
npm run fix:format
112+
105113
# Run all checks in order of speed / likely failure.
106114
.PHONY: check
107-
check: misspell markdownlint markdown-link-check
115+
check: misspell markdownlint markdown-link-check check-format
108116
@echo "All checks complete"
109117

110118
# Attempt to fix issues / regenerate tables.
111119
.PHONY: fix
112-
fix: table-generation misspell-correction
120+
fix: table-generation misspell-correction fix-format
113121
@echo "All autofixes complete"
114122

115123
.PHONY: install-tools

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ Approvers ([@open-telemetry/specs-semconv-approvers](https://github.com/orgs/ope
2525
- [Sean Marciniak](https://github.com/MovieStoreGuy), Atlassian
2626
- [Ted Young](https://github.com/tedsuo), Lightstep
2727

28-
*Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#approver).*
28+
_Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#approver)._
2929

3030
Maintainers ([@open-telemetry/specs-semconv-maintainers](https://github.com/orgs/open-telemetry/teams/specs-semconv-maintainers)):
3131

3232
- [Josh Suereth](https://github.com/jsuereth)
3333
- [Armin Ruech](https://github.com/arminru)
3434
- [Reiley Yang](https://github.com/reyang)
3535

36-
*Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#maintainer).*
36+
_Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#maintainer)._
3737

3838
[SpecificationVersion]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0

docs/cloud-providers/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ This document defines semantic conventions for cloud provider SDK spans, metrics
1313

1414
Semantic conventions exist for the following cloud provider SDKs:
1515

16-
* [AWS SDK](aws-sdk.md): Semantic Conventions for the *AWS SDK*.
16+
- [AWS SDK](aws-sdk.md): Semantic Conventions for the _AWS SDK_.
1717

1818
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md

docs/cloud-providers/aws-sdk.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The span name MUST be of the format `Service.Operation` as per the AWS HTTP API,
2323
`S3.ListBuckets`. This is equivalent to concatenating `rpc.service` and `rpc.method` with `.` and consistent
2424
with the naming guidelines for RPC client spans.
2525

26+
<!-- prettier-ignore-start -->
2627
<!-- semconv aws -->
2728
| Attribute | Type | Description | Examples | Requirement Level |
2829
|---|---|---|---|---|
@@ -35,12 +36,13 @@ with the naming guidelines for RPC client spans.
3536

3637
**[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).
3738
<!-- endsemconv -->
39+
<!-- prettier-ignore-end -->
3840

3941
## AWS service specific attributes
4042

4143
The following Semantic Conventions extend the general AWS SDK attributes for specific AWS services:
4244

43-
* [AWS DynamoDB](/docs/database/dynamodb.md): Semantic Conventions for *AWS DynamoDB*.
44-
* [AWS S3](/docs/object-stores/s3.md): Semantic Conventions for *AWS S3*.
45+
- [AWS DynamoDB](/docs/database/dynamodb.md): Semantic Conventions for _AWS DynamoDB_.
46+
- [AWS S3](/docs/object-stores/s3.md): Semantic Conventions for _AWS S3_.
4547

4648
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md

docs/cloudevents/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ This document defines semantic conventions for the [CloudEvents specification](h
1313

1414
Semantic conventions for CloudEvents are defined for the following signals:
1515

16-
* [CloudEvents Spans](cloudevents-spans.md): Semantic Conventions for modeling CloudEvents as *spans*.
16+
- [CloudEvents Spans](cloudevents-spans.md): Semantic Conventions for modeling CloudEvents as _spans_.
1717

1818
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md

docs/cloudevents/cloudevents-spans.md

+23-20
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ linkTitle: CloudEvents Spans
66

77
**Status**: [Experimental][DocumentStatus]
88

9-
<!-- Re-generate TOC with `markdown-toc --no-first-h1 -i` -->
9+
<!-- prettier-ignore-start -->
1010

1111
<!-- toc -->
1212

@@ -20,14 +20,15 @@ linkTitle: CloudEvents Spans
2020

2121
<!-- tocstop -->
2222

23+
<!-- prettier-ignore-end -->
24+
2325
## Definitions
2426

25-
From the
26-
[CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#overview):
27+
From the
28+
[CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#overview):
2729

2830
> CloudEvents is a specification for describing event data in common formats
29-
to provide interoperability across services, platforms and systems.
30-
>
31+
> to provide interoperability across services, platforms and systems.
3132
3233
For more information on the concepts, terminology and background of CloudEvents
3334
consult the
@@ -39,7 +40,7 @@ document.
3940
A CloudEvent can be sent directly from producer to consumer.
4041
For such a scenario, the traditional parent-child trace model works well.
4142
However, CloudEvents are also used in distributed systems where an event
42-
can go through many [hops](https://en.wikipedia.org/wiki/Hop_(networking))
43+
can go through many [hops](<https://en.wikipedia.org/wiki/Hop_(networking)>)
4344
until it reaches a consumer. In this scenario, the traditional parent-child
4445
trace model is not sufficient to produce a meaningful trace.
4546

@@ -49,13 +50,13 @@ Consider the following scenario:
4950
+----------+ +--------------+
5051
| Producer | ---------------> | Intermediary |
5152
+----------+ +--------------+
52-
|
53-
|
54-
|
55-
v
56-
+----------+ +----------+
57-
| Consumer | <----------------- | Queue |
58-
+----------+ +----------+
53+
|
54+
|
55+
|
56+
v
57+
+----------+ +----------+
58+
| Consumer | <----------------- | Queue |
59+
+----------+ +----------+
5960
```
6061

6162
With the traditional parent-child trace model, the above scenario would produce
@@ -159,12 +160,12 @@ Instrumentation SHOULD create a new span and populate the
159160
on the event. This applies when:
160161

161162
- A CloudEvent is created by the instrumented library.
162-
It may be impossible or impractical to create the Span during event
163-
creation (e.g. inside the constructor or in a factory method),
164-
so instrumentation MAY create the Span later, when passing the event to the transport layer.
163+
It may be impossible or impractical to create the Span during event
164+
creation (e.g. inside the constructor or in a factory method),
165+
so instrumentation MAY create the Span later, when passing the event to the transport layer.
165166
- A CloudEvent is created outside of the instrumented library
166-
(e.g. directly constructed by the application owner, without calling a constructor or factory method),
167-
and passed without the Distributed Tracing Extension populated.
167+
(e.g. directly constructed by the application owner, without calling a constructor or factory method),
168+
and passed without the Distributed Tracing Extension populated.
168169

169170
In case a CloudEvent is passed to the instrumented library with the
170171
Distributed Tracing Extension already populated, instrumentation MUST NOT create
@@ -175,7 +176,7 @@ a span and MUST NOT modify the Distributed Tracing Extension on the event.
175176
- Span kind: PRODUCER
176177

177178
- Span attributes: Instrumentation MUST add the required attributes defined
178-
in the [table below](#attributes).
179+
in the [table below](#attributes).
179180

180181
#### Processing
181182

@@ -191,12 +192,13 @@ Instrumentation MAY add attributes to the link to further describe it.
191192
- Span kind: CONSUMER
192193

193194
- Span attributes: Instrumentation MUST add the required attributes defined
194-
in the [table below](#attributes).
195+
in the [table below](#attributes).
195196

196197
### Attributes
197198

198199
The following attributes are applicable to creation and processing Spans.
199200

201+
<!-- prettier-ignore-start -->
200202
<!-- semconv cloudevents -->
201203
| Attribute | Type | Description | Examples | Requirement Level |
202204
|---|---|---|---|---|
@@ -206,5 +208,6 @@ The following attributes are applicable to creation and processing Spans.
206208
| `cloudevents.event_type` | string | The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. | `com.github.pull_request.opened`; `com.example.object.deleted.v2` | Recommended |
207209
| `cloudevents.event_subject` | string | The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). | `mynewfile.jpg` | Recommended |
208210
<!-- endsemconv -->
211+
<!-- prettier-ignore-end -->
209212

210213
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md

package.json

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
2+
"scripts": {
3+
"_check:format": "npx prettier --check .",
4+
"_check:format:any": "npx prettier --check --ignore-path ''",
5+
"check": "make check",
6+
"check:format": "npm run _check:format || (echo '[help] Run: npm run format'; exit 1)",
7+
"fix": "make fix",
8+
"fix:format": "npm run _check:format -- --write",
9+
"test": "npm run check"
10+
},
211
"devDependencies": {
312
"gulp": "^4.0.2",
413
"js-yaml": "^4.1.0",

supplementary-guidelines/compatibility/aws.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Propagation headers must be added before the signature is calculated to prevent
2929
errors on signed requests. If injecting into the request itself (not just adding
3030
additional HTTP headers), additional considerations may apply (for example, the
3131
.NET AWS SDK calculates a hash of the attributes it sends and compares it with
32-
the `MD5OfMessageAttributes` that it receives).
32+
the `MD5OfMessageAttributes` that it receives).
3333

3434
The following formats are currently natively supported by AWS services for propagation:
3535

36-
* [AWS X-Ray](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html)
36+
- [AWS X-Ray](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html)
3737

3838
AWS service-supported context propagation is necessary to allow context propagation
3939
through AWS managed services, for example: `S3 -> SNS -> SQS -> Lambda`.

0 commit comments

Comments
 (0)