Skip to content

Commit

Permalink
refactor: Update table name and add column 'peer_id'
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Apr 17, 2024
1 parent cd70446 commit c926b40
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion deploy/local/docker-compose/vector-kafka-clickhouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,7 @@ transforms:
.error_description = "failed to parse event date time"
}
.topic = .data.topic
.peer_id = .meta.client.additional_data.metadata.peer_id
.unique_key = seahash(.event.id)
.updated_date_time = to_unix_timestamp(now())
del(.event)
Expand Down Expand Up @@ -2784,7 +2785,7 @@ sinks:
- libp2p_trace_join_formatted
database: default
endpoint: "${CLICKHOUSE_ENDPOINT}"
table: libp2p_join_peer
table: libp2p_join
auth:
strategy: basic
user: "${CLICKHOUSE_USER}"
Expand Down
2 changes: 2 additions & 0 deletions deploy/migrations/clickhouse/031_libp2p_trace.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ CREATE TABLE libp2p_join_local ON CLUSTER '{cluster}'
updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)),
event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)),
topic String CODEC(ZSTD(1)),
peer_id String CODEC(ZSTD(1)),
meta_client_name LowCardinality(String),
meta_client_id String CODEC(ZSTD(1)),
meta_client_version LowCardinality(String),
Expand All @@ -443,6 +444,7 @@ COMMENT COLUMN unique_key 'Unique identifier for each record',
COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated',
COMMENT COLUMN event_date_time 'Timestamp of the event',
COMMENT COLUMN topic 'Topic involved in the join event',
COMMENT COLUMN peer_id 'Peer ID of the peer that joined the topic',
COMMENT COLUMN meta_client_name 'Name of the client that generated the event',
COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.',
COMMENT COLUMN meta_client_version 'Version of the client that generated the event',
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/ethpandaops/xatu

go 1.22.0

replace github.com/probe-lab/hermes => github.com/ethpandaops/hermes v0.0.0-20240411071540-e67fb0f894e0
replace github.com/probe-lab/hermes => github.com/ethpandaops/hermes v0.0.0-20240416064533-1564b5db6dc6

require (
github.com/IBM/sarama v1.43.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ github.com/ethpandaops/ethcore v0.0.0-20240306031202-16f9e1926c0c h1:B/Auy5g6Nv4
github.com/ethpandaops/ethcore v0.0.0-20240306031202-16f9e1926c0c/go.mod h1:ZvKqL6CKxiraefdXPHeJurV2pDD/f2HF2uklDVdrry8=
github.com/ethpandaops/ethwallclock v0.3.0 h1:xF5fwtBf+bHFHZKBnwiPFEuelW3sMM7SD3ZNFq1lJY4=
github.com/ethpandaops/ethwallclock v0.3.0/go.mod h1:y0Cu+mhGLlem19vnAV2x0hpFS5KZ7oOi2SWYayv9l24=
github.com/ethpandaops/hermes v0.0.0-20240411071540-e67fb0f894e0 h1:TMfE4CcqZwDUfQdmFKRrPgyOiPt8zTTT+env8SBY+RI=
github.com/ethpandaops/hermes v0.0.0-20240411071540-e67fb0f894e0/go.mod h1:0jaXXPRHNx/fctHUM6NC5tixFQl48UizJ1FK/WveXeE=
github.com/ethpandaops/hermes v0.0.0-20240416064533-1564b5db6dc6 h1:htFz7bZLN4QSnPSMK38eDPtze8ZiMbl//j/unKxmxL0=
github.com/ethpandaops/hermes v0.0.0-20240416064533-1564b5db6dc6/go.mod h1:0jaXXPRHNx/fctHUM6NC5tixFQl48UizJ1FK/WveXeE=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
Expand Down

0 comments on commit c926b40

Please sign in to comment.