Skip to content

Commit 2ea44e7

Browse files
authored
BanyanDB: fix query getInstance by instance ID. (#13549)
1 parent f451792 commit 2ea44e7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
* Fix the malfunctioning alarm feature of MAL metrics due to unknown metadata in L2 aggregate worker.
111111
* Make MAL percentile align with OAL percentile calculation.
112112
* Update Grafana dashboards for OAP observability.
113+
* BanyanDB: fix query `getInstance` by instance ID.
113114

114115
#### UI
115116

oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/measure/BanyanDBMetadataQueryDAO.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,14 @@ protected void apply(MeasureQuery query) {
144144

145145
@Override
146146
public ServiceInstance getInstance(String instanceId) throws IOException {
147-
IDManager.ServiceInstanceID.InstanceIDDefinition id = IDManager.ServiceInstanceID.analysisId(instanceId);
148147
MetadataRegistry.Schema schema = MetadataRegistry.INSTANCE.findMetricMetadata(InstanceTraffic.INDEX_NAME, DownSampling.Minute);
149148
MeasureQueryResponse resp = query(false, schema,
150149
INSTANCE_TRAFFIC_TAGS,
151150
Collections.emptySet(),
152151
new QueryBuilder<MeasureQuery>() {
153152
@Override
154153
protected void apply(MeasureQuery query) {
155-
query.and(eq(InstanceTraffic.SERVICE_ID, id.getServiceId()))
156-
.and(eq(InstanceTraffic.NAME, id.getName()));
154+
query.and(eq(ID, instanceId));
157155
}
158156
});
159157
return resp.size() > 0 ? buildInstance(resp.getDataPoints().get(0), schema) : null;

0 commit comments

Comments
 (0)