Skip to content

Commit

Permalink
Remove juju-introspect; add relation for profile targets (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Jul 26, 2022
1 parent 88abec3 commit 7537ae0
Show file tree
Hide file tree
Showing 19 changed files with 2,547 additions and 359 deletions.
40 changes: 22 additions & 18 deletions README.md
@@ -1,36 +1,40 @@
# Parca Operator for Juju Controllers
# Parca Operator

**NOTE: This operator is not production ready, and should be used for testing purposes only!**
Parca provides continuous profiling for analysis of CPU and memory usage, down to the line number
and throughout time. Saving infrastructure cost, improving performance, and increasing reliability.

This charm is the result of an afternoon of experimentation with Parca, published here as a memory
jogger for future me!
This operator builds a simple deployment of the Parca server and provides a relation interface such
that it can be integrated with other Juju charms in a model. A good example of this is the
[juju-introspect](https://charmhub.io/juju-introspect) operator, which when related to this charm
will enable continuous profiling of the Juju controller its attached to.

It represents a simple deployment of the Parca server, along with configuration to run
`juju-introspect` as a systemd service to allow Parca to scrape profiling information from the
machine agent.
## Usage

This operator will install the latest Parca release from Github, and install it along with the
relevant systemd units to start it and configure it.
You can deploy the operator as such:

## Usage
```shell
# Deploy the charm
$ juju deploy parca --channel edge
```

This operator has been tested profiling machine based Juju controllers (as opposed to Kubernetes
controllers!)
Once the deployment is complete, you can get to the Parca dashboard at:
`http://<controller-address>:7070/`

You can deploy the operator as such:
To profile a Juju controller, you can do the following:

```shell
# Bootstrap a new Juju controller on LXD
$ juju bootstrap localhost lxd
# Switch to the controller model
$ juju switch controller
# Deploy the charm to the controller machine
$ juju deploy --to 0 parca-juju-profiler --channel edge
# Deploy the juju-introspect charm to the controller machine
$ juju deploy --to=0 juju-introspect --channel edge
# Deploy the Parca charm
$ juju deploy parca --channel edge
# Relate the two charms to enable scraping
$ juju relate parca juju-introspect
```

Once the deployment is complete, you can get to the Parca dashboard at:
`http://<controller-address>:7070/`

## Configuration

By default, Parca will store profiles **in memory**. This is the current default, as the
Expand Down
7 changes: 0 additions & 7 deletions config.yaml
Expand Up @@ -12,10 +12,3 @@ options:
Does nothing if storage-persist is True.
type: int
default: 4096

juju-scrape-interval:
description: |
The interval (in seconds) upon which to scrape the juju-introspect pprof endpoint for
profiles. Tune according to storage/memory usage needs.
type: int
default: 5

0 comments on commit 7537ae0

Please sign in to comment.