-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[installer]: add jaeger sampling options to the tracing object
This also adds the concept of experimental configuration. Mostly, this is for unsupported SaaS config or things which are useful when used in a controlled environment. An experimental feature may be promoted to the main config or dropped without warning.
- Loading branch information
Simon Emms
committed
Jan 25, 2022
1 parent
af763f2
commit 8109412
Showing
5 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) 2022 Gitpod GmbH. All rights reserved. | ||
// Licensed under the GNU Affero General Public License (AGPL). | ||
// See License-AGPL.txt in the project root for license information. | ||
|
||
package experimental | ||
|
||
type Config struct { | ||
Observability *Observability `json:"observability"` | ||
} | ||
|
||
type Observability struct { | ||
Tracing *Tracing `json:"tracing,omitempty"` | ||
} | ||
|
||
type Tracing struct { | ||
SamplerType *TracingSampleType `json:"samplerType,omitempty" validate:"omitempty,tracing_sampler_type"` | ||
SamplerParam *float64 `json:"samplerParam,omitEmpty" validate:"required_with=SamplerType"` | ||
} | ||
|
||
type TracingSampleType string | ||
|
||
// Values taken from https://github.com/jaegertracing/jaeger-client-go/blob/967f9c36f0fa5a2617c9a0993b03f9a3279fadc8/config/config.go#L71 | ||
const ( | ||
TracingSampleTypeConst TracingSampleType = "const" | ||
TracingSampleTypeProbabilistic TracingSampleType = "probabilistic" | ||
TracingSampleTypeRateLimiting TracingSampleType = "rateLimiting" | ||
TracingSampleTypeRemote TracingSampleType = "remote" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2022 Gitpod GmbH. All rights reserved. | ||
// Licensed under the GNU Affero General Public License (AGPL). | ||
// See License-AGPL.txt in the project root for license information. | ||
|
||
package experimental | ||
|
||
import "github.com/go-playground/validator/v10" | ||
|
||
var TracingSampleTypeList = map[TracingSampleType]struct{}{ | ||
TracingSampleTypeConst: {}, | ||
TracingSampleTypeProbabilistic: {}, | ||
TracingSampleTypeRateLimiting: {}, | ||
TracingSampleTypeRemote: {}, | ||
} | ||
|
||
var ValidationChecks = map[string]validator.Func{ | ||
"tracing_sampler_type": func(fl validator.FieldLevel) bool { | ||
_, ok := TracingSampleTypeList[TracingSampleType(fl.Field().String())] | ||
return ok | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters