Skip to content

Commit

Permalink
feat: implement storage for OTLP histogram (#2282)
Browse files Browse the repository at this point in the history
* feat: implement new histogram data model

* feat:  use prometheus table format for histogram

* refactor: remove duplicated code

* fix: histogram tag column

* fix: use accumulated count in buckets

* refactor: using row based protocol for otlp WIP

* refactor: use row based writer for otlp.

Also updated row writer for owned keys

* refactor: use row writers for otlp

* test: add integration tests for histogram

* refactor: change le column name
  • Loading branch information
sunng87 authored Sep 23, 2023
1 parent 9d0de25 commit ffa729c
Show file tree
Hide file tree
Showing 6 changed files with 535 additions and 271 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/instance/otlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl OpenTelemetryProtocolHandler for Instance {
.context(AuthSnafu)?;
let (requests, rows) = otlp::to_grpc_insert_requests(request)?;
let _ = self
.handle_inserts(requests, ctx)
.handle_row_inserts(requests, ctx)
.await
.map_err(BoxedError::new)
.context(error::ExecuteGrpcQuerySnafu)?;
Expand Down
4 changes: 2 additions & 2 deletions src/servers/src/influxdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl TryFrom<InfluxdbRequest> for RowInsertRequests {

// tags
if let Some(tags) = tags {
let kvs = tags.iter().map(|(k, v)| (k.as_str(), v.as_str()));
let kvs = tags.iter().map(|(k, v)| (k.to_string(), v.as_str()));
row_writer::write_tags(table_data, kvs, &mut one_row)?;
}

Expand All @@ -69,7 +69,7 @@ impl TryFrom<InfluxdbRequest> for RowInsertRequests {
),
FieldValue::Boolean(v) => (ColumnDataType::Boolean, ValueData::BoolValue(*v)),
};
(k.as_str(), datatype, value)
(k.to_string(), datatype, value)
});
row_writer::write_fields(table_data, fields, &mut one_row)?;

Expand Down
Loading

0 comments on commit ffa729c

Please sign in to comment.