Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/agents/knowledge/general-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ When a "Knowledge File" is listed, load it from `knowledge/` before reviewing th
| Style | Style guide | Always | — |
| Style | Uppercase field names should reflect semantic constants or immutable value constants such as `Duration` timeouts/intervals, not simply `static final` | Always | — |
| Naming | Getter naming (`get` / `is`) | Always | — |
| Naming | Boolean/collection option naming (`set*Enabled`, `setCapture*`, `setEmitExperimental*`) | `Experimental` or `TelemetryBuilder` setter changes | `library-patterns.md` |
| Naming | Module/package naming | New or renamed modules/packages | `module-naming.md` |
| Javaagent | Advice patterns | `@Advice` classes | `javaagent-advice-patterns.md` |
| Javaagent | Module structure patterns | `InstrumentationModule`, `TypeInstrumentation`, `Singletons` | `javaagent-module-patterns.md` |
Expand Down
29 changes: 0 additions & 29 deletions .github/agents/knowledge/library-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,3 @@ public final class MyLibraryTelemetry {
- Builder setter methods return `this` and are annotated `@CanIgnoreReturnValue`.
- The builder's constructor is package-private — only `Telemetry.builder()` creates it.
- `build()` returns the `{Library}Telemetry` instance.

## Boolean and Collection Option Naming

Builder methods on `TelemetryBuilder` and `Experimental` classes must follow these
naming patterns. Flag any new method that deviates.

### Canonical patterns

| Semantic | Pattern | Examples |
| --- | --- | --- |
| Feature on/off toggle | `set*Enabled(boolean)` | `setSqlCommenterEnabled`, `setQuerySanitizationEnabled`, `setDataSourceInstrumenterEnabled` |
| Emit experimental signals | `setEmitExperimental*(boolean)` | `setEmitExperimentalTelemetry`, `setEmitExperimentalMetrics` |
| Capture data (boolean) | `setCapture*(boolean)` | `setCaptureExperimentalSpanAttributes`, `setCaptureEnduserId`, `setCaptureQuery` |
| Capture data (collection) | `setCapture*(Collection)` | `setCaptureRequestHeaders`, `setCaptureResponseHeaders`, `setCaptureRequestParameters` |

### Rules

- **`set*Enabled`** is for features that are turned on or off (sanitization, SQL commenter,
instrumenter toggles). The thing being named is a feature or processing step.
- **`setCapture*`** is for options that control whether a piece of data is collected or
emitted (attributes, headers, query text, message content). Use the verb form for both
boolean and collection variants.
- **`setEmitExperimental*`** is reserved for the `Experimental` class toggle that enables
all experimental telemetry for an instrumentation. Do not use on `TelemetryBuilder`.

### Known exceptions

- `setPreferJfrMetrics(boolean)` — selects JFR over JMX for overlapping metrics; it is a
strategy selector, not a feature toggle or data capture flag.
Loading