Skip to content

Commit cf6dd30

Browse files
authored
Merge 0cd817a into c19f4b2
2 parents c19f4b2 + 0cd817a commit cf6dd30

File tree

11 files changed

+49
-49
lines changed

11 files changed

+49
-49
lines changed

ydb/core/cms/console/jaeger_tracing_configurator.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ TSettings<double, TThrottlingSettings> TJaegerTracingConfigurator::GetSettings(c
9797
<< samplingRule.ShortDebugString() << ". Skipping the rule");
9898
continue;
9999
}
100-
if (!samplingRule.HasLevel() || !samplingRule.HasFraction() || !samplingRule.HasMaxRatePerMinute()) {
100+
if (!samplingRule.HasLevel() || !samplingRule.HasFraction() || !samplingRule.HasMaxTracesPerMinute()) {
101101
ALOG_ERROR(NKikimrServices::CMS_CONFIGS, "missing required fields in rule " << samplingRule.ShortDebugString()
102-
<< " (required fields are: level, fraction, max_rate_per_minute). Skipping the rule");
102+
<< " (required fields are: level, fraction, max_traces_per_minute). Skipping the rule");
103103
continue;
104104
}
105-
if (samplingRule.GetMaxRatePerMinute() == 0) {
106-
ALOG_ERROR(NKikimrServices::CMS_CONFIGS, "max_rate_per_minute should never be zero. Found in rule " << samplingRule.GetMaxRatePerMinute()
105+
if (samplingRule.GetMaxTracesPerMinute() == 0) {
106+
ALOG_ERROR(NKikimrServices::CMS_CONFIGS, "max_traces_per_minute should never be zero. Found in rule " << samplingRule.GetMaxTracesPerMinute()
107107
<< ". Skipping the rule");
108108
continue;
109109
}
@@ -125,8 +125,8 @@ TSettings<double, TThrottlingSettings> TJaegerTracingConfigurator::GetSettings(c
125125
.Level = static_cast<ui8>(level),
126126
.Sampler = fraction,
127127
.Throttler = TThrottlingSettings {
128-
.MaxRatePerMinute = samplingRule.GetMaxRatePerMinute(),
129-
.MaxBurst = samplingRule.GetMaxBurst(),
128+
.MaxTracesPerMinute = samplingRule.GetMaxTracesPerMinute(),
129+
.MaxTracesBurst = samplingRule.GetMaxTracesBurst(),
130130
},
131131
};
132132
settings.SamplingRules[static_cast<size_t>(requestType)].push_back(rule);
@@ -142,31 +142,31 @@ TSettings<double, TThrottlingSettings> TJaegerTracingConfigurator::GetSettings(c
142142
continue;
143143
}
144144

145-
if (!throttlingRule.HasMaxRatePerMinute()) {
146-
ALOG_ERROR(NKikimrServices::CMS_CONFIGS, "missing required field max_rate_per_minute in rule "
145+
if (!throttlingRule.HasMaxTracesPerMinute()) {
146+
ALOG_ERROR(NKikimrServices::CMS_CONFIGS, "missing required field max_traces_per_minute in rule "
147147
<< throttlingRule.ShortDebugString() << ". Skipping the rule");
148148
continue;
149149
}
150-
if (throttlingRule.GetMaxRatePerMinute() == 0) {
151-
ALOG_ERROR(NKikimrServices::CMS_CONFIGS, "max_rate_per_minute should never be zero. Found in rule " << throttlingRule.GetMaxRatePerMinute()
150+
if (throttlingRule.GetMaxTracesPerMinute() == 0) {
151+
ALOG_ERROR(NKikimrServices::CMS_CONFIGS, "max_traces_per_minute should never be zero. Found in rule " << throttlingRule.GetMaxTracesPerMinute()
152152
<< ". Skipping the rule");
153153
continue;
154154
}
155155

156-
ui64 maxRatePerMinute = throttlingRule.GetMaxRatePerMinute();
157-
ui64 maxBurst = throttlingRule.GetMaxBurst();
156+
ui64 maxRatePerMinute = throttlingRule.GetMaxTracesPerMinute();
157+
ui64 maxBurst = throttlingRule.GetMaxTracesBurst();
158158
TExternalThrottlingRule<TThrottlingSettings> rule {
159159
.Throttler = TThrottlingSettings {
160-
.MaxRatePerMinute = maxRatePerMinute,
161-
.MaxBurst = maxBurst,
160+
.MaxTracesPerMinute = maxRatePerMinute,
161+
.MaxTracesBurst = maxBurst,
162162
},
163163
};
164164
auto& currentRule = settings.ExternalThrottlingRules[static_cast<size_t>(requestType)];
165165
if (currentRule) {
166166
ALOG_WARN(NKikimrServices::CMS_CONFIGS, "duplicate external throttling rule for scope "
167167
<< throttlingRule.GetScope() << ". Adding the limits");
168-
currentRule->Throttler.MaxBurst += rule.Throttler.MaxBurst;
169-
currentRule->Throttler.MaxRatePerMinute += rule.Throttler.MaxRatePerMinute;
168+
currentRule->Throttler.MaxTracesBurst += rule.Throttler.MaxTracesBurst;
169+
currentRule->Throttler.MaxTracesPerMinute += rule.Throttler.MaxTracesPerMinute;
170170
} else {
171171
currentRule = rule;
172172
}
@@ -176,8 +176,8 @@ TSettings<double, TThrottlingSettings> TJaegerTracingConfigurator::GetSettings(c
176176
if (cfg.GetExternalThrottling().empty()){
177177
TExternalThrottlingRule<TThrottlingSettings> rule {
178178
.Throttler = TThrottlingSettings {
179-
.MaxRatePerMinute = Max<ui64>(),
180-
.MaxBurst = 0,
179+
.MaxTracesPerMinute = Max<ui64>(),
180+
.MaxTracesBurst = 0,
181181
},
182182
};
183183

ydb/core/driver_lib/run/kikimr_services_initializers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ void TBasicServicesInitializer::InitializeServices(NActors::TActorSystemSetup* s
866866
uploaderParams.field = uploaderConfig.Get##field(); \
867867
}
868868

869-
GET_FIELD_FROM_CONFIG(MaxSpansPerSecond)
869+
GET_FIELD_FROM_CONFIG(MaxExportedSpansPerSecond)
870870
GET_FIELD_FROM_CONFIG(MaxSpansInBatch)
871871
GET_FIELD_FROM_CONFIG(MaxBytesInBatch)
872872
GET_FIELD_FROM_CONFIG(SpanExportTimeoutSeconds)

ydb/core/jaeger_tracing/sampling_throttling_configurator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void TSamplingThrottlingConfigurator::UpdateSettings(TSettings<double, TThrottli
3333
TSettings<double, TIntrusivePtr<TThrottler>> TSamplingThrottlingConfigurator::GenerateThrottlers(
3434
TSettings<double, TThrottlingSettings> settings) {
3535
return settings.MapThrottler([this](const TThrottlingSettings& settings) {
36-
return MakeIntrusive<TThrottler>(settings.MaxRatePerMinute, settings.MaxBurst, TimeProvider);
36+
return MakeIntrusive<TThrottler>(settings.MaxTracesPerMinute, settings.MaxTracesBurst, TimeProvider);
3737
});
3838
}
3939

ydb/core/jaeger_tracing/settings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
namespace NKikimr::NJaegerTracing {
1010

1111
struct TThrottlingSettings {
12-
ui64 MaxRatePerMinute;
13-
ui64 MaxBurst;
12+
ui64 MaxTracesPerMinute;
13+
ui64 MaxTracesBurst;
1414
};
1515

1616
template<class TSampling, class TThrottling>

ydb/core/jaeger_tracing/throttler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
namespace NKikimr::NJaegerTracing {
66

77
TThrottler::TThrottler(ui64 maxRatePerMinute, ui64 maxBurst, TIntrusivePtr<ITimeProvider> timeProvider)
8-
: MaxRatePerMinute(maxRatePerMinute)
9-
, MaxBurst(maxBurst + 1)
10-
, BetweenSends(TDuration::Minutes(1).MicroSeconds() / MaxRatePerMinute)
8+
: MaxTracesPerMinute(maxRatePerMinute)
9+
, MaxTracesBurst(maxBurst + 1)
10+
, BetweenSends(TDuration::Minutes(1).MicroSeconds() / MaxTracesPerMinute)
1111
, TimeProvider(std::move(timeProvider))
1212
, EffectiveTs(TimeProvider->Now().MicroSeconds())
1313
{}
1414

1515
bool TThrottler::Throttle() {
1616
auto now = TimeProvider->Now().MicroSeconds();
1717
auto ts = EffectiveTs.load(std::memory_order_relaxed);
18-
auto maxFinalTs = ClampAdd(now, ClampMultiply(BetweenSends, MaxBurst));
18+
auto maxFinalTs = ClampAdd(now, ClampMultiply(BetweenSends, MaxTracesBurst));
1919
while (true) {
2020
if (ts < now) {
2121
if (EffectiveTs.compare_exchange_weak(ts, now + BetweenSends, std::memory_order_relaxed)) {

ydb/core/jaeger_tracing/throttler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class TThrottler: public TThrRefBase {
1515
static ui64 ClampAdd(ui64 a, ui64 b);
1616
static ui64 ClampMultiply(ui64 a, ui64 b);
1717

18-
const ui64 MaxRatePerMinute;
19-
const ui64 MaxBurst;
18+
const ui64 MaxTracesPerMinute;
19+
const ui64 MaxTracesBurst;
2020
const ui64 BetweenSends;
2121
TIntrusivePtr<ITimeProvider> TimeProvider;
2222
std::atomic<ui64> EffectiveTs;

ydb/core/protos/config.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,21 +1554,21 @@ message TTracingConfig {
15541554
// detalisation of traces sampled by this rule
15551555
optional uint32 Level = 3;
15561556
// maximum average amount of traces sampled by this rule
1557-
optional uint64 MaxRatePerMinute = 4;
1557+
optional uint64 MaxTracesPerMinute = 4;
15581558
// maximum burst of traces sampled by this rule
1559-
optional uint64 MaxBurst = 5;
1559+
optional uint64 MaxTracesBurst = 5;
15601560
}
15611561

15621562
// field meaning is the same as in TSamplingScope
15631563
message TExternalThrottlingScope {
15641564
optional TSelectors Scope = 1;
1565-
optional uint64 MaxRatePerMinute = 2;
1566-
optional uint64 MaxBurst = 3;
1565+
optional uint64 MaxTracesPerMinute = 2;
1566+
optional uint64 MaxTracesBurst = 3;
15671567
}
15681568

15691569
message TUploaderConfig {
15701570
// maximum average amount of spans uploaded from the node
1571-
optional uint64 MaxSpansPerSecond = 1;
1571+
optional uint64 MaxExportedSpansPerSecond = 1;
15721572
// maximum batch size in spans
15731573
optional uint64 MaxSpansInBatch = 2;
15741574
// maximum batch size in bytes

ydb/library/actors/wilson/wilson_uploader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ namespace NWilson {
128128

129129
public:
130130
TWilsonUploader(WilsonUploaderParams params)
131-
: MaxSpansPerSecond(params.MaxSpansPerSecond)
131+
: MaxSpansPerSecond(params.MaxExportedSpansPerSecond)
132132
, MaxSpansInBatch(params.MaxSpansInBatch)
133133
, MaxBytesInBatch(params.MaxBytesInBatch)
134134
, MaxBatchAccumulation(params.MaxBatchAccumulation)

ydb/library/actors/wilson/wilson_uploader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace NWilson {
3030
TString ServiceName;
3131
std::unique_ptr<IGrpcSigner> GrpcSigner;
3232

33-
ui64 MaxSpansPerSecond = Max<ui64>();
33+
ui64 MaxExportedSpansPerSecond = Max<ui64>();
3434
ui64 MaxSpansInBatch = 150;
3535
ui64 MaxBytesInBatch = 20'000'000;
3636
ui64 MaxBatchAccumulationMilliseconds = 1'000;

ydb/tools/cfg/static.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,17 +1137,17 @@ def get_sampling_scope(sampling):
11371137
sampling_scope_pb.Scope.CopyFrom(get_selectors(selectors))
11381138
sampling_scope_pb.Fraction = sampling['fraction']
11391139
sampling_scope_pb.Level = sampling['level']
1140-
sampling_scope_pb.MaxRatePerMinute = sampling['max_rate_per_minute']
1141-
sampling_scope_pb.MaxBurst = sampling.get('max_burst', 0)
1140+
sampling_scope_pb.MaxTracesPerMinute = sampling['max_traces_per_minute']
1141+
sampling_scope_pb.MaxTracesBurst = sampling.get('max_traces_burst', 0)
11421142
return sampling_scope_pb
11431143

11441144
def get_external_throttling(throttling):
11451145
throttling_scope_pb = config_pb2.TTracingConfig.TExternalThrottlingScope()
11461146
selectors = throttling.get("scope")
11471147
if selectors is not None:
11481148
throttling_scope_pb.Scope.CopyFrom(get_selectors(selectors))
1149-
throttling_scope_pb.MaxRatePerMinute = throttling['max_rate_per_minute']
1150-
throttling_scope_pb.MaxBurst = throttling.get('max_burst', 0)
1149+
throttling_scope_pb.MaxTracesPerMinute = throttling['max_traces_per_minute']
1150+
throttling_scope_pb.MaxTracesBurst = throttling.get('max_traces_burst', 0)
11511151
return throttling_scope_pb
11521152

11531153
def get_auth_config(auth):
@@ -1196,9 +1196,9 @@ def get_backend(backend):
11961196
def get_uploader(uploader):
11971197
uploader_pb = config_pb2.TTracingConfig.TUploaderConfig()
11981198

1199-
max_spans_per_second = uploader.get("max_spans_per_second")
1200-
if max_spans_per_second is not None:
1201-
uploader_pb.MaxSpansPerSecond = max_spans_per_second
1199+
max_exported_spans_per_second = uploader.get("max_exported_spans_per_second")
1200+
if max_exported_spans_per_second is not None:
1201+
uploader_pb.MaxExportedSpansPerSecond = max_exported_spans_per_second
12021202

12031203
max_spans_in_batch = uploader.get("max_spans_in_batch")
12041204
if max_spans_in_batch is not None:

ydb/tools/cfg/validation.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
uploader=dict(
176176
type="object",
177177
properties=dict(
178-
max_spans_per_second=dict(type="integer", minimum=1),
178+
max_exported_spans_per_second=dict(type="integer", minimum=1),
179179
max_spans_in_batch=dict(type="integer", minimum=1),
180180
max_bytes_in_batch=dict(type="integer"),
181181
max_batch_accumulation_milliseconds=dict(type="integer"),
@@ -192,10 +192,10 @@
192192
scope=SELECTORS_CONFIGS,
193193
fraction=dict(type="number", minimum=0, maximum=1),
194194
level=dict(type="integer", minimum=0, maximum=15),
195-
max_rate_per_minute=dict(type="integer", minimum=0),
196-
max_burst=dict(type="integer", minimum=0),
195+
max_traces_per_minute=dict(type="integer", minimum=0),
196+
max_traces_burst=dict(type="integer", minimum=0),
197197
),
198-
required=["fraction", "level", "max_rate_per_minute"],
198+
required=["fraction", "level", "max_traces_per_minute"],
199199
),
200200
),
201201
external_throttling=dict(
@@ -204,10 +204,10 @@
204204
type="object",
205205
properties=dict(
206206
scope=SELECTORS_CONFIGS,
207-
max_rate_per_minute=dict(type="integer", minimum=0),
208-
max_burst=dict(type="integer", minimum=0),
207+
max_traces_per_minute=dict(type="integer", minimum=0),
208+
max_traces_burst=dict(type="integer", minimum=0),
209209
),
210-
required=["max_rate_per_minute"],
210+
required=["max_traces_per_minute"],
211211
),
212212
),
213213
),

0 commit comments

Comments
 (0)