opentelemetrygithubactionsannotationsreceiver

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 26 Imported by: 0

README

GitHub Actions Annotations Receiver

Status
Stability alpha: logs

Table of Contents

Overview

The GitHub Actions Annotations receiver receives data from GitHub via one method:

  1. Receives GitHub Actions events by serving a webhook endpoint, converting those events into logs.

Logs - Getting Started

Log support is accomplished through the processing of GitHub Actions webhook events for workflows and jobs. The workflow_job and workflow_run event payloads are then constructed into logs telemetry.

Each GitHub Action workflow or job, along with its steps, are converted into logs as soon as there are using annotations.

Receiver Configuration

IMPORTANT - Ensure your WebHook endpoint is secured with a secret and a Web Application Firewall (WAF) or other security measure.

The WebHook configuration exposes the following settings:

  • endpoint: (default = localhost:8080) - The address and port to bind the WebHook to.
  • path: (default = /events) - The path for Action events to be sent to.
  • webhook_secret: (no default) - The webhook secret used to validates the payload.
  • token: (no default): The GH personal access token if no GitHub app.
  • app_id: (no default): The GitHub app id.
  • installation_id: (no default): The GitHub App installation id.
  • private_key_path: (no default): The GitHub app private key.

An example configuration is as follows:

receivers:
    githubactionsannotations:
        webhook_secret: ${env:WEBHOOK_SECRET}
        github_auth:
            #token: ${env:GITHUB_TOKEN}
            app_id: ${env:GITHUB_APP_ID}
            installation_id: ${env:INSTALLATION_ID}
            private_key_path: ${env:PRIVATE_KEY}
        path: /events
GitHub Personal Access Token (PAT) Setup

To create a GitHub Personal Access Token (PAT), please refer to the official documentation.

Organization or Personal Access: When generating the PAT, select the appropriate Resource owner — either your personal account or the organization and choose the correct Repository access type. For fine-grained tokens, explicitly configure the necessary Repository permissions or Organization permissions.

Note: The PAT must have read access to the target repositories. If the PAT doesn't have permission to access repositories in the target organization, logs cannot be fetched.

Configuring A GitHub App

To configure a GitHub App, you will need to create a new GitHub App within your organization. Refer to the general GitHub App documentation for how to create a GitHub App. During the subscription phase, subscribe to workflow_run and workflow_job events.

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