Documentation ¶
Index ¶
- func NewCollectorCoverage() prometheus.Collector
- func NewCollectorDurationSeconds() prometheus.Collector
- func NewCollectorEnvironmentBehindCommitsCount() prometheus.Collector
- func NewCollectorEnvironmentBehindDurationSeconds() prometheus.Collector
- func NewCollectorEnvironmentDeploymentCount() prometheus.Collector
- func NewCollectorEnvironmentDeploymentDurationSeconds() prometheus.Collector
- func NewCollectorEnvironmentDeploymentJobID() prometheus.Collector
- func NewCollectorEnvironmentDeploymentStatus() prometheus.Collector
- func NewCollectorEnvironmentDeploymentTimestamp() prometheus.Collector
- func NewCollectorEnvironmentInformation() prometheus.Collector
- func NewCollectorID() prometheus.Collector
- func NewCollectorJobArtifactSizeBytes() prometheus.Collector
- func NewCollectorJobDurationSeconds() prometheus.Collector
- func NewCollectorJobID() prometheus.Collector
- func NewCollectorJobQueuedDurationSeconds() prometheus.Collector
- func NewCollectorJobRunCount() prometheus.Collector
- func NewCollectorJobStatus() prometheus.Collector
- func NewCollectorJobTimestamp() prometheus.Collector
- func NewCollectorQueuedDurationSeconds() prometheus.Collector
- func NewCollectorRunCount() prometheus.Collector
- func NewCollectorStatus() prometheus.Collector
- func NewCollectorTimestamp() prometheus.Collector
- func NewInternalCollectorCurrentlyQueuedTasksCount() prometheus.Collector
- func NewInternalCollectorEnvironmentsCount() prometheus.Collector
- func NewInternalCollectorExecutedTasksCount() prometheus.Collector
- func NewInternalCollectorGitLabAPIRequestsCount() prometheus.Collector
- func NewInternalCollectorGitLabAPIRequestsLimit() prometheus.Collector
- func NewInternalCollectorGitLabAPIRequestsRemaining() prometheus.Collector
- func NewInternalCollectorMetricsCount() prometheus.Collector
- func NewInternalCollectorProjectsCount() prometheus.Collector
- func NewInternalCollectorRefsCount() prometheus.Collector
- type Controller
- func (c *Controller) GarbageCollectEnvironments(_ context.Context) error
- func (c *Controller) GarbageCollectMetrics(_ context.Context) error
- func (c *Controller) GarbageCollectProjects(_ context.Context) error
- func (c *Controller) GarbageCollectRefs(_ context.Context) error
- func (c *Controller) GetRefs(p schemas.Project) (refs schemas.Refs, err error)
- func (c *Controller) HealthCheckHandler() (h healthcheck.Handler)
- func (c *Controller) MetricsHandler(w http.ResponseWriter, r *http.Request)
- func (c *Controller) ProcessJobMetrics(ref schemas.Ref, job schemas.Job)
- func (c *Controller) PullEnvironmentMetrics(env schemas.Environment) (err error)
- func (c *Controller) PullEnvironmentsFromProject(ctx context.Context, p schemas.Project) (err error)
- func (c *Controller) PullProjectsFromWildcard(ctx context.Context, w config.Wildcard) error
- func (c *Controller) PullRefMetrics(ref schemas.Ref) error
- func (c *Controller) PullRefMostRecentJobsMetrics(ref schemas.Ref) error
- func (c *Controller) PullRefPipelineJobsMetrics(ref schemas.Ref) error
- func (c *Controller) PullRefsFromProject(ctx context.Context, p schemas.Project) error
- func (c *Controller) Schedule(ctx context.Context, pull config.Pull, gc config.GarbageCollect)
- func (c *Controller) ScheduleRedisSetKeepalive(ctx context.Context)
- func (c *Controller) ScheduleTask(ctx context.Context, tt schemas.TaskType, uniqueID string, args ...interface{})
- func (c *Controller) ScheduleTaskWithTicker(ctx context.Context, tt schemas.TaskType, intervalSeconds int)
- func (c *Controller) TaskHandlerGarbageCollectEnvironments(ctx context.Context) error
- func (c *Controller) TaskHandlerGarbageCollectMetrics(ctx context.Context) error
- func (c *Controller) TaskHandlerGarbageCollectProjects(ctx context.Context) error
- func (c *Controller) TaskHandlerGarbageCollectRefs(ctx context.Context) error
- func (c *Controller) TaskHandlerPullEnvironmentMetrics(env schemas.Environment)
- func (c *Controller) TaskHandlerPullEnvironmentsFromProject(ctx context.Context, p schemas.Project)
- func (c *Controller) TaskHandlerPullEnvironmentsFromProjects(ctx context.Context)
- func (c *Controller) TaskHandlerPullMetrics(ctx context.Context)
- func (c *Controller) TaskHandlerPullProjectsFromWildcard(ctx context.Context, id string, w config.Wildcard) error
- func (c *Controller) TaskHandlerPullProjectsFromWildcards(ctx context.Context)
- func (c *Controller) TaskHandlerPullRefMetrics(ref schemas.Ref)
- func (c *Controller) TaskHandlerPullRefsFromProject(ctx context.Context, p schemas.Project)
- func (c *Controller) TaskHandlerPullRefsFromProjects(ctx context.Context)
- func (c *Controller) UpdateEnvironment(env *schemas.Environment) error
- func (c *Controller) WebhookHandler(w http.ResponseWriter, r *http.Request)
- type Registry
- func (r *Registry) ExportInternalMetrics(g *gitlab.Client, s store.Store) (err error)
- func (r *Registry) ExportMetrics(metrics schemas.Metrics)
- func (r *Registry) GetCollector(kind schemas.MetricKind) prometheus.Collector
- func (r *Registry) RegisterCollectors() error
- func (r *Registry) RegisterInternalCollectors()
- type RegistryCollectors
- type TaskController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCollectorCoverage ¶
func NewCollectorCoverage() prometheus.Collector
NewCollectorCoverage returns a new collector for the gitlab_ci_pipeline_coverage metric
func NewCollectorDurationSeconds ¶
func NewCollectorDurationSeconds() prometheus.Collector
NewCollectorDurationSeconds returns a new collector for the gitlab_ci_pipeline_duration_seconds metric
func NewCollectorEnvironmentBehindCommitsCount ¶
func NewCollectorEnvironmentBehindCommitsCount() prometheus.Collector
NewCollectorEnvironmentBehindCommitsCount returns a new collector for the gitlab_ci_environment_behind_commits_count metric
func NewCollectorEnvironmentBehindDurationSeconds ¶
func NewCollectorEnvironmentBehindDurationSeconds() prometheus.Collector
NewCollectorEnvironmentBehindDurationSeconds returns a new collector for the gitlab_ci_environment_behind_duration_seconds metric
func NewCollectorEnvironmentDeploymentCount ¶
func NewCollectorEnvironmentDeploymentCount() prometheus.Collector
NewCollectorEnvironmentDeploymentCount returns a new collector for the gitlab_ci_environment_deployment_count metric
func NewCollectorEnvironmentDeploymentDurationSeconds ¶
func NewCollectorEnvironmentDeploymentDurationSeconds() prometheus.Collector
NewCollectorEnvironmentDeploymentDurationSeconds returns a new collector for the gitlab_ci_environment_deployment_duration_seconds metric
func NewCollectorEnvironmentDeploymentJobID ¶
func NewCollectorEnvironmentDeploymentJobID() prometheus.Collector
NewCollectorEnvironmentDeploymentJobID returns a new collector for the gitlab_ci_environment_deployment_id metric
func NewCollectorEnvironmentDeploymentStatus ¶
func NewCollectorEnvironmentDeploymentStatus() prometheus.Collector
NewCollectorEnvironmentDeploymentStatus returns a new collector for the gitlab_ci_environment_deployment_status metric
func NewCollectorEnvironmentDeploymentTimestamp ¶
func NewCollectorEnvironmentDeploymentTimestamp() prometheus.Collector
NewCollectorEnvironmentDeploymentTimestamp returns a new collector for the gitlab_ci_environment_deployment_timestamp metric
func NewCollectorEnvironmentInformation ¶
func NewCollectorEnvironmentInformation() prometheus.Collector
NewCollectorEnvironmentInformation returns a new collector for the gitlab_ci_environment_information metric
func NewCollectorID ¶
func NewCollectorID() prometheus.Collector
NewCollectorID returns a new collector for the gitlab_ci_pipeline_id metric
func NewCollectorJobArtifactSizeBytes ¶
func NewCollectorJobArtifactSizeBytes() prometheus.Collector
NewCollectorJobArtifactSizeBytes returns a new collector for the gitlab_ci_pipeline_job_artifact_size_bytes metric
func NewCollectorJobDurationSeconds ¶
func NewCollectorJobDurationSeconds() prometheus.Collector
NewCollectorJobDurationSeconds returns a new collector for the gitlab_ci_pipeline_job_duration_seconds metric
func NewCollectorJobID ¶
func NewCollectorJobID() prometheus.Collector
NewCollectorJobID returns a new collector for the gitlab_ci_pipeline_job_id metric
func NewCollectorJobQueuedDurationSeconds ¶
func NewCollectorJobQueuedDurationSeconds() prometheus.Collector
NewCollectorJobQueuedDurationSeconds returns a new collector for the gitlab_ci_pipeline_job_queued_duration_seconds metric
func NewCollectorJobRunCount ¶
func NewCollectorJobRunCount() prometheus.Collector
NewCollectorJobRunCount returns a new collector for the gitlab_ci_pipeline_job_run_count metric
func NewCollectorJobStatus ¶
func NewCollectorJobStatus() prometheus.Collector
NewCollectorJobStatus returns a new collector for the gitlab_ci_pipeline_job_status metric
func NewCollectorJobTimestamp ¶
func NewCollectorJobTimestamp() prometheus.Collector
NewCollectorJobTimestamp returns a new collector for the gitlab_ci_pipeline_job_timestamp metric
func NewCollectorQueuedDurationSeconds ¶
func NewCollectorQueuedDurationSeconds() prometheus.Collector
NewCollectorQueuedDurationSeconds returns a new collector for the gitlab_ci_pipeline_queued_duration_seconds metric
func NewCollectorRunCount ¶
func NewCollectorRunCount() prometheus.Collector
NewCollectorRunCount returns a new collector for the gitlab_ci_pipeline_run_count metric
func NewCollectorStatus ¶
func NewCollectorStatus() prometheus.Collector
NewCollectorStatus returns a new collector for the gitlab_ci_pipeline_status metric
func NewCollectorTimestamp ¶
func NewCollectorTimestamp() prometheus.Collector
NewCollectorTimestamp returns a new collector for the gitlab_ci_pipeline_timestamp metric
func NewInternalCollectorCurrentlyQueuedTasksCount ¶ added in v0.5.1
func NewInternalCollectorCurrentlyQueuedTasksCount() prometheus.Collector
NewInternalCollectorCurrentlyQueuedTasksCount returns a new collector for the gcpe_currently_queued_tasks_count metric
func NewInternalCollectorEnvironmentsCount ¶ added in v0.5.1
func NewInternalCollectorEnvironmentsCount() prometheus.Collector
NewInternalCollectorEnvironmentsCount returns a new collector for the gcpe_environments_count metric
func NewInternalCollectorExecutedTasksCount ¶ added in v0.5.1
func NewInternalCollectorExecutedTasksCount() prometheus.Collector
NewInternalCollectorExecutedTasksCount returns a new collector for the gcpe_executed_tasks_count metric
func NewInternalCollectorGitLabAPIRequestsCount ¶ added in v0.5.1
func NewInternalCollectorGitLabAPIRequestsCount() prometheus.Collector
NewInternalCollectorGitLabAPIRequestsCount returns a new collector for the gcpe_gitlab_api_requests_count metric
func NewInternalCollectorGitLabAPIRequestsLimit ¶ added in v0.5.3
func NewInternalCollectorGitLabAPIRequestsLimit() prometheus.Collector
NewInternalCollectorGitLabAPIRequestsLimit returns a new collector for the gcpe_gitlab_api_requests_limit metric
func NewInternalCollectorGitLabAPIRequestsRemaining ¶ added in v0.5.3
func NewInternalCollectorGitLabAPIRequestsRemaining() prometheus.Collector
NewInternalCollectorGitLabAPIRequestsRemaining returns a new collector for the gcpe_gitlab_api_requests_remaining metric
func NewInternalCollectorMetricsCount ¶ added in v0.5.1
func NewInternalCollectorMetricsCount() prometheus.Collector
NewInternalCollectorMetricsCount returns a new collector for the gcpe_metrics_count metric
func NewInternalCollectorProjectsCount ¶ added in v0.5.1
func NewInternalCollectorProjectsCount() prometheus.Collector
NewInternalCollectorProjectsCount returns a new collector for the gcpe_projects_count metric
func NewInternalCollectorRefsCount ¶ added in v0.5.1
func NewInternalCollectorRefsCount() prometheus.Collector
NewInternalCollectorRefsCount returns a new collector for the gcpe_refs_count metric
Types ¶
type Controller ¶
type Controller struct { Config config.Config Redis *redis.Client Gitlab *gitlab.Client Store store.Store TaskController TaskController // UUID is used to identify this controller/process amongst others when // the exporter is running in cluster mode, leveraging Redis. UUID uuid.UUID }
Controller holds the necessary clients to run the app and handle requests
func (*Controller) GarbageCollectEnvironments ¶
func (c *Controller) GarbageCollectEnvironments(_ context.Context) error
GarbageCollectEnvironments ..
func (*Controller) GarbageCollectMetrics ¶
func (c *Controller) GarbageCollectMetrics(_ context.Context) error
GarbageCollectMetrics ..
func (*Controller) GarbageCollectProjects ¶
func (c *Controller) GarbageCollectProjects(_ context.Context) error
GarbageCollectProjects ..
func (*Controller) GarbageCollectRefs ¶
func (c *Controller) GarbageCollectRefs(_ context.Context) error
GarbageCollectRefs ..
func (*Controller) HealthCheckHandler ¶
func (c *Controller) HealthCheckHandler() (h healthcheck.Handler)
HealthCheckHandler ..
func (*Controller) MetricsHandler ¶
func (c *Controller) MetricsHandler(w http.ResponseWriter, r *http.Request)
MetricsHandler ..
func (*Controller) ProcessJobMetrics ¶
func (c *Controller) ProcessJobMetrics(ref schemas.Ref, job schemas.Job)
ProcessJobMetrics ..
func (*Controller) PullEnvironmentMetrics ¶
func (c *Controller) PullEnvironmentMetrics(env schemas.Environment) (err error)
PullEnvironmentMetrics ..
func (*Controller) PullEnvironmentsFromProject ¶
func (c *Controller) PullEnvironmentsFromProject(ctx context.Context, p schemas.Project) (err error)
PullEnvironmentsFromProject ..
func (*Controller) PullProjectsFromWildcard ¶
PullProjectsFromWildcard ..
func (*Controller) PullRefMetrics ¶
func (c *Controller) PullRefMetrics(ref schemas.Ref) error
PullRefMetrics ..
func (*Controller) PullRefMostRecentJobsMetrics ¶
func (c *Controller) PullRefMostRecentJobsMetrics(ref schemas.Ref) error
PullRefMostRecentJobsMetrics ..
func (*Controller) PullRefPipelineJobsMetrics ¶
func (c *Controller) PullRefPipelineJobsMetrics(ref schemas.Ref) error
PullRefPipelineJobsMetrics ..
func (*Controller) PullRefsFromProject ¶
PullRefsFromProject ..
func (*Controller) Schedule ¶
func (c *Controller) Schedule(ctx context.Context, pull config.Pull, gc config.GarbageCollect)
Schedule ..
func (*Controller) ScheduleRedisSetKeepalive ¶ added in v0.5.3
func (c *Controller) ScheduleRedisSetKeepalive(ctx context.Context)
ScheduleRedisSetKeepalive will ensure that whilst the process is running, a key is periodically updated within Redis to let other instances know this one is alive and processing tasks.
func (*Controller) ScheduleTask ¶
func (c *Controller) ScheduleTask(ctx context.Context, tt schemas.TaskType, uniqueID string, args ...interface{})
ScheduleTask ..
func (*Controller) ScheduleTaskWithTicker ¶
func (c *Controller) ScheduleTaskWithTicker(ctx context.Context, tt schemas.TaskType, intervalSeconds int)
ScheduleTaskWithTicker ..
func (*Controller) TaskHandlerGarbageCollectEnvironments ¶
func (c *Controller) TaskHandlerGarbageCollectEnvironments(ctx context.Context) error
TaskHandlerGarbageCollectEnvironments ..
func (*Controller) TaskHandlerGarbageCollectMetrics ¶
func (c *Controller) TaskHandlerGarbageCollectMetrics(ctx context.Context) error
TaskHandlerGarbageCollectMetrics ..
func (*Controller) TaskHandlerGarbageCollectProjects ¶
func (c *Controller) TaskHandlerGarbageCollectProjects(ctx context.Context) error
TaskHandlerGarbageCollectProjects ..
func (*Controller) TaskHandlerGarbageCollectRefs ¶
func (c *Controller) TaskHandlerGarbageCollectRefs(ctx context.Context) error
TaskHandlerGarbageCollectRefs ..
func (*Controller) TaskHandlerPullEnvironmentMetrics ¶
func (c *Controller) TaskHandlerPullEnvironmentMetrics(env schemas.Environment)
TaskHandlerPullEnvironmentMetrics ..
func (*Controller) TaskHandlerPullEnvironmentsFromProject ¶
func (c *Controller) TaskHandlerPullEnvironmentsFromProject(ctx context.Context, p schemas.Project)
TaskHandlerPullEnvironmentsFromProject ..
func (*Controller) TaskHandlerPullEnvironmentsFromProjects ¶
func (c *Controller) TaskHandlerPullEnvironmentsFromProjects(ctx context.Context)
TaskHandlerPullEnvironmentsFromProjects ..
func (*Controller) TaskHandlerPullMetrics ¶
func (c *Controller) TaskHandlerPullMetrics(ctx context.Context)
TaskHandlerPullMetrics ..
func (*Controller) TaskHandlerPullProjectsFromWildcard ¶
func (c *Controller) TaskHandlerPullProjectsFromWildcard(ctx context.Context, id string, w config.Wildcard) error
TaskHandlerPullProjectsFromWildcard ..
func (*Controller) TaskHandlerPullProjectsFromWildcards ¶
func (c *Controller) TaskHandlerPullProjectsFromWildcards(ctx context.Context)
TaskHandlerPullProjectsFromWildcards ..
func (*Controller) TaskHandlerPullRefMetrics ¶
func (c *Controller) TaskHandlerPullRefMetrics(ref schemas.Ref)
TaskHandlerPullRefMetrics ..
func (*Controller) TaskHandlerPullRefsFromProject ¶
func (c *Controller) TaskHandlerPullRefsFromProject(ctx context.Context, p schemas.Project)
TaskHandlerPullRefsFromProject ..
func (*Controller) TaskHandlerPullRefsFromProjects ¶
func (c *Controller) TaskHandlerPullRefsFromProjects(ctx context.Context)
TaskHandlerPullRefsFromProjects ..
func (*Controller) UpdateEnvironment ¶
func (c *Controller) UpdateEnvironment(env *schemas.Environment) error
UpdateEnvironment ..
func (*Controller) WebhookHandler ¶
func (c *Controller) WebhookHandler(w http.ResponseWriter, r *http.Request)
WebhookHandler ..
type Registry ¶
type Registry struct { *prometheus.Registry InternalCollectors struct { CurrentlyQueuedTasksCount prometheus.Collector EnvironmentsCount prometheus.Collector ExecutedTasksCount prometheus.Collector GitLabAPIRequestsCount prometheus.Collector GitlabAPIRequestsRemaining prometheus.Collector GitlabAPIRequestsLimit prometheus.Collector MetricsCount prometheus.Collector ProjectsCount prometheus.Collector RefsCount prometheus.Collector } Collectors RegistryCollectors }
Registry wraps a pointer of prometheus.Registry
func (*Registry) ExportInternalMetrics ¶ added in v0.5.1
ExportInternalMetrics ..
func (*Registry) ExportMetrics ¶
ExportMetrics ..
func (*Registry) GetCollector ¶
func (r *Registry) GetCollector(kind schemas.MetricKind) prometheus.Collector
GetCollector ..
func (*Registry) RegisterCollectors ¶
RegisterCollectors add all our metrics to the registry
func (*Registry) RegisterInternalCollectors ¶ added in v0.5.1
func (r *Registry) RegisterInternalCollectors()
RegisterInternalCollectors declare our internal collectors to the registry
type RegistryCollectors ¶
type RegistryCollectors map[schemas.MetricKind]prometheus.Collector
RegistryCollectors ..
type TaskController ¶
type TaskController struct { Factory taskq.Factory Queue taskq.Queue TaskMap *taskq.TaskMap TaskSchedulingMonitoring map[schemas.TaskType]*monitor.TaskSchedulingStatus }
TaskController holds task related clients
func NewTaskController ¶
func NewTaskController(r *redis.Client) (t TaskController)
NewTaskController initializes and returns a new TaskController object