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

ref: update materialized_version for profile functions metrics #522

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
- Instrument flamegraph generation with spans ([#510](https://github.com/getsentry/vroom/pull/510)), ([#511](https://github.com/getsentry/vroom/pull/511))
- Move calltree generation into readjob ([#514](https://github.com/getsentry/vroom/pull/514))
- Stop writing profile examples to metrics_summary ([#519](https://github.com/getsentry/vroom/pull/519))
- Update materialized_version for profile functions metrics ([#522](https://github.com/getsentry/vroom/pull/522))

## 23.12.0

Expand Down
42 changes: 22 additions & 20 deletions cmd/vroom/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ import (
type (
// FunctionsKafkaMessage is representing the struct we send to Kafka to insert functions in ClickHouse.
FunctionsKafkaMessage struct {
Environment string `json:"environment,omitempty"`
Functions []nodetree.CallTreeFunction `json:"functions"`
ID string `json:"profile_id"`
Platform platform.Platform `json:"platform"`
ProjectID uint64 `json:"project_id"`
Received int64 `json:"received"`
Release string `json:"release,omitempty"`
RetentionDays int `json:"retention_days"`
Timestamp int64 `json:"timestamp"`
TransactionName string `json:"transaction_name"`
Environment string `json:"environment,omitempty"`
Functions []nodetree.CallTreeFunction `json:"functions"`
ID string `json:"profile_id"`
Platform platform.Platform `json:"platform"`
ProjectID uint64 `json:"project_id"`
Received int64 `json:"received"`
Release string `json:"release,omitempty"`
RetentionDays int `json:"retention_days"`
Timestamp int64 `json:"timestamp"`
TransactionName string `json:"transaction_name"`
MaterializationVersion uint8 `json:"materialization_version"`
}

// ProfileKafkaMessage is representing the struct we send to Kafka to insert a profile in ClickHouse.
Expand Down Expand Up @@ -75,16 +76,17 @@ type (

func buildFunctionsKafkaMessage(p profile.Profile, functions []nodetree.CallTreeFunction) FunctionsKafkaMessage {
return FunctionsKafkaMessage{
Environment: p.Environment(),
Functions: functions,
ID: p.ID(),
Platform: p.Platform(),
ProjectID: p.ProjectID(),
Received: p.Received().Unix(),
Release: p.Release(),
RetentionDays: p.RetentionDays(),
Timestamp: p.Timestamp().Unix(),
TransactionName: p.Transaction().Name,
Environment: p.Environment(),
Functions: functions,
ID: p.ID(),
Platform: p.Platform(),
ProjectID: p.ProjectID(),
Received: p.Received().Unix(),
Release: p.Release(),
RetentionDays: p.RetentionDays(),
Timestamp: p.Timestamp().Unix(),
TransactionName: p.Transaction().Name,
MaterializationVersion: 1,
}
}

Expand Down
Loading