未验证 提交 10826068 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Fix bugs caused by #10085. Metrics w/o time prefix in ID could be missed in the cache. (#10117)

上级 4b7ec0ba
......@@ -44,6 +44,10 @@ public @interface MetricsExtension {
* @return true means the ID of this metric entity would generate timestamp related ID, such as 20170128-serviceId.
* If as false, then, ID would be like serviceId directly. This is typically used for metadata level metric, such as
* {@link org.apache.skywalking.oap.server.core.analysis.manual.service.ServiceTraffic}
*
* @since 9.4.0 `return false` could mean `not completely relevant`. Such as
* {@link org.apache.skywalking.oap.server.core.analysis.manual.searchtag.TagAutocompleteData}
* uses 20221108-tag-value as key, but time bucket is still in minute dimensionality, for example 202211081200.
*/
boolean timeRelativeID() default false;
}
......@@ -36,7 +36,10 @@ import org.apache.skywalking.oap.server.core.storage.type.StorageBuilder;
@Stream(name = TagAutocompleteData.INDEX_NAME, scopeId = DefaultScopeDefine.TAG_AUTOCOMPLETE,
builder = TagAutocompleteData.Builder.class, processor = MetricsStreamProcessor.class)
@MetricsExtension(supportDownSampling = false, supportUpdate = false, timeRelativeID = true)
// timeRelativeID=false at here doesn't mean the ID is completely irrelevant with time bucket.
// TagAutocompleteData still uses the day(toTimeBucketInDay()) as ID prefix,
// to make this tag tip feature doesn't host too large scale data.
@MetricsExtension(supportDownSampling = false, supportUpdate = false, timeRelativeID = false)
@EqualsAndHashCode(of = {
"tagKey",
"tagValue",
......
......@@ -367,6 +367,13 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> {
return cached;
}
// If the metrics do not have time bucket relative ID
// it is treated as high dimensionality metrics.
// Policy, always try load from the database when miss in the cache.
if (!model.isTimeRelativeID()) {
return null;
}
// When
// (1) the time bucket of the server's latest stability status is provided
// 1.1 the OAP has booted successfully
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册