opentelemetrygithubactionsannotationsreceiver

package module
v0.0.0-...-d42a738 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 25 Imported by: 0

README

opentelemetry-github-actions-annotations-receiver

Local Development

Prerequisites
Install tools
Ngrok

The Ngrok can be installed by running:

make install-ngrok
ocb

The OpenTelemetry Collector Builder (OCB) can be installed by running:

make install-ocb
Build the collector
make build
Configure your GitHub repository for testing purposes

Open one terminal and run

make ngrok

Copy the ngrok URL and go to your GitHub repository, in this case we use elastic/oblt-project-tmpl:

  • https://github.com/elastic/oblt-project-tmpl/settings/hooks
    • Payload: https://3012-37-133-56-13.ngrok-free.app/githubactionsannotations or the relevant ngrok URL
    • Content type: application/json
    • Secret: secret - fixed for now for testing purposes
    • Enable SSL verification
    • Individual events:
      • Workflow runs
      • Workflow jobs
Run the collector
make run

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a factory for githubactionsannotationsreceiver.

Types

type Config

type Config struct {
	confighttp.ServerConfig `mapstructure:",squash"`
	Path                    string              `mapstructure:"path"`
	WebhookSecret           configopaque.String `mapstructure:"webhook_secret"`
	GitHubAuth              GitHubAuth          `mapstructure:"github_auth"`
	Retry                   RetryConfig         `mapstructure:"retry"`
	BatchSize               int                 `mapstructure:"batch_size"`
	CustomServiceName       string              `mapstructure:"custom_service_name"`
	ServiceNamePrefix       string              `mapstructure:"service_name_prefix"`
	ServiceNameSuffix       string              `mapstructure:"service_name_suffix"`
}

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the receiver configuration is valid

type GitHubAuth

type GitHubAuth struct {
	AppID          int64               `mapstructure:"app_id"`
	InstallationID int64               `mapstructure:"installation_id"`
	PrivateKey     configopaque.String `mapstructure:"private_key"`
	PrivateKeyPath string              `mapstructure:"private_key_path"`
	Token          configopaque.String `mapstructure:"token"`
}

type LogLine

type LogLine struct {
	Body           string
	Timestamp      time.Time
	SeverityNumber int
	SeverityText   string
}

type Repository

type Repository struct {
	FullName string
	Org      string
	Name     string
}

type RetryConfig

type RetryConfig struct {
	InitialInterval time.Duration `mapstructure:"initial_interval"`
	MaxInterval     time.Duration `mapstructure:"max_interval"`
	MaxElapsedTime  time.Duration `mapstructure:"max_elapsed_time"`
}

type Run

type Run struct {
	ID           int64
	RunAttempt   int64     `json:"run_attempt"`
	RunStartedAt time.Time `json:"run_started_at"`
	URL          string    `json:"html_url"`
	Status       string
	Conclusion   string
	CreatedAt    time.Time `json:"created_at"`
	CompletedAt  time.Time `json:"completed_at"`
	HeadBranch   string
}

Jump to

Keyboard shortcuts

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