feat: add provider_init_rate to telemetry - #485
Merged
Conversation
nicklasl
force-pushed
the
session/grumpy-shrike-js36
branch
from
July 17, 2026 12:48
70c9540 to
2481fc6
Compare
nicklasl
force-pushed
the
session/grumpy-shrike-js36
branch
from
July 17, 2026 13:23
2481fc6 to
7b04cc7
Compare
nicklasl
marked this pull request as ready for review
July 17, 2026 13:24
nicklasl
force-pushed
the
session/grumpy-shrike-js36
branch
6 times, most recently
from
July 17, 2026 14:11
a2f4e12 to
3505a52
Compare
nicklasl
force-pushed
the
session/grumpy-shrike-js36
branch
2 times, most recently
from
August 21, 2026 11:53
04960bb to
27d466f
Compare
On the first telemetry flush after provider initialization, include a ProviderInitRate entry with labels describing the SDK configuration (e.g. encryption: true/false). This lets the backend track which customers have adopted encryption without tagging every metric. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
nicklasl
force-pushed
the
session/grumpy-shrike-js36
branch
from
August 24, 2026 09:43
27d466f to
89fb845
Compare
vahidlazio
reviewed
Aug 24, 2026
| id: SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER, | ||
| version: VERSION, | ||
| }; | ||
| decoded.telemetryData!.providerInitRate = [{ count: 1, labels: this.initLabels }]; |
Collaborator
There was a problem hiding this comment.
other providers push but here we replace, can we use decoded.telemetryData!.providerInitRate.push({ count: 1, labels: this.initLabels }); to be consistent?
| logger.warn('Primary flag log destination returned error, trying fallback'); | ||
| continue; | ||
| } | ||
| throw new Error('Failed to send flag logs to all destinations'); |
Collaborator
There was a problem hiding this comment.
we didn't throw before, means failures were silently dropped, did we check that all callers handle this?
Collaborator
There was a problem hiding this comment.
also, like other providers, js must also have some emit if not send in onClose i think like:
async onClose(): Promise<void> {
await this.flush(timeoutSignal(3000));
// Guarantee init telemetry even if flush() failed or returned empty
if (this.initTelemetryState !== 'sent') {
try {
const request = WriteFlagLogsRequest.encode(
WriteFlagLogsRequest.create({
telemetryData: {
sdk: { id: SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER, version: VERSION },
providerInitRate: [{ count: 1, labels: this.initLabels }],
},
}),
).finish();
await this.sendFlagLogs(request, timeoutSignal(3000));
this.initTelemetryState = 'sent';
} catch {
// best-effort — provider is shutting down
}
}
this.main.abort();
}
| if (!decoded.telemetryData) { | ||
| decoded.telemetryData = { resolverVersion: '', providerInitRate: [] }; | ||
| } | ||
| decoded.telemetryData.sdk ??= { |
Collaborator
There was a problem hiding this comment.
nit: go and java always replace
vahidlazio
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProviderInitRatemessage toTelemetryDataproto (field 9) withcountandmap<string, string> labelsProviderInitRate{count: 1, labels: {encryption: "true"/"false"}}entryTelemetryDataCompanion backend PR: https://ghe.spotify.net/konfidens/epx-flags-resolver/pull/1699
Test plan
provider_init_ratewith correct labels, subsequent flushes do notmake testper provider)docker build .)confidence_resolver_sdk_provider_init_rate_totalmetric appears in VictoriaMetrics after backend PR lands🤖 Generated with Claude Code