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

feat(profiles): Add dataset configurations and processor for profile chunks #5897

Merged
merged 35 commits into from
May 16, 2024

Conversation

@phacops phacops requested a review from a team as a code owner May 12, 2024 15:32
@phacops phacops requested a review from a team May 12, 2024 15:32
@phacops phacops requested a review from a team as a code owner May 12, 2024 15:32
Copy link

github-actions bot commented May 12, 2024

This PR has a migration; here is the generated SQL

-- start migrations

-- forward migration profile_chunks : 0001_create_profile_chunks_table
Local op: CREATE TABLE IF NOT EXISTS profile_chunks_local (project_id UInt64, profiler_id UUID, chunk_id UUID, start_timestamp DateTime64(6) CODEC (DoubleDelta), end_timestamp DateTime64(6) CODEC (DoubleDelta), retention_days UInt16, partition UInt16, offset UInt64) ENGINE ReplicatedReplacingMergeTree('/clickhouse/tables/profile_chunks/{shard}/default/profile_chunks_local', '{replica}') ORDER BY (project_id, profiler_id, start_timestamp, cityHash64(chunk_id)) PARTITION BY (retention_days, toStartOfDay(start_timestamp)) SAMPLE BY cityHash64(chunk_id) TTL toDateTime(end_timestamp) + toIntervalDay(retention_days) SETTINGS index_granularity=8192;
Distributed op: CREATE TABLE IF NOT EXISTS profile_chunks_dist (project_id UInt64, profiler_id UUID, chunk_id UUID, start_timestamp DateTime64(6) CODEC (DoubleDelta), end_timestamp DateTime64(6) CODEC (DoubleDelta), retention_days UInt16, partition UInt16, offset UInt64) ENGINE Distributed(`cluster_one_sh`, default, profile_chunks_local, cityHash64(profiler_id));
-- end forward migration profile_chunks : 0001_create_profile_chunks_table




-- backward migration profile_chunks : 0001_create_profile_chunks_table
Distributed op: DROP TABLE IF EXISTS profile_chunks_dist;
Local op: DROP TABLE IF EXISTS profile_chunks_local;
-- end backward migration profile_chunks : 0001_create_profile_chunks_table

@phacops phacops changed the base branch from master to pierre/continuous-profiling-dataset-migration May 12, 2024 16:01
@phacops phacops force-pushed the pierre/continuous-profiling-dataset-configuration branch from 3c24aec to 0dca4ad Compare May 12, 2024 17:58
@phacops phacops force-pushed the pierre/continuous-profiling-dataset-migration branch from 0dc7a81 to 45b9c76 Compare May 12, 2024 19:28
@phacops phacops force-pushed the pierre/continuous-profiling-dataset-migration branch from 45b9c76 to 8d2643b Compare May 12, 2024 19:30
@phacops phacops force-pushed the pierre/continuous-profiling-dataset-migration branch from 8d2643b to b9b425c Compare May 12, 2024 20:37
@phacops phacops force-pushed the pierre/continuous-profiling-dataset-configuration branch from 0dca4ad to f59302f Compare May 12, 2024 21:53
Copy link
Member

@volokluev volokluev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just turn on those allocation policies. You see them off by default to to a rollout a while ago. They're all on in prod now

Copy link

codecov bot commented May 14, 2024

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 876 tests with 1 failed, 873 passed and 2 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
pytest

Test name:
tests.datasets.test_factory::test_dataset_load[profiles]

Envs:
- default
Traceback (most recent call last):
File ".../datasets/entities/factory.py", line 50, in get
return self._entity_map[name]
~~~~~~~~~~~~~~~~^^^^^^
KeyError: EntityKey.CHUNKS

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File ".../tests/datasets/test_factory.py", line 27, in test_dataset_load
for entity in dataset.get_all_entities():
^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/datasets/dataset.py", line 42, in get_all_entities
return [get_entity(entity_key) for entity_key in self.__all_entities]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/datasets/dataset.py", line 42, in <listcomp>
return [get_entity(entity_key) for entity_key in self.__all_entities]
^^^^^^^^^^^^^^^^^^^^^^
File ".../datasets/entities/factory.py", line 86, in get_entity
return _ent_factory().get(name)
^^^^^^^^^^^^^^^^^^^^^^^^
File ".../datasets/entities/factory.py", line 52, in get
raise InvalidEntityError(f"entity {name!r} does not exist") from error
snuba.datasets.entities.factory.InvalidEntityError: entity EntityKey.CHUNKS does not exist

@phacops phacops force-pushed the pierre/continuous-profiling-dataset-configuration branch from a78a52f to f545710 Compare May 14, 2024 18:37
Base automatically changed from pierre/continuous-profiling-dataset-migration to master May 15, 2024 20:44
@phacops phacops enabled auto-merge (squash) May 16, 2024 19:17
@phacops phacops merged commit 219fd2c into master May 16, 2024
30 checks passed
@phacops phacops deleted the pierre/continuous-profiling-dataset-configuration branch May 16, 2024 22:19
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.

3 participants