| 1 |
#!/bin/sed -f |
| 2 |
|
| 3 |
# Rename package |
| 4 |
s+^package x+package otelconf+g |
| 5 |
|
| 6 |
# Remove experimental const definitions |
| 7 |
/^const Experimental/d |
| 8 |
|
| 9 |
# Remove single-line experimental type definitions (aliases to basic types) |
| 10 |
/^type Experimental.*\*int$/d |
| 11 |
/^type Experimental.*\*float64$/d |
| 12 |
/^type Experimental.*\*string$/d |
| 13 |
/^type Experimental.*\*bool$/d |
| 14 |
/^type Experimental.*string$/d |
| 15 |
/^type Experimental.*map\[string\]interface{}$/d |
| 16 |
/^type Experimental.*map\[string\]map\[string\]interface{}$/d |
| 17 |
|
| 18 |
# Remove array type definitions |
| 19 |
/^type Experimental.*\[\]Experimental/d |
| 20 |
|
| 21 |
# Remove multi-line experimental struct type definitions using address range |
| 22 |
/^type Experimental.*struct {$/,/^}$/d |
| 23 |
|
| 24 |
# Remove struct fields that reference Experimental types (including Development suffix fields) |
| 25 |
/^ .*Development.*\*Experimental/d |
| 26 |
/^ [A-Z][A-Za-z0-9_]* \*Experimental/d |
| 27 |
/^ [A-Z][A-Za-z0-9_]* Experimental[A-Z]/d |
| 28 |
/^ [A-Z][A-Za-z0-9_]* \[\]Experimental/d |
| 29 |
|
| 30 |
# Remove comment lines that reference experimental types |
| 31 |
/^[[:space:]]*\/\/ .*Experimental/d |
| 32 |
/^[[:space:]]*\/\/ A rule for Experimental/d |
| 33 |
|
| 34 |
# Remove comment blocks before experimental Development fields |
| 35 |
# Pattern: multi-line comment block ending with empty comment line, followed by Development field |
| 36 |
/^ \/\/ Configure exporter to be OTLP with file transport\.$/,/^ \/\/$/d |
| 37 |
/^ \/\/ Configure loggers\.$/,/^ \/\/$/d |
| 38 |
/^ \/\/ Configure meters\.$/,/^ \/\/$/d |
| 39 |
/^ \/\/ Configure instrumentation\.$/,/^ \/\/$/d |
| 40 |
/^ \/\/ Configure exporter to be prometheus\.$/,/^ \/\/$/d |
| 41 |
/^ \/\/ Configure resource detection\.$/,/^ \/\/$/d |
| 42 |
/^ \/\/ Configure sampler to be composite\.$/,/^ \/\/$/d |
| 43 |
/^ \/\/ Configure sampler to be jaeger_remote\.$/,/^ \/\/$/d |
| 44 |
/^ \/\/ Configure sampler to be probability\.$/,/^ \/\/$/d |
| 45 |
/^ \/\/ Configure tracers\.$/,/^ \/\/$/d |
| 46 |
|
| 47 |
# Remove orphaned top-level comment blocks (from deleted type definitions) |
| 48 |
# Probability sampler ratio comments |
| 49 |
/^\/\/ Configure ratio\.$/,/^$/d |
| 50 |
|
| 51 |
# Rule-based sampler comments |
| 52 |
/^\/\/ match conditions - the sampler will be applied/,/^$/d |
| 53 |
/^\/\/ The rules for the sampler, matched in order\./,/^$/d |
| 54 |
|
| 55 |
# Jaeger remote sampler comments |
| 56 |
/^\/\/ Configure the polling interval.*to fetch from the remote$/,/^$/d |
| 57 |
|
| 58 |
# Logger config comments |
| 59 |
/^\/\/ Configure if the logger is enabled or not\.$/,/^$/d |
| 60 |
/^\/\/ Configure trace based filtering\.$/,/^$/d |
| 61 |
|
| 62 |
# OTLP file exporter comments |
| 63 |
/^\/\/ Configure output stream\.$/,/^$/d |
| 64 |
|
| 65 |
# Prometheus exporter comments |
| 66 |
/^\/\/ Configure host\.$/,/^$/d |
| 67 |
/^\/\/ Configure port\.$/,/^$/d |
| 68 |
/^\/\/ Configure Prometheus Exporter to produce metrics without a scope info metric\.$/,/^$/d |
| 69 |
/^\/\/ Configure Prometheus Exporter to produce metrics without a target info metric$/,/^$/d |