Skip to content

Commit d24c66c

Browse files
authored
fix(key): Revert support for ( and ) as name/group, as they already worked before (#1356)
Relevant: #1340
1 parent 70d7d0c commit d24c66c

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ or send an HTTP request:
366366
POST /api/v1/endpoints/{key}/external?success={success}&error={error}&duration={duration}
367367
```
368368
Where:
369-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
369+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
370370
- Using the example configuration above, the key would be `core_ext-ep-test`.
371371
- `{success}` is a boolean (`true` or `false`) value indicating whether the health check was successful or not.
372372
- `{error}` (optional): a string describing the reason for a failed health check. If {success} is false, this should contain the error message; if the check is successful.
@@ -2298,14 +2298,14 @@ endpoints:
22982298

22992299
> ⚠️ **WARNING**: This alerting provider has not been tested yet. If you've tested it and confirmed that it works, please remove this warning and create a pull request, or comment on [#1223](https://github.com/TwiN/gatus/discussions/1223) with whether the provider works as intended. Thank you for your cooperation.
23002300

2301-
| Parameter | Description | Default |
2302-
|:-------------------------------|:-------------------------------------------------------------------------------------------|:--------------|
2303-
| `alerting.webex` | Configuration for alerts of type `webex` | `{}` |
2304-
| `alerting.webex.webhook-url` | Webex Teams webhook URL | Required `""` |
2305-
| `alerting.webex.default-alert` | Default alert configuration. <br />See [Setting a default alert](#setting-a-default-alert) | N/A |
2306-
| `alerting.webex.overrides` | List of overrides that may be prioritized over the default configuration | `[]` |
2307-
| `alerting.webex.overrides[].group` | Endpoint group for which the configuration will be overridden by this configuration | `""` |
2308-
| `alerting.webex.overrides[].*` | See `alerting.webex.*` parameters | `{}` |
2301+
| Parameter | Description | Default |
2302+
|:-----------------------------------|:-------------------------------------------------------------------------------------------|:--------------|
2303+
| `alerting.webex` | Configuration for alerts of type `webex` | `{}` |
2304+
| `alerting.webex.webhook-url` | Webex Teams webhook URL | Required `""` |
2305+
| `alerting.webex.default-alert` | Default alert configuration. <br />See [Setting a default alert](#setting-a-default-alert) | N/A |
2306+
| `alerting.webex.overrides` | List of overrides that may be prioritized over the default configuration | `[]` |
2307+
| `alerting.webex.overrides[].group` | Endpoint group for which the configuration will be overridden by this configuration | `""` |
2308+
| `alerting.webex.overrides[].*` | See `alerting.webex.*` parameters | `{}` |
23092309

23102310
```yaml
23112311
alerting:
@@ -2357,7 +2357,7 @@ endpoints:
23572357
#### Configuring Zulip alerts
23582358
| Parameter | Description | Default |
23592359
|:-----------------------------------|:------------------------------------------------------------------------------------|:--------------|
2360-
| `alerting.zulip` | Configuration for alerts of type `zulip` | `{}` |
2360+
| `alerting.zulip` | Configuration for alerts of type `zulip` | `{}` |
23612361
| `alerting.zulip.bot-email` | Bot Email | Required `""` |
23622362
| `alerting.zulip.bot-api-key` | Bot API key | Required `""` |
23632363
| `alerting.zulip.domain` | Full organization domain (e.g.: yourZulipDomain.zulipchat.com) | Required `""` |
@@ -3297,7 +3297,7 @@ The path to generate a badge is the following:
32973297
```
32983298
Where:
32993299
- `{duration}` is `30d`, `7d`, `24h` or `1h`
3300-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
3300+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
33013301

33023302
For instance, if you want the uptime during the last 24 hours from the endpoint `frontend` in the group `core`,
33033303
the URL would look like this:
@@ -3323,7 +3323,7 @@ The path to generate a badge is the following:
33233323
/api/v1/endpoints/{key}/health/badge.svg
33243324
```
33253325
Where:
3326-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
3326+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
33273327

33283328
For instance, if you want the current status of the endpoint `frontend` in the group `core`,
33293329
the URL would look like this:
@@ -3340,7 +3340,7 @@ The path to generate a badge is the following:
33403340
/api/v1/endpoints/{key}/health/badge.shields
33413341
```
33423342
Where:
3343-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
3343+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
33443344

33453345
For instance, if you want the current status of the endpoint `frontend` in the group `core`,
33463346
the URL would look like this:
@@ -3363,7 +3363,7 @@ The endpoint to generate a badge is the following:
33633363
```
33643364
Where:
33653365
- `{duration}` is `30d`, `7d`, `24h` or `1h`
3366-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
3366+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
33673367

33683368
#### Response time (chart)
33693369
![Response time 24h](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/24h/chart.svg)
@@ -3376,7 +3376,7 @@ The endpoint to generate a response time chart is the following:
33763376
```
33773377
Where:
33783378
- `{duration}` is `30d`, `7d`, or `24h`
3379-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
3379+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
33803380

33813381
##### How to change the color thresholds of the response time badge
33823382
To change the response time badges' threshold, a corresponding configuration can be added to an endpoint.
@@ -3434,7 +3434,7 @@ The path to get raw uptime data for an endpoint is:
34343434
```
34353435
Where:
34363436
- `{duration}` is `30d`, `7d`, `24h` or `1h`
3437-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
3437+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
34383438

34393439
For instance, if you want the raw uptime data for the last 24 hours from the endpoint `frontend` in the group `core`, the URL would look like this:
34403440
```
@@ -3448,7 +3448,7 @@ The path to get raw response time data for an endpoint is:
34483448
```
34493449
Where:
34503450
- `{duration}` is `30d`, `7d`, `24h` or `1h`
3451-
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `(`, `)`, `+` and `&` replaced by `-`.
3451+
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.
34523452

34533453
For instance, if you want the raw response time data for the last 24 hours from the endpoint `frontend` in the group `core`, the URL would look like this:
34543454
```

config/key/key.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ func sanitize(s string) string {
1515
s = strings.ReplaceAll(s, ",", "-")
1616
s = strings.ReplaceAll(s, " ", "-")
1717
s = strings.ReplaceAll(s, "#", "-")
18-
s = strings.ReplaceAll(s, "(", "-")
19-
s = strings.ReplaceAll(s, ")", "-")
2018
s = strings.ReplaceAll(s, "+", "-")
2119
s = strings.ReplaceAll(s, "&", "-")
2220
return s

config/key/key_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ func TestConvertGroupAndNameToKey(t *testing.T) {
3232
{
3333
GroupName: "API (v1)",
3434
Name: "endpoint",
35-
ExpectedOutput: "api--v1-_endpoint",
35+
ExpectedOutput: "api-(v1)_endpoint",
3636
},
3737
{
3838
GroupName: "website (admin)",
3939
Name: "test",
40-
ExpectedOutput: "website--admin-_test",
40+
ExpectedOutput: "website-(admin)_test",
4141
},
4242
{
4343
GroupName: "search",

0 commit comments

Comments
 (0)