Skip to content

Commit

Permalink
feat: Support OTLP and Prometheus APM metrics (#170)
Browse files Browse the repository at this point in the history
* feat: Support OTLP and Prometheus APM metrics

* sync docs
  • Loading branch information
jsirianni authored Oct 3, 2024
1 parent ea233d0 commit 4cd2cf2
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/bindplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: bindplane
description: BindPlane OP is an observability pipeline.
type: application
# The chart's version
version: 1.19.3
version: 1.20.0
# The BindPlane OP tagged release. If the user does not
# set the `image.tag` values option, this version is used.
appVersion: 1.75.0
Expand Down
7 changes: 5 additions & 2 deletions charts/bindplane/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bindplane

![Version: 1.19.3](https://img.shields.io/badge/Version-1.19.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.75.0](https://img.shields.io/badge/AppVersion-1.75.0-informational?style=flat-square)
![Version: 1.20.0](https://img.shields.io/badge/Version-1.20.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.74.2](https://img.shields.io/badge/AppVersion-1.74.2-informational?style=flat-square)

BindPlane OP is an observability pipeline.

Expand Down Expand Up @@ -107,6 +107,9 @@ BindPlane OP is an observability pipeline.
| jobs.resources.limits.memory | string | `"1000Mi"` | Memory limit. |
| jobs.resources.requests.cpu | string | `"1000m"` | CPU request. |
| jobs.resources.requests.memory | string | `"1000Mi"` | Memory request. |
| metrics.otlp.endpoint | string | `""` | Endpoint of the OTLP gRPC metrics receiver. Should be in the form of ip:port or host:port. |
| metrics.otlp.insecure | bool | `false` | Set to `true` to disable TLS. Set to false if TLS is in use by the OTLP metrics receiver. |
| metrics.type | string | `""` | Metrics type to use. Valid options include `otlp` and `prometheus`. When `otlp` is enabled, metrics are pushed to the configured OTel receiver. When `prometheus` is enabled, metrics are exposed in Prometheus format by BindPlane's HTTP server at `/metrics`. |
| multiAccount | bool | `false` | Whether or not to enable multi account (tenant). |
| nats.deploymentType | string | `"StatefulSet"` | Deployment Type for NATs. Valid options include `StatefulSet` and `Deployment`, case sensitive. StatefulSet is recommended, and does not consume a volume mount. If your cluster is restricted to using Deployments, you can use that option instead. |
| nats.resources | object | `{"limits":{"memory":"1000Mi"},"requests":{"cpu":"1000m","memory":"1000Mi"}}` | NATs server resources request block, when event bus type is `nats`. |
Expand Down Expand Up @@ -157,7 +160,7 @@ BindPlane OP is an observability pipeline.
| topologySpreadConstraints.nats | list | `[]` | This is for configuring spec.template.spec.topologySpreadConstraints on the BindPlane NATS statefulset pods, if NATS is enabled. |
| topologySpreadConstraints.prometheus | list | `[]` | This is for configuring spec.template.spec.topologySpreadConstraints on the BindPlane Prometheus pod. The Prometheus pod is a single pod deployment. |
| topologySpreadConstraints.transform_agent | list | `[]` | This is for configuring spec.template.spec.topologySpreadConstraints on the BindPlane transform agent pod. The transform agent pod is a single pod deployment. |
| trace.otlp.endpoint | string | `""` | Endpoint of the OTLP trace receiver. Should be in the form of ip:port or host:port. |
| trace.otlp.endpoint | string | `""` | Endpoint of the OTLP gRPC trace receiver. Should be in the form of ip:port or host:port. |
| trace.otlp.insecure | bool | `false` | Set to `true` to disable TLS. Set to false if TLS is in use by the OTLP trace receiver. |
| trace.otlp.samplingRate | string | `"1"` | Sampling rate between 0 and 1. 1 being 100% of traces are sent. |
| trace.type | string | `""` | Trace type to use. Valid options include `otlp`. |
Expand Down
22 changes: 22 additions & 0 deletions charts/bindplane/templates/bindplane-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
annotations:
{{- if eq .Values.metrics.type "prometheus" }}
prometheus.io/scrape: "true"
prometheus.io/path: /metrics
prometheus.io/port: "3001"
prometheus.io/scheme: http
prometheus.io/job-name: bindplane-op
{{- end }}
labels:
app.kubernetes.io/name: {{ include "bindplane.name" . }}
app.kubernetes.io/stack: bindplane
Expand Down Expand Up @@ -438,6 +446,20 @@ spec:
value: /prometheus-client.key
{{- end }}
{{- end }}
{{- if eq .Values.metrics.type "prometheus" }}
- name: BINDPLANE_METRICS_TYPE
value: prometheus
- name: BINDPLANE_METRICS_PROMETHEUS_ENDPOINT
value: /metrics
{{- end }}
{{- if eq .Values.metrics.type "otlp" }}
- name: BINDPLANE_METRICS_TYPE
value: otlp
- name: BINDPLANE_METRICS_OTLP_ENDPOINT
value: {{ .Values.metrics.otlp.endpoint }}
- name: BINDPLANE_METRICS_OTLP_INSECURE
value: "{{ .Values.metrics.otlp.insecure }}"
{{- end }}
{{- if len .Values.extraEnv }}
{{- toYaml .Values.extraEnv | nindent 12 }}
{{- end }}
Expand Down
22 changes: 22 additions & 0 deletions charts/bindplane/templates/bindplane-nats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
annotations:
{{- if eq .Values.metrics.type "prometheus" }}
prometheus.io/scrape: "true"
prometheus.io/path: /metrics
prometheus.io/port: "3001"
prometheus.io/scheme: http
prometheus.io/job-name: bindplane-op
{{- end }}
labels:
app.kubernetes.io/name: {{ include "bindplane.name" . }}
app.kubernetes.io/stack: bindplane
Expand Down Expand Up @@ -316,6 +324,20 @@ spec:
value: /prometheus-client.key
{{- end }}
{{- end }}
{{- if eq .Values.metrics.type "prometheus" }}
- name: BINDPLANE_METRICS_TYPE
value: prometheus
- name: BINDPLANE_METRICS_PROMETHEUS_ENDPOINT
value: /metrics
{{- end }}
{{- if eq .Values.metrics.type "otlp" }}
- name: BINDPLANE_METRICS_TYPE
value: otlp
- name: BINDPLANE_METRICS_OTLP_ENDPOINT
value: {{ .Values.metrics.otlp.endpoint }}
- name: BINDPLANE_METRICS_OTLP_INSECURE
value: "{{ .Values.metrics.otlp.insecure }}"
{{- end }}
{{- if len .Values.extraEnv }}
{{- toYaml .Values.extraEnv | nindent 12 }}
{{- end }}
Expand Down
22 changes: 22 additions & 0 deletions charts/bindplane/templates/bindplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
annotations:
{{- if eq .Values.metrics.type "prometheus" }}
prometheus.io/scrape: "true"
prometheus.io/path: /metrics
prometheus.io/port: "3001"
prometheus.io/scheme: http
prometheus.io/job-name: bindplane-op
{{- end }}
labels:
app.kubernetes.io/name: {{ include "bindplane.name" . }}
app.kubernetes.io/stack: bindplane
Expand Down Expand Up @@ -469,6 +477,20 @@ spec:
value: /prometheus-client.key
{{- end }}
{{- end }}
{{- if eq .Values.metrics.type "prometheus" }}
- name: BINDPLANE_METRICS_TYPE
value: prometheus
- name: BINDPLANE_METRICS_PROMETHEUS_ENDPOINT
value: /metrics
{{- end }}
{{- if eq .Values.metrics.type "otlp" }}
- name: BINDPLANE_METRICS_TYPE
value: otlp
- name: BINDPLANE_METRICS_OTLP_ENDPOINT
value: {{ .Values.metrics.otlp.endpoint }}
- name: BINDPLANE_METRICS_OTLP_INSECURE
value: "{{ .Values.metrics.otlp.insecure }}"
{{- end }}
{{- if len .Values.extraEnv }}
{{- toYaml .Values.extraEnv | nindent 12 }}
{{- end }}
Expand Down
13 changes: 12 additions & 1 deletion charts/bindplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,24 @@ trace:
type: ""

otlp:
# -- Endpoint of the OTLP trace receiver. Should be in the form of ip:port or host:port.
# -- Endpoint of the OTLP gRPC trace receiver. Should be in the form of ip:port or host:port.
endpoint: ""
# -- Set to `true` to disable TLS. Set to false if TLS is in use by the OTLP trace receiver.
insecure: false
# -- Sampling rate between 0 and 1. 1 being 100% of traces are sent.
samplingRate: "1"

metrics:
# -- Metrics type to use. Valid options include `otlp` and `prometheus`. When `otlp` is enabled, metrics
# are pushed to the configured OTel receiver. When `prometheus` is enabled, metrics are exposed in Prometheus
# format by BindPlane's HTTP server at `/metrics`.
type: ""
otlp:
# -- Endpoint of the OTLP gRPC metrics receiver. Should be in the form of ip:port or host:port.
endpoint: ""
# -- Set to `true` to disable TLS. Set to false if TLS is in use by the OTLP metrics receiver.
insecure: false

# -- Number of replicas to use for the BindPlane server. Should not be set if `autoscaling.enable` is set to `true`. 0 means this option will not be set.
replicas: 0

Expand Down
3 changes: 3 additions & 0 deletions test/cases/nats/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ nats:
cpu: 100m
limits:
memory: 100Mi

metrics:
type: prometheus

0 comments on commit 4cd2cf2

Please sign in to comment.