feat: Support OTLP and Prometheus APM metrics #170
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Added a
metrics
config section, allowing users to enable OTLP or Prometheus metrics. The Prometheus metrics include the require annotations for being scraped by the Kubernetes Prometheus Node source.When using the Prometheus metrics, users can configure the BindPlane node agent to autodetect and scrape the BindPlane pods for metrics.
When using OTLP, users can configure BindPlane to push metrics to any OTLP receiver, such as the Node or Gateway agents.
Testing
Deploy minikube
minikube start minikube addons enable ingress kubectl apply -f test/helper/postgres/postgres.yaml
Create a license secret from
$BINDPLANE_LICENSE
kubectl create secret generic bindplane \ --from-literal=license=$BINDPLANE_LICENSE
Create a
values.yaml
file in root of the helm repo.Checkout this branch and deploy BindPlane
Wait for the pods to come up:
Make sure you have the following
/etc/hosts
entryRun
minikube tunnel
in a new terminal, and then go to http://bindplane.local.Sign in with
bpuser
/bppass
.bindplane_.*
kubectl apply -f ~/Downloads/bindplane-agent.yaml
Once the agent is up, roll the config out and verify that OTLP metrics show up in Live Preview. You will need to wait up to 60 seconds.
Edit
values.yaml
changemetrics.type: otlp
tometrics.type: prometheus
. Re-deploy.Once the pods are up, wait 60 seconds and check Prometheus live preview. You should be getting a handful of metrics. Notice that the metrics are prefixed with
bindplane_
, this is by design.Please check that the PR fulfills these requirements