make limit configurable

This commit is contained in:
Elio Bischof 2023-07-05 12:10:42 +02:00
parent a901224bbb
commit 599fcc6167
No known key found for this signature in database
GPG Key ID: 7B383FDE4DDBF1BD
2 changed files with 4 additions and 1 deletions

View File

@ -34,6 +34,8 @@ Telemetry:
# multi-value: # multi-value:
# - "multi-value-1" # - "multi-value-1"
# - "multi-value-2" # - "multi-value-2"
# The maximum number of data points that are queried before they are sent to the configured endpoints.
Limit: 100 # ZITADEL_TELEMETRY_LIMIT
# Port ZITADEL will listen on # Port ZITADEL will listen on
Port: 8080 Port: 8080

View File

@ -31,6 +31,7 @@ type TelemetryPusherConfig struct {
Enabled bool Enabled bool
Endpoints []string Endpoints []string
Headers http.Header Headers http.Header
Limit uint64
} }
type telemetryPusher struct { type telemetryPusher struct {
@ -98,7 +99,7 @@ func (t *telemetryPusher) pushMilestones(event eventstore.Event) (*handler.State
} }
unpushedMilestones, err := t.queries.Queries.SearchMilestones(ctx, scheduledEvent.InstanceIDs, &query.MilestonesSearchQueries{ unpushedMilestones, err := t.queries.Queries.SearchMilestones(ctx, scheduledEvent.InstanceIDs, &query.MilestonesSearchQueries{
SearchRequest: query.SearchRequest{ SearchRequest: query.SearchRequest{
Limit: 100, Limit: t.cfg.Limit,
SortingColumn: query.MilestoneReachedDateColID, SortingColumn: query.MilestoneReachedDateColID,
Asc: true, Asc: true,
}, },