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

testing #121

Merged
merged 1 commit into from
Jul 29, 2023
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
3 changes: 2 additions & 1 deletion client/pkg/clients/bridge_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ type GitNats string
const (
bridgeSubjects GitNats = "GITMETRICS.*"
bridgeSubject GitNats = "GITMETRICS.git"
bridgeConsumer GitNats = "GIT_CONSUMER"
bridgeConsumer GitNats = "Git-Consumer"
)

// SubscribeGitBridgeNats subscribes to nats jetstream and calls
// the respective funcs to insert data into clickhouse DB
func (n *NATSContext) SubscribeGitBridgeNats(conn clickhouse.DBInterface) {
log.Printf("Creating nats consumer %s with subject: %s \n", bridgeConsumer, bridgeSubject)
n.stream.Subscribe(string(bridgeSubject), func(msg *nats.Msg) {
msg.Ack()
gitprovider := msg.Header.Get("GitProvider")
Expand Down
20 changes: 10 additions & 10 deletions client/pkg/clients/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ func NewNATSContext(conf *config.Config, dbClient clickhouse.DBInterface) (*NATS
}
ctx.SubscribeGitBridgeNats(dbClient)

_, err = stream.StreamInfo("CONTAINERMETRICS")
if err != nil {
return nil, fmt.Errorf("container metrics stream not found %w", err)
}
ctx.SubscribeContainerNats(dbClient)
_, err = stream.StreamInfo("METRICS")
if err != nil {
return nil, fmt.Errorf("kubeviz metrics stream not found %w", err)
}
ctx.SubscribeAllKubvizNats(dbClient)
// _, err = stream.StreamInfo("CONTAINERMETRICS")
// if err != nil {
// return nil, fmt.Errorf("container metrics stream not found %w", err)
// }
// ctx.SubscribeContainerNats(dbClient)
// _, err = stream.StreamInfo("METRICS")
// if err != nil {
// return nil, fmt.Errorf("kubeviz metrics stream not found %w", err)
// }
// ctx.SubscribeAllKubvizNats(dbClient)

return ctx, nil
}
Expand Down
Loading