Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About We tried using ClickHouse as a remote storage for Prometheus #4868

Closed
lyl2008dsg opened this issue Apr 1, 2019 · 2 comments
Closed
Labels
comp-foreign-db Integrations with other databases feature

Comments

@lyl2008dsg
Copy link

lyl2008dsg commented Apr 1, 2019

Use case
I tried to store metrics with Nested, and expected Calculated Growth Rate.
e.g http://www.silota.com/docs/recipes/sql-mom-growth-rate.html

CREATE TABLE IF NOT EXISTS app_metrics(
   partition Date DEFAULT toDate(timestamp),
   timestamp DateTime DEFAULT now(),
   instance_id String,
   metric String,
   tags Nested
   (
     key String,
     value String
   ),
   value Float64
  ) ENGINE = MergeTree(partition, (timestamp, metric), 8192);

A clear and concise description of what is the intended usage scenario is.

Describe the solution you'd like
Clickhouse is expected to provide functions like MySQL lag() or lead() ?

Describe alternatives you've considered
Or alternatives solution e.g https://rextester.com/ERTQ26880

Additional context
We tried using ClickHouse as a remote storage for Prometheus.
Gauge 、Histogram and so on are satisfied,hower what should Counter of prometheus do?

ps. https://groups.google.com/forum/#!topic/clickhouse/d5Np4j_nkYk

@filimonov filimonov added the comp-foreign-db Integrations with other databases label Jun 11, 2019
@filimonov
Copy link
Contributor

Thanks for feedback.

lead/lag - you are looking for window functions. They are not supported currently, but there are some workarounds using arrays. Please follow main issue: #1469

@Algunenano
Copy link
Member

Window functions are now supported by ClickHouse. Although lag/lead themselves are not yet supported, there are alternatives with the same behaviour -> https://clickhouse.com/docs/en/sql-reference/window-functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-foreign-db Integrations with other databases feature
Projects
None yet
Development

No branches or pull requests

3 participants