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

feat: add more metrics #2454

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

feat: add more metrics #2454

wants to merge 7 commits into from

Conversation

iamKunalGupta
Copy link
Member

@iamKunalGupta iamKunalGupta commented Jan 17, 2025

Adds a few new metrics:

  1. error_emitted - instantaneous gauge of whether an error is being
    emitted
  2. errors_emitted - counter of errors emitted over time
  3. records_synced - number of records synced for every sync batch.
  4. synced_tables - number of tables configured in each mirror
  5. instance_status - a constant 1 metric every 5 minutes (same frequency as slots) with attributes differentiating the current status

TODO: maybe refactor code so that maybe all gauges/counters are initialized inside the otelManager?

ref #2341

@@ -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),
Copy link
Contributor

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

Copy link
Member Author

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

var tags []string
if errors.Is(err, context.Canceled) {
tags = append(tags, string(shared.ErrTypeCanceled))
// TODO this is only set for context.Canceled, other types need to be added too
errorClassString = "context.Canceled"
Copy link
Contributor

@serprex serprex Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't this pass tag through for all cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking whether our current classification is enough. Currently it is based on technical error types, we mostly need better differentiators

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we mostly need better differentiators

To determine whether they are customer facing alerts or not, the errorClass is just an initial draft for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants