mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* #45498: add entity events table
* #45498: add entity events service
* #45498: hook up entity events service to http server
* #45498: use `dashboards.id` rather than `uid` and `org_id` in grn
* Update pkg/services/entityevents/service.go
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* #45498: move entityeventsservice to services/store
* #45498: add null check
* #45498: rename
* #45498: fix comment
* #45498: switch grn back to uid
* Search: listen for updates (#47719)
* #45498: wire entity event service with searchv2
* load last event id before building index for org 1
* fix service init in integration tests
* depend on required subset of event store methods
* Update pkg/services/sqlstore/migrations/entity_events_mig.go
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
* #45498: pointer receiver
* #45498: mockery!
* #45498: add entity events service to background services
* dashboard query pagination, allow queries while re-indexing
* log level cleanups, use rlock, add comments
* fix lint, check feature toggle in search v2 service
* use unix time for event created column
* add missing changes for created column
* fix integration tests init
* log re-index execution times on info level
* #45498: fix entityEventsService tests
* #45498: save events on dashboard delete
* use camel case for log labels
* formatting
* #45498: rename grn to entityid
* #45498: add `IsDisabled` to entityEventsService
* #45498: remove feature flag from migration
* better context usage, fix capacity, comments/cleanups
* replace print with logger
* Revert "#45498: remove feature flag from migration"
This reverts commit ed23968898.
* revert:revert:revert conditional feature flag
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
85 lines
3.4 KiB
Go
85 lines
3.4 KiB
Go
package backgroundsvcs
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/api"
|
|
"github.com/grafana/grafana/pkg/infra/metrics"
|
|
"github.com/grafana/grafana/pkg/infra/remotecache"
|
|
"github.com/grafana/grafana/pkg/infra/tracing"
|
|
uss "github.com/grafana/grafana/pkg/infra/usagestats/service"
|
|
"github.com/grafana/grafana/pkg/infra/usagestats/statscollector"
|
|
"github.com/grafana/grafana/pkg/models"
|
|
"github.com/grafana/grafana/pkg/plugins/manager"
|
|
"github.com/grafana/grafana/pkg/registry"
|
|
"github.com/grafana/grafana/pkg/services/alerting"
|
|
"github.com/grafana/grafana/pkg/services/cleanup"
|
|
"github.com/grafana/grafana/pkg/services/dashboardsnapshots"
|
|
"github.com/grafana/grafana/pkg/services/guardian"
|
|
"github.com/grafana/grafana/pkg/services/live"
|
|
"github.com/grafana/grafana/pkg/services/live/pushhttp"
|
|
"github.com/grafana/grafana/pkg/services/ngalert"
|
|
"github.com/grafana/grafana/pkg/services/notifications"
|
|
plugindashboardsservice "github.com/grafana/grafana/pkg/services/plugindashboards/service"
|
|
"github.com/grafana/grafana/pkg/services/provisioning"
|
|
"github.com/grafana/grafana/pkg/services/rendering"
|
|
"github.com/grafana/grafana/pkg/services/searchV2"
|
|
secretsManager "github.com/grafana/grafana/pkg/services/secrets/manager"
|
|
"github.com/grafana/grafana/pkg/services/serviceaccounts"
|
|
"github.com/grafana/grafana/pkg/services/store"
|
|
"github.com/grafana/grafana/pkg/services/thumbs"
|
|
"github.com/grafana/grafana/pkg/services/updatechecker"
|
|
)
|
|
|
|
func ProvideBackgroundServiceRegistry(
|
|
httpServer *api.HTTPServer, ng *ngalert.AlertNG, cleanup *cleanup.CleanUpService, live *live.GrafanaLive,
|
|
pushGateway *pushhttp.Gateway, notifications *notifications.NotificationService, pm *manager.PluginManager,
|
|
rendering *rendering.RenderingService, tokenService models.UserTokenBackgroundService, tracing tracing.Tracer,
|
|
provisioning *provisioning.ProvisioningServiceImpl, alerting *alerting.AlertEngine, usageStats *uss.UsageStats,
|
|
statsCollector *statscollector.Service, grafanaUpdateChecker *updatechecker.GrafanaService,
|
|
pluginsUpdateChecker *updatechecker.PluginsService, metrics *metrics.InternalMetricsService,
|
|
secretsService *secretsManager.SecretsService, remoteCache *remotecache.RemoteCache,
|
|
thumbnailsService thumbs.Service, StorageService store.StorageService, searchService searchV2.SearchService, entityEventsService store.EntityEventsService,
|
|
// Need to make sure these are initialized, is there a better place to put them?
|
|
_ *dashboardsnapshots.Service, _ *alerting.AlertNotificationService,
|
|
_ serviceaccounts.Service, _ *guardian.Provider,
|
|
_ *plugindashboardsservice.DashboardUpdater,
|
|
) *BackgroundServiceRegistry {
|
|
return NewBackgroundServiceRegistry(
|
|
httpServer,
|
|
ng,
|
|
cleanup,
|
|
live,
|
|
pushGateway,
|
|
notifications,
|
|
rendering,
|
|
tokenService,
|
|
provisioning,
|
|
alerting,
|
|
pm,
|
|
grafanaUpdateChecker,
|
|
pluginsUpdateChecker,
|
|
metrics,
|
|
usageStats,
|
|
statsCollector,
|
|
tracing,
|
|
remoteCache,
|
|
secretsService,
|
|
StorageService,
|
|
thumbnailsService,
|
|
searchService,
|
|
entityEventsService,
|
|
)
|
|
}
|
|
|
|
// BackgroundServiceRegistry provides background services.
|
|
type BackgroundServiceRegistry struct {
|
|
Services []registry.BackgroundService
|
|
}
|
|
|
|
func NewBackgroundServiceRegistry(services ...registry.BackgroundService) *BackgroundServiceRegistry {
|
|
return &BackgroundServiceRegistry{services}
|
|
}
|
|
|
|
func (r *BackgroundServiceRegistry) GetServices() []registry.BackgroundService {
|
|
return r.Services
|
|
}
|