Repository navigation
metrics: add keyspace ID label to changefeed metrics (#5662) #6526
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,18 +138,27 @@ | |
| } | ||
|
|
||
| func New( | ||
| <<<<<<< HEAD | ||
| ctx context.Context, changefeedID common.ChangeFeedID, sinkURI *url.URL, sinkConfig *config.SinkConfig, | ||
| ======= | ||
| ctx context.Context, changefeedID commonType.ChangeFeedID, sinkURI *url.URL, sinkConfig *config.SinkConfig, keyspaceID uint32, | ||
| >>>>>>> 5d55dc62e (metrics: add keyspace ID label to changefeed metrics (#5662)) | ||
|
Check failure on line 145 in downstreamadapter/sink/kafka/sink.go
|
||
|
Comment on lines
+141
to
+145
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
rg -n 'NewStatistics|<<<<<<<|>>>>>>>|commonType|common "' downstreamadapter/sink/kafka/sink.goRepository: pingcap/ticdc Length of output: 770 🏁 Script executed: set -eu
printf '%s\n' '--- imports and affected declarations ---'
nl -ba downstreamadapter/sink/kafka/sink.go | sed -n '1,210p'
printf '%s\n' '--- New callers and constructor definitions ---'
rg -n -F --glob '*.go' -e 'kafka.New(' -e 'newWithComponents(' downstreamadapter | sed -n '1,200p'Repository: pingcap/ticdc Length of output: 7901 Resolve the merge conflicts and keep one keyspace-aware statistics call.
🐛 Suggested fix func New(
-<<<<<<< HEAD
- ctx context.Context, changefeedID common.ChangeFeedID, sinkURI *url.URL, sinkConfig *config.SinkConfig,
-=======
- ctx context.Context, changefeedID commonType.ChangeFeedID, sinkURI *url.URL, sinkConfig *config.SinkConfig, keyspaceID uint32,
->>>>>>> 5d55dc62e (metrics: add keyspace ID label to changefeed metrics (#5662))
+ ctx context.Context, changefeedID common.ChangeFeedID, sinkURI *url.URL, sinkConfig *config.SinkConfig, keyspaceID uint32,
) (*sink, error) {
@@
ctx context.Context,
-<<<<<<< HEAD
changefeedID common.ChangeFeedID,
-=======
- changefeedID commonType.ChangeFeedID,
keyspaceID uint32,
->>>>>>> 5d55dc62e (metrics: add keyspace ID label to changefeed metrics (#5662))
protocol config.Protocol,
comp components,
) (*sink, error) {
- statistics := metrics.NewStatistics(changefeedID, "sink")
+ statistics := metrics.NewStatistics(changefeedID, keyspaceID, "sink")
@@
-<<<<<<< HEAD
-=======
- statistics := metrics.NewStatistics(changefeedID, keyspaceID, "sink")
->>>>>>> 5d55dc62e (metrics: add keyspace ID label to changefeed metrics (#5662))
asyncProducer, err = comp.factory.AsyncProducer(ctx)🤖 Prompt for AI AgentsSource: Pipeline failures |
||
| ) (*sink, error) { | ||
| comp, protocol, err := newKafkaSinkComponent(ctx, changefeedID, sinkURI, sinkConfig) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return newWithComponents(ctx, changefeedID, protocol, comp) | ||
| return newWithComponents(ctx, changefeedID, keyspaceID, protocol, comp) | ||
| } | ||
|
|
||
| func newWithComponents( | ||
| ctx context.Context, | ||
| <<<<<<< HEAD | ||
| changefeedID common.ChangeFeedID, | ||
| ======= | ||
| changefeedID commonType.ChangeFeedID, | ||
| keyspaceID uint32, | ||
| >>>>>>> 5d55dc62e (metrics: add keyspace ID label to changefeed metrics (#5662)) | ||
|
Check failure on line 161 in downstreamadapter/sink/kafka/sink.go
|
||
| protocol config.Protocol, | ||
| comp components, | ||
| ) (*sink, error) { | ||
|
|
@@ -159,7 +168,7 @@ | |
| asyncProducer kafka.AsyncProducer | ||
| syncProducer kafka.SyncProducer | ||
| ) | ||
| defer func() { | ||
|
Check failure on line 171 in downstreamadapter/sink/kafka/sink.go
|
||
| if err == nil { | ||
| return | ||
| } | ||
|
|
@@ -173,6 +182,10 @@ | |
| statistics.Close() | ||
| }() | ||
|
|
||
| <<<<<<< HEAD | ||
| ======= | ||
| statistics := metrics.NewStatistics(changefeedID, keyspaceID, "sink") | ||
| >>>>>>> 5d55dc62e (metrics: add keyspace ID label to changefeed metrics (#5662)) | ||
| asyncProducer, err = comp.factory.AsyncProducer(ctx) | ||
| if err != nil { | ||
| return nil, err | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Resolve the merge conflict markers. The test package does not compile.
Both conflicts must keep the new
keyspaceIDargument. The existing file usescommonType. The incoming side usescommon. Check which alias the file imports. Keep one test name. TheHEADname isTestBlackHoleSinkFlushEvents.Proposed fix
Apply the same fix at Lines 135-139.
Also applies to: 135-139
🤖 Prompt for AI Agents
Source: Pipeline failures