clickhouse table add hostname column

This commit is contained in:
lishijiang 2022-06-30 09:46:16 +08:00
parent 04fe1eb704
commit e9918290b0
1 changed files with 2 additions and 0 deletions

View File

@ -125,6 +125,7 @@ func (mh *MetricsHouseType) post(conn driver.Conn, series []*types.Sample) error
e.Timestamp, //会自动转换时间格式
e.Timestamp, //会自动转换时间格式
e.Metric,
config.Config.GetHostname(),
convertTags(e),
e.Value,
)
@ -147,6 +148,7 @@ CREATE TABLE IF NOT EXISTS %s (
event_time DateTime
, event_date Date
, metric LowCardinality(String)
, hostname LowCardinality(String)
, tags String
, value Float64
) ENGINE = MergeTree