Skip to content
Open
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
14 changes: 14 additions & 0 deletions api/seqproxyapi/v1/seq_proxy_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ service SeqProxyApi {
body: "*"
};
}

// Stream documents for given async search ID.
rpc ExportAsyncSearch(ExportAsyncSearchRequest) returns (stream ExportResponse) {
option (google.api.http) = {
post: "/async-searches/export"
body: "*"
};
}
}

// Custom error code, returned by seq-db proxy.
Expand Down Expand Up @@ -419,6 +427,12 @@ message ExportRequest {
int64 offset = 3; // Search offset.
}

message ExportAsyncSearchRequest {
string search_id = 1;
int64 size = 2;
int64 offset = 3;
}

message ExportResponse {
Document doc = 1; // Response document.
}
23 changes: 23 additions & 0 deletions asyncsearcher/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package asyncsearcher
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/ozontech/seq-db/metric"
)

var (
Expand Down Expand Up @@ -48,4 +50,25 @@ var (
Name: "panics_total",
Help: "Number of panics in async search",
})

ExportDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "seq_db_ingestor",
Subsystem: "async_search",
Name: "export_duration_seconds",
Help: "Time taken to export data by protocol in seconds",
Buckets: metric.SecondsBucketsDoublePrecision,
}, []string{"protocol"})
ExportSize = promauto.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "seq_db_ingestor",
Subsystem: "async_search",
Name: "export_size_bytes",
Help: "Size of exported data by protocol in bytes",
Buckets: prometheus.ExponentialBuckets(10, 3, 20),
}, []string{"protocol"})
CurrentExportersCount = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "seq_db_ingestor",
Subsystem: "async_search",
Name: "export_current_exporters_in_progress",
Help: "Current number of active exporters in progress by protocol",
}, []string{"protocol"})
)
450 changes: 264 additions & 186 deletions pkg/seqproxyapi/v1/seq_proxy_api.pb.go

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions pkg/seqproxyapi/v1/seq_proxy_api.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading