An open API service indexing awesome lists of open source software.

https://github.com/botify-labs/profilecli-action


https://github.com/botify-labs/profilecli-action

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# profilecli-action

A GitHub Action to download and commit a PGO profile using
[profilecli](https://grafana.com/docs/pyroscope/latest/view-and-analyze-profile-data/profile-cli/).

## Prerequisites

- On your repository, go to Settings > Actions > General and check
`Allow GitHub Actions to create and approve pull requests`

- `GH_TOKEN` must be set in your workflow environment:
```yaml
env:
GH_TOKEN: ${{ github.token }}
```

## Usage example

```yaml
name: Profiling

on:
schedule:
- cron: "0 8 * * 1" # every Monday at 08:00am

env:
GH_TOKEN: ${{ github.token }} # required

permissions:
contents: write
pull-requests: write

jobs:
profiling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Download profile
uses: botify-labs/profilecli-action@v1
with:
endpoint: https://example.com/my-endpoint
username: ${{ secrets.PROFILING_USERNAME }}
password: ${{ secrets.PROFILING_PASSWORD }}
query: '{service_name=""}'
output_path: default.pgo
range_from: now-24h
range_to: now
```

## Parameters

| Name | Default value | Description |
| -------------------- | ------------------------------------------- | ------------------------------------------------------- |
| `endpoint`\* | - | API endpoint to fetch profiling data. |
| `query`\* | - | Query used to filter profiling data. |
| `username`\* | - | Username for authentication. |
| `password`\* | - | Password for authentication. |
| `output_path` | `default.pgo` | File path to save the profile output. |
| `range_from` | `now-24h` | Start time for the profiling range. |
| `range_to` | `now` | End time for the profiling range. |
| `profile_type` | `process_cpu:samples:count:cpu:nanoseconds` | Type of profile to fetch and analyze. |
| `profilecli_version` | `"1.1.5"` | Version of profilecli to use. |
| `pr_title` | `"Generate Go profile"` | Title for the pull request that will be created. |
| `pr_body` | `"Autogenerated profile update."` | Body content for the pull request that will be created. |