mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-26 20:54:08 +00:00
* feat(prometheus): persist Remote Write exemplars Prometheus Remote Write v1 and v2 now persist valid exemplars in the source schema's metrics_exemplars table. A shared row contract keeps inherited series labels separate from exemplar labels, creates or validates an ordinary sparse append table, and preserves compatible pre-created timestamp precision. Malformed observations are dropped and counted without discarding valid samples or sibling exemplars. Permissions and admission precede writes, and v2 written-count headers use confirmed storage progress. Includes decoder, HTTP orchestration and physical-table routing coverage. The JSON2 row-schema helper becomes fallible; its three existing trace callers propagate that error in this layer. Signed-off-by: shuiyisong <xixing.sys@gmail.com> * feat(exemplar): persist source metric identities Signed-off-by: shuiyisong <xixing.sys@gmail.com> * fix(prometheus): bound exemplar write memory Signed-off-by: shuiyisong <xixing.sys@gmail.com> * fix(prometheus): correct batching with exemplars Signed-off-by: shuiyisong <xixing.sys@gmail.com> * fix(exemplar): accept mixed-case sparse encoding Signed-off-by: shuiyisong <xixing.sys@gmail.com> * perf(exemplar): reduce write preparation overhead Signed-off-by: shuiyisong <xixing.sys@gmail.com> * perf(prom): reuse exemplar source targets Signed-off-by: shuiyisong <xixing.sys@gmail.com> * fix: clippy Signed-off-by: shuiyisong <xixing.sys@gmail.com> * fix(prometheus): defer exemplar series expansion Signed-off-by: shuiyisong <xixing.sys@gmail.com> --------- Signed-off-by: shuiyisong <xixing.sys@gmail.com>
43 lines
1.9 KiB
Plaintext
43 lines
1.9 KiB
Plaintext
SELECT * FROM exemplar_source_ids ORDER BY __tsid, greptime_timestamp;
|
|
|
|
+------------+----------------------+-----------------+-------------------------------+----------------+-----+
|
|
| __table_id | __tsid | greptime_metric | greptime_timestamp | greptime_value | job |
|
|
+------------+----------------------+-----------------+-------------------------------+----------------+-----+
|
|
| 42 | 7 | cpu | 1970-01-01T00:00:00.000000030 | 3.0 | api |
|
|
| 43 | 18446744073709551615 | memory | 1970-01-01T00:00:00.000000010 | 2.0 | |
|
|
| 42 | 18446744073709551615 | cpu | 1970-01-01T00:00:00.000000020 | 1.0 | |
|
|
| 42 | 18446744073709551615 | cpu | 1970-01-01T00:00:00.000000020 | 1.0 | |
|
|
+------------+----------------------+-----------------+-------------------------------+----------------+-----+
|
|
|
|
ADMIN FLUSH_TABLE('exemplar_source_ids');
|
|
|
|
+------------------------------------------+
|
|
| ADMIN FLUSH_TABLE('exemplar_source_ids') |
|
|
+------------------------------------------+
|
|
| 0 |
|
|
+------------------------------------------+
|
|
|
|
ADMIN COMPACT_TABLE('exemplar_source_ids', 'swcs', '86400');
|
|
|
|
+-------------------------------------------------------------+
|
|
| ADMIN COMPACT_TABLE('exemplar_source_ids', 'swcs', '86400') |
|
|
+-------------------------------------------------------------+
|
|
| 0 |
|
|
+-------------------------------------------------------------+
|
|
|
|
SELECT COUNT(*) FROM exemplar_source_ids WHERE __table_id = 42 AND __tsid = 18446744073709551615 AND job IS NULL;
|
|
|
|
+----------+
|
|
| count(*) |
|
|
+----------+
|
|
| 2 |
|
|
+----------+
|
|
|
|
SELECT COUNT(*) FROM exemplar_source_ids WHERE __table_id = 43 AND __tsid = 18446744073709551615;
|
|
|
|
+----------+
|
|
| count(*) |
|
|
+----------+
|
|
| 1 |
|
|
+----------+
|