gitlabreceiver

package module
v0.76.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

GitLab Receiver

Status
Stability development: metrics
Distributions [liatrio]
Issues Open issues Closed issues

[liatrio]:

The GitLab receiver receives data from GitLab. As a starting point it scrapes metrics from projects but will be extended to include traces and logs.

The current default set of metrics can be found in documentation.md.

These metrics can be used as leading indicators (capabilities) to the DORA metrics; helping provide insight into modern-day engineering practices.

Getting Started

The collection interval is common to all scrapers and is set to 30 seconds by default.

Note: Generally speaking, if the vendor allows for anonymous API calls, then you won't have to configure any authentication, but you may only see public repositories and organizations. You may run into significantly more rate limiting.

gitlab:
    initial_delay: <duration>
    collection_interval: <duration> #default = 30s recommended 300s
    scrapers:
        gitlab:
        ...

A more complete example using the GitLab scrapers with authentication is as follows:

extensions:
    bearertokenauth/gitlab:
        token: ${env:GL_PAT}

receivers:
    gitlab:
        initial_delay: 1s
        collection_interval: 60s
        scrapers:
            gitlab:
                metrics:
                    vcs.repository.contributor.count:
                        enabled: true
                gitlab_org: myfancyorg
                search_query: "org:myfancyorg topic:o11yalltheway" #Recommended optional query override, defaults to "{org,user}:<gitlab_org>"
                endpoint: "https://selfmanagedenterpriseserver.com"
                auth:
                    authenticator: bearertokenauth/gitlab
service:
    extensions: [bearertokenauth/gitlab]
    pipelines:
        metrics:
            receivers: [..., gitlab]
            processors: []
            exporters: [...]

A Grafana Dashboard exists on the marketplace for metrics from this receiver and can be found here.

Scraping

Important:

  • The GitLab scraper does not emit metrics for refs that have not had changes since creation from the default ref (trunk).
  • Due to GitHub API limitations, it is possible for the ref time metric to change when rebases occur, recreating the commits with new timestamps.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a factory for the gitlab receiver

Types

type Config

type Config struct {
	scraperhelper.ControllerConfig `mapstructure:",squash"`
	Scrapers                       map[string]internal.Config `mapstructure:"scrapers"`
	metadata.MetricsBuilderConfig  `mapstructure:",squash"`
}

Config that is exposed to this github receiver through the OTEL config.yaml

func (*Config) Unmarshal

func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error

Unmarshal a config.Parser into the config struct.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate the configuration passed through the OTEL config.yaml

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL