Skip to content
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
16 changes: 13 additions & 3 deletions docs/en/api/query-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ extend type Query {
queryBasicTraces(condition: TraceQueryCondition, debug: Boolean): TraceBrief
queryBasicTracesByName(condition: TraceQueryConditionByName, debug: Boolean): TraceBrief
# Read the specific trace ID with given trace ID
queryTrace(traceId: ID!, debug: Boolean): Trace
# Only for BanyanDB, can be used to query the trace in the cold stage.
queryTraceFromColdStage(traceId: ID!, duration: Duration!, debug: Boolean): Trace
# duration is optional, and only for BanyanDB. If not provided, means search in the last 1 day.
queryTrace(traceId: ID!, duration: Duration, debug: Boolean): Trace
# Read the list of searchable keys
queryTraceTagAutocompleteKeys(duration: Duration!):[String!]
# Search the available value options of the given key.
Expand All @@ -181,6 +180,17 @@ extend type Query {

Trace query fetches trace segment lists and spans of given trace IDs.

### Trace-v2
```graphql
extend type Query {
queryTraces(condition: TraceQueryCondition, debug: Boolean): TraceList
# Feature detection endpoint: returns true if the backend supports the Query Traces V2 API.
# Returns false if the backend does not support Query Traces V2.
# This field is intended to assist clients in migrating to the new API.
hasQueryTracesV2Support: Boolean!
}
```

### Alarm
```graphql
extend type Query {
Expand Down
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
* Fix potential NPE in the `AlarmStatusQueryHandler`.
* Aggregate TopN Slow SQL by service dimension.
* BanyanDB: support add group prefix (namespace) for BanyanDB groups.
* BanyanDB: fix when setting `@BanyanDB.TimestampColumn`, the column should not be indexed.

#### UI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public class SegmentRecord extends Record implements BanyanDBTrace {
@Getter
@ElasticSearch.EnableDocValues
@Column(name = START_TIME)
@BanyanDB.NoIndexing
private long startTime;
@Setter
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public class SWSpanAttachedEventRecord extends Record implements BanyanDBTrace,
@Getter
@ElasticSearch.EnableDocValues
@Column(name = TIMESTAMP)
@BanyanDB.NoIndexing
private long timestamp;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public class SpanAttachedEventRecord extends Record implements BanyanDBTrace, Ba
@Getter
@ElasticSearch.EnableDocValues
@Column(name = TIMESTAMP)
@BanyanDB.NoIndexing
private long timestamp;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public class EBPFProfilingTaskRecord extends NoneStream {
private int targetType = EBPFProfilingTargetType.UNKNOWN.value();
@ElasticSearch.EnableDocValues
@Column(name = CREATE_TIME)
@BanyanDB.NoIndexing
private long createTime;
@Column(name = LAST_UPDATE_TIME)
private long lastUpdateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public StorageID id() {
private String taskId;
@ElasticSearch.EnableDocValues
@Column(name = START_TIME)
@BanyanDB.NoIndexing
private long startTime;
@Column(name = DURATION)
private int duration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public class ProfileThreadSnapshotRecord extends Record {
private String segmentId;
@ElasticSearch.EnableDocValues
@Column(name = DUMP_TIME)
@BanyanDB.NoIndexing
private long dumpTime;
@ElasticSearch.EnableDocValues
@Column(name = SEQUENCE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
/**
* Force disabling indexing declare through {@link Column}.
* In BanyanDB, some additional conditions could be done in server memory, no indexing required in this case.
*
* In the Trace model, no indexing means no tag would be created in BanyanDB.
* In the Stream model, no indexing means no index rule would be created in BanyanDB.
* @since 9.1.0
*/
@Target({ElementType.FIELD})
Expand Down Expand Up @@ -148,9 +149,9 @@ enum IndexType {
}

/**
* timestampColumn is to identify which column in {@link Record} is providing the timestamp(millisecond) for
* BanyanDB.
* timestampColumn is to identify which column in {@link Record} is providing the timestamp(millisecond) for BanyanDB.
* BanyanDB stream requires a timestamp in milliseconds.
* Notice, the timestamp column would not create an index rule in BanyanDB.
*
* @since 9.3.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public ModelColumn(ColumnName columnName,
}

/**
* Notice, for BanyanDB, should use {@link BanyanDBExtension#shouldIndex()} instead.
* @return true means this column should be indexed, as it would be a query condition.
*/
public boolean shouldIndex() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Model add(Class<?> aClass, int scopeId, Storage storage) throws StorageEx
String timestampColumn = aClass.getAnnotation(BanyanDB.TimestampColumn.class).value();
if (StringUtil.isBlank(timestampColumn)) {
throw new IllegalStateException(
"Model[trace." + storage.getModelName() + "] missing defined @BanyanDB.TimestampColumn");
"Model[" + storage.getModelName() + "] missing defined @BanyanDB.TimestampColumn");
}
banyanDBModelExtension.setTimestampColumn(timestampColumn);
}
Expand All @@ -109,7 +109,7 @@ public Model add(Class<?> aClass, int scopeId, Storage storage) throws StorageEx
String traceIdColumn = aClass.getAnnotation(BanyanDB.Trace.TraceIdColumn.class).value();
if (StringUtil.isBlank(traceIdColumn)) {
throw new IllegalStateException(
"Model[trace." + storage.getModelName() + "] missing defined @BanyanDB.TimestampColumn");
"Model[trace." + storage.getModelName() + "] missing defined @BanyanDB.TraceIdColumn");
}
banyanDBModelExtension.setTraceIdColumn(traceIdColumn);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public class ZipkinSpanRecord extends Record implements BanyanDBTrace {
@Getter
@ElasticSearch.EnableDocValues
@Column(name = TIMESTAMP_MILLIS)
@BanyanDB.NoIndexing
private long timestampMillis;
@Setter
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ public TraceModel registerTraceModel(Model model, BanyanDBStorageConfig config)
builder.setTimestampTagName(timestampColumn);
for (final ModelColumn col : model.getColumns()) {
final String columnStorageName = col.getColumnName().getStorageName();
// skip storage only column, since they are not supposed to be queried
if (col.isStorageOnly()) {
// skip no index column, since they are not supposed to be queried
if (!col.getBanyanDBExtension().shouldIndex()) {
continue;
}
if (columnStorageName.equals(Record.TIME_BUCKET)) {
Expand Down Expand Up @@ -538,7 +538,7 @@ List<TagMetadata> parseTagMetadata(Model model, Schema.SchemaBuilder builder, Li
final TagSpec tagSpec = parseTagSpec(col);
builder.spec(columnStorageName, new ColumnSpec(ColumnType.TAG, col.getType()));
String colName = col.getColumnName().getStorageName();
if (col.getBanyanDBExtension().shouldIndex()) {
if (col.getBanyanDBExtension().shouldIndex() && !colName.equals(model.getBanyanDBModelExtension().getTimestampColumn())) {
if (!seriesIDColumns.contains(colName) || null != col.getBanyanDBExtension().getAnalyzer()) {
tagMetadataList.add(new TagMetadata(
indexRule(
Expand Down Expand Up @@ -593,7 +593,7 @@ MeasureMetadata parseTagAndFieldMetadata(Model model,
builder.spec(columnStorageName, new ColumnSpec(ColumnType.TAG, col.getType()));
String colName = col.getColumnName().getStorageName();

if (col.getBanyanDBExtension().shouldIndex()) {
if (col.getBanyanDBExtension().shouldIndex() && !colName.equals(model.getBanyanDBModelExtension().getTimestampColumn())) {
if (!seriesIDColumns.contains(colName) || null != col.getBanyanDBExtension().getAnalyzer()) {
result.tag(new TagMetadata(
indexRule(
Expand Down
Loading