You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[chore][docs] Use consistent title hierarchy (#12272)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
<!-- Issue number if applicable -->
Use h2 (hN-1) titles for h2 (hN-1) sections instead of h3 (hN)
Copy file name to clipboardExpand all lines: docs/coding-guidelines.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ for coding advice). The code must adhere to the following robustness principles
7
7
are important for software that runs autonomously and continuously without direct
8
8
interaction with a human (such as this Collector).
9
9
10
-
###Naming convention
10
+
## Naming convention
11
11
12
12
To keep naming patterns consistent across the project, naming patterns are enforced to make intent clear by:
13
13
@@ -38,7 +38,7 @@ To keep naming patterns consistent across the project, naming patterns are enfor
38
38
-`func CreateTracesExport(...) {...}`
39
39
-`func CreateTracesToTracesFunc(...) {...}`
40
40
41
-
####Configuration structs
41
+
### Configuration structs
42
42
43
43
When naming configuration structs, use the following guidelines:
44
44
@@ -47,7 +47,7 @@ When naming configuration structs, use the following guidelines:
47
47
- Use the `Settings` suffix for configuration structs that are set by developers in the code. For example, `component.TelemetrySettings` ends in `Settings` since it is set by developers in the code.
48
48
- Avoid redundant prefixes that are already implied by the package name. For example, use`configgrpc.ClientConfig` instead of `configgrpc.GRPCClientConfig`.
49
49
50
-
###Module organization
50
+
## Module organization
51
51
52
52
As usual in Go projects, organize your code into packages grouping related functionality. To ensure
53
53
that we can evolve different parts of the API independently, you should also group related packages
@@ -82,7 +82,7 @@ When adding a new module remember to update the following:
82
82
1. Open a follow up PR to update pseudo-versions in all go.mod files. See [this example
To keep naming patterns consistent across the project, enumeration patterns are enforced to make intent clear:
88
88
@@ -96,7 +96,7 @@ To keep naming patterns consistent across the project, enumeration patterns are
96
96
-`pmetric.MetricTypeGauge` for `pmetric.MetricType`
97
97
98
98
99
-
###Recommended Libraries / Defaults
99
+
## Recommended Libraries / Defaults
100
100
101
101
In order to simplify development within the project, we have made certain library recommendations that should be followed.
102
102
@@ -108,13 +108,13 @@ In order to simplify development within the project, we have made certain librar
108
108
109
109
Within the project, there are some packages that have yet to follow the recommendations and are being addressed. However, any new code should adhere to the recommendations.
110
110
111
-
###Default Configuration
111
+
## Default Configuration
112
112
113
113
To guarantee backward-compatible behavior, all configuration packages should supply a `NewDefault[config name]` functions that create a default version of the config. The package does not need to guarantee that `NewDefault[config name]` returns a usable configuration—only that default values will be set. For example, if the configuration requires that a field, such as `Endpoint` be set, but there is no valid default value, then `NewDefault[config name]` may set that value to `""` with the expectation that the user will set a valid value.
114
114
115
115
Users should always initialize the config struct with this function and overwrite anything as needed.
116
116
117
-
###Startup Error Handling
117
+
## Startup Error Handling
118
118
119
119
Verify configuration during startup and fail fast if the configuration is invalid.
120
120
This will bring the attention of a human to the problem as it is more typical for humans
@@ -126,15 +126,15 @@ explain the problem and exit with a non-zero code. It is acceptable to crash the
126
126
during startup if there is no good way to exit cleanly but do your best to log and
127
127
exit cleanly with a process exit code.
128
128
129
-
###Propagate Errors to the Caller
129
+
## Propagate Errors to the Caller
130
130
131
131
Do not crash or exit outside the `main()` function, e.g. via `log.Fatal` or `os.Exit`,
132
132
even during startup. Instead, return detailed errors to be handled appropriately
133
133
by the caller. The code in packages other than `main` may be imported and used by
134
134
third-party applications, and they should have full control over error handling
135
135
and process termination.
136
136
137
-
###Do not Crash after Startup
137
+
## Do not Crash after Startup
138
138
139
139
Do not crash or exit the Collector process after the startup sequence is finished.
140
140
A running Collector typically contains data that is received but not yet exported further
@@ -143,7 +143,7 @@ process will result in losing this data since typically the receiver has
143
143
already acknowledged the receipt for this data and the senders of the data will
144
144
not send that data again.
145
145
146
-
###Bad Input Handling
146
+
## Bad Input Handling
147
147
148
148
Do not crash on bad input in receivers or elsewhere in the pipeline.
0 commit comments