Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[profilecli] Add ready command #3497

Merged
merged 3 commits into from
Aug 20, 2024
Merged

[profilecli] Add ready command #3497

merged 3 commits into from
Aug 20, 2024

Conversation

bryanhuhta
Copy link
Contributor

When doing some local testing, I came across the problem where I wanted to quickly check if pyroscope was up. A similar problem was described here #3468 and @korniltsev commented a similar solution #3468 (comment).

$ profilecli ready --help
usage: profilecli ready [<flags>]

Check Pyroscope health.

Flags:
  -h, --help              Show context-sensitive help (also try --help-long and --help-man).
      --version           Show application version.
  -v, --verbose           Enable verbose logging.
      --url="http://localhost:4040"  
                          URL of the profile store.
      --tenant-id=""      The tenant ID to be used for the X-Scope-OrgID header.
      --username=""       The username to be used for basic auth.
      --password=""       The password to be used for basic auth.
      --protocol=connect  The protocol to be used for communicating with the server.

Using profilecli ready will hit the /ready health check endpoint. Examples:

# Local server not accepting traffic
$ profilecli ready
error: Get "http://localhost:4040/ready": dial tcp [::1]:4040: connect: connection refused

# Local server accepting traffic but not ready
$ profilecli ready
level=error msg="not ready" status="503 Service Unavailable" body="Ingester not ready: waiting for 15s after being ready\n"

# Local server accepting traffic and ready
$ profilecli ready
level=info msg=ready

# Remote server accepting traffic but not ready
$ profilecli ready --url "https://firedev001.grafana-dev.net" --username 1218 --password "<redacted>"
level=error msg="not ready" status="503 Service Unavailable" body="{\"code\":\"Loading\",\"message\":\"Your instance is loading, and will be ready shortly.\"}\n"

# Remote server accepting traffic and ready
$ profilecli ready --url "https://firedev001.grafana-dev.net" --username 1218 --password "<redacted>"
level=info msg=ready

@bryanhuhta bryanhuhta self-assigned this Aug 16, 2024
@bryanhuhta bryanhuhta requested a review from a team as a code owner August 16, 2024 19:57
Copy link
Collaborator

@korniltsev korniltsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bryanhuhta bryanhuhta merged commit e19b112 into main Aug 20, 2024
18 checks passed
@bryanhuhta bryanhuhta deleted the profilecli-ready branch August 20, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants