-
Notifications
You must be signed in to change notification settings - Fork 101
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: add more metrics #2454
feat: add more metrics #2454
Conversation
flow/activities/flowable.go
Outdated
@@ -767,6 +768,19 @@ func (a *FlowableActivity) RecordSlotSizes(ctx context.Context) error { | |||
return | |||
} | |||
slotMetricGauges.IntervalSinceLastNormalizeGauge = intervalSinceLastNormalizeGauge | |||
|
|||
syncedTablesGauge, err := a.OtelManager.GetOrInitInt64Gauge( | |||
otel_metrics.BuildMetricName(otel_metrics.SyncedTablesGaugeName), |
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.
either now or after we should make RecordGauge
utility method on otelmanager
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.
Yeah, I feel that all gauges/counters can probably be initialized in otel manager. There is no flow specific information when we initialize them
ae6a4d4
to
7c237a5
Compare
de0f6df
to
387da4a
Compare
a.OtelManager.Metrics.RecordsSyncedGauge.Record(ctx, syncResponse.NumRecordsSynced, metric.WithAttributeSet(attribute.NewSet( | ||
attribute.String(otel_metrics.FlowNameKey, config.FlowJobName), | ||
attribute.String(otel_metrics.BatchIdKey, strconv.FormatInt(syncResponse.CurrentSyncBatchID, 10)), | ||
attribute.String(otel_metrics.SourcePeerType, fmt.Sprintf("%T", srcConn)), |
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.
in behind %T just uses reflect: https://cs.opensource.google/go/go/+/refs/tags/go1.23.5:src/fmt/print.go;l=699
so if you prefer you could make a function in shared
that does the same thing & then have more flexibility such as dropping package prefix or something
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.
i'm still leaning towards a Type()
method, opened #2471 for later
6fa823d
to
e7e55cd
Compare
Adds a few new metrics:
error_emitted
- instantaneous gauge of whether an error is beingemitted
errors_emitted
- counter of errors emitted over timerecords_synced
- number of records synced for every sync batch.synced_tables
- number of tables configured in each mirrorinstance_status
- a constant1
metric every 5 minutes (same frequency as slots) with attributes differentiating the current statusmaintenance_status
- a constant1
when maintenance is running, also has attributes differentiating the current statusTODO: maybe refactor code so that maybe all gauges/counters are initialized inside the otelManager?
ref #2341