Skip to content

Commit

Permalink
Add schema modeling guidance to use wildcard syntax instead of regex (#…
Browse files Browse the repository at this point in the history
…71)

* Add schema modeling guidance to use wildcard syntax instead of regex

* Update guidance to include included, excluded properties
  • Loading branch information
jack-berg authored May 8, 2024
1 parent a87ec9e commit 28fe6c3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ Allowable changes:
- For major versions: All changes are permitted.
- For minor versions: TBD

## Naming guidelines
## Schema Modeling Guidelines

The following defines guidelines used to produce configuration schema:
The following guidelines are used to model the configuration schema:

1. To remove redundant information from the configuration file, prefixes for data produced by each of the providers
will be removed from configuration options. For example, under the `meter_provider` configuration, metric readers will be
identified by the word `readers` rather than by `metric_readers`. Similarly, the prefix `span_` will be dropped for tracer
provider configuration, and `logrecord` for logger provider.
* To remove redundant information from the configuration file, prefixes for data produced by each of the providers will be removed from configuration options. For example, under the `meter_provider` configuration, metric readers will be identified by the word `readers` rather than by `metric_readers`. Similarly, the prefix `span_` will be dropped for tracer provider configuration, and `logrecord` for logger provider.
* Use wildcard `*` (match any number of any character, including none) and `?` (match any single character) instead of regex. If a single property with wildcards is likely to be insufficient, accept `included` and `excluded` properties, each with an array of strings with wildcard entries. The wildcard entries should be joined with a logical OR. If `included` is not specified, assume that all entries are included. Apply `excluded` after applying `included`. Examples:
* Given `excluded: ["a*"]`: Match all except values starting with `a`.
* Given `included: ["a*", "b*"]`, `excluded: ["ab*"]`: Match any value starting with `a` or `b`, excluding values starting with `ab`.
* Given `included: ["a", "b"]`, `excluded: ["a"]`: Match values equal to `b`.

0 comments on commit 28fe6c3

Please sign in to comment.