Skip to content

Remove tracing oltp endpoint flag #6158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 13, 2024
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: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [CHANGE] Ingesters: Enable 'snappy-block' compression on ingester clients by default. #6148
* [CHANGE] Ruler: Scheduling `ruler.evaluation-delay-duration` to be deprecated. Use the highest value between `ruler.evaluation-delay-duration` and `ruler.query-offset` #6149
* [CHANGE] Querier: Remove `-querier.at-modifier-enabled` flag. #6157
* [CHANGE] Tracing: Remove deprecated `oltp_endpoint` config entirely. #6158
* [FEATURE] Ingester/Distributor: Experimental: Enable native histogram ingestion via `-blocks-storage.tsdb.enable-native-histograms` flag. #5986 #6010 #6020
* [FEATURE] Querier: Enable querying native histogram chunks. #5944 #6031
* [FEATURE] Query Frontend: Support native histogram in query frontend response. #5996 #6043
Expand Down
15 changes: 1 addition & 14 deletions pkg/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ type Config struct {
}

type Otel struct {
OltpEndpoint string `yaml:"oltp_endpoint" json:"oltp_endpoint" doc:"hidden"`
OtlpEndpoint string `yaml:"otlp_endpoint" json:"otlp_endpoint"`
ExporterType string `yaml:"exporter_type" json:"exporter_type"`
SampleRatio float64 `yaml:"sample_ratio" json:"sample_ratio"`
Expand All @@ -53,7 +52,6 @@ func (c *Config) RegisterFlags(f *flag.FlagSet) {
p := "tracing"
f.StringVar(&c.Type, p+".type", JaegerType, "Tracing type. OTEL and JAEGER are currently supported. For jaeger `JAEGER_AGENT_HOST` environment variable should also be set. See: https://cortexmetrics.io/docs/guides/tracing .")
f.Float64Var(&c.Otel.SampleRatio, p+".otel.sample-ratio", 0.001, "Fraction of traces to be sampled. Fractions >= 1 means sampling if off and everything is traced.")
f.StringVar(&c.Otel.OltpEndpoint, p+".otel.oltp-endpoint", "", "DEPRECATED: use otel.otlp-endpoint instead.")
f.StringVar(&c.Otel.OtlpEndpoint, p+".otel.otlp-endpoint", "", "otl collector endpoint that the driver will use to send spans.")
f.StringVar(&c.Otel.ExporterType, p+".otel.exporter-type", "", "enhance/modify traces/propagators for specific exporter. If empty, OTEL defaults will apply. Supported values are: `awsxray.`")
f.BoolVar(&c.Otel.TLSEnabled, p+".otel.tls-enabled", c.Otel.TLSEnabled, "Enable TLS in the GRPC client. This flag needs to be enabled when any other TLS flag is set. If set to false, insecure connection to gRPC server will be used.")
Expand All @@ -64,12 +62,9 @@ func (c *Config) RegisterFlags(f *flag.FlagSet) {
func (c *Config) Validate() error {
switch strings.ToLower(c.Type) {
case OtelType:
if (c.Otel.OtlpEndpoint == "") && (c.Otel.OltpEndpoint == "") {
if c.Otel.OtlpEndpoint == "" {
return errors.New("otlp-endpoint must be defined when using otel exporter")
}
if len(c.Otel.OltpEndpoint) > 0 {
level.Warn(util_log.Logger).Log("msg", "DEPRECATED: otel.oltp-endpoint is deprecated. Use otel.otlp-endpoint instead.")
}
}

return nil
Expand All @@ -90,15 +85,7 @@ func SetupTracing(ctx context.Context, name string, c Config) (func(context.Cont
case OtelType:
util_log.Logger.Log("msg", "creating otel exporter")

if (len(c.Otel.OtlpEndpoint) > 0) && (len(c.Otel.OltpEndpoint) > 0) {
level.Warn(util_log.Logger).Log("msg", "DEPRECATED: otel.otlp and otel.oltp both set, using otel.otlp because otel.oltp is deprecated")
}

endpoint := c.Otel.OtlpEndpoint
if (c.Otel.OtlpEndpoint == "") && (len(c.Otel.OltpEndpoint) > 0) {
level.Warn(util_log.Logger).Log("msg", "DEPRECATED: otel.oltp is deprecated use otel.otlp")
endpoint = c.Otel.OltpEndpoint
}
options := []otlptracegrpc.Option{
otlptracegrpc.WithEndpoint(endpoint),
}
Expand Down
Loading