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

Clickhouse aggregation #88

Merged
merged 9 commits into from
Sep 14, 2020
Merged

Conversation

Felixoid
Copy link
Collaborator

@Felixoid Felixoid commented Aug 23, 2020

TL;DR:
see https://github.com/lomik/graphite-clickhouse/wiki/ClickHouse-aggregation-VS-graphite-clickhouse-aggregation

Here the next is done:

Moderate data fetching refactoring

  • Implement max-data-points clickhouse parameter
  • Move data fetching into render package
  • Create Rules.RollupPoints function, use it right after data fetching
  • Implement locking in alias.Map for concurrent usage
  • render.FetchDataPoints: universal function to get data points. Use carbonlink, if specified. Make requests in goroutines
  • prometheus and render: use FetchDataPoints
  • data:
    • use ReadUvarint from clickhouse package;
    • return data in case of error to have debug info

Add optional ClickHouse site points aggregation

  • Enabled only when internal-aggregation in [clickhouse] is used
  • Use proper aggregation function in query
  • The amount of data points is calculated out of maxDataPoints
  • A common step for all metrics in targets are calculated asynchronoushly

Build: update go metrics
Improve logging and answer 500 on marshalling errors

This PR depends on #85

Passes basic tests (queries from carbonapi 0.14.0):
 * /metrics/find requests (with and without globs)
 * /render with single metric
 * /render with globs
 * /render with several targets
Change URL for http request to include parameters that are now in the body
This handler is used by carbonapi to detect support of carbonapi_v3_pb and get
information about backend and it's preferences and supported features.
This fixes request handling when query used timeShift
@Felixoid Felixoid force-pushed the clickhouse_aggregation branch 3 times, most recently from 8a759b6 to 48f8f65 Compare August 25, 2020 15:49
@Felixoid Felixoid force-pushed the clickhouse_aggregation branch 11 times, most recently from 8d1fbb3 to bc654de Compare September 2, 2020 18:29
@Felixoid Felixoid force-pushed the clickhouse_aggregation branch 2 times, most recently from 5282aae to 0db4011 Compare September 3, 2020 14:08
- WIP: implement max-data-points and internal-aggregation clickhouse
  parameters
- Move data fetching into render package
- Create Rules.RollupPoints function, use it right after data fetching
- Implement locking in alias.Map for concurrent usage
- render.FetchDataPoints: universal function to get data points. Use
  carbonlink, if specified. Make requests in goroutines
- prometheus and render: use FetchDataPoints
- data: use ReadUvarint from clickhouse package; return data in case of
  error to have debug info

fixup! Moderate data fetching refactoring
- Enabled only when `internal-aggregation` in [clickhouse] is used
- Use proper aggregation function in query
- Amount of data points is calculated out of maxDataPoints
@Felixoid Felixoid marked this pull request as ready for review September 14, 2020 08:24
@Felixoid Felixoid merged commit 5b7023a into go-graphite:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants