-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Refinery chart #27
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0cf4f7e
initial chart for refinery
puckpuck 604105a
Merge branch 'main' into refinery
puckpuck 6c166dc
move to yaml based configs
puckpuck 1045956
add readme
puckpuck 32e6ea1
cleanup readme
puckpuck 8605ae3
fix rulesbasedsampler example in readme
puckpuck 3d8c6de
add refinery to root readme
puckpuck 06ea51b
remove prom servicemonitor
puckpuck b2e9517
add environment variable support
puckpuck 2230d5e
update chart and app versions
puckpuck cfcb367
update refinery version to 1.1.1
puckpuck 6c0078d
fix liveness probe
puckpuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v2 | ||
name: refinery | ||
description: Chart to deploy Honeycomb Refinery | ||
type: application | ||
version: 1.0.0 | ||
appVersion: 1.1.1 | ||
keywords: | ||
- refinery | ||
- honeycomb | ||
- observability | ||
- sampling | ||
- tracing | ||
home: https://honeycomb.io | ||
sources: | ||
- https://github.com/honeycombio/refinery | ||
icon: https://www.honeycomb.io/wp-content/themes/honeycomb/assets/img/logo.svg | ||
maintainers: | ||
- name: puckpuck | ||
email: pierre@honeycomb.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# Refinery: Sampling Proxy Service for Honeycomb | ||
|
||
[Refinery](https://github.com/honeycombio/refinery) is a trace-aware sampling proxy server for Honeycomb. | ||
|
||
[Honeycomb](https://honeycomb.io) is built for modern software teams to see and understand how their production systems are behaving. | ||
Our goal is to give engineers the observability they need to eliminate toil and delight their users. | ||
This Helm Chart will install Refinery with the desired sampling rules passed in via a configuration file. | ||
|
||
## TL;DR | ||
|
||
Install the chart with a deterministic sample rate of 1 out of every 2 events. | ||
```console | ||
helm repo add honeycomb https://honeycombio.github.io/helm-charts | ||
helm install refinery honeycomb/refinery --set rules.SampleRate=2 | ||
``` | ||
|
||
## Prerequisites | ||
|
||
- Helm 3.0+ | ||
|
||
## Installing the Chart | ||
|
||
Install Refinery with your custom chart values file | ||
|
||
```console | ||
helm install refinery honeycomb/refinery --values /path/to/refinery-values.yaml | ||
``` | ||
|
||
If no configuration file is passed in, Refinery will deploy with the default configuration in [`values.yaml`](./values.yaml). | ||
|
||
## Configuring sampling rules | ||
|
||
The **Sample Rate** in Honeycomb is expressed as the denominator for 1 out of X events. | ||
A sample rate of 20 means to keep 1 event from every 20, which is also equivalent to a 5% sampling you may see with other platforms. | ||
|
||
[The Refinery documentation](https://docs.honeycomb.io/manage-data-volume/refinery/sampling-methods/) goes into more detail about how each sampling method works. | ||
These example configurations are provided to demonstrate how to define rules in YAML. | ||
|
||
### Deterministic Sampler | ||
|
||
The default sampling method uses the `DeterministicSampler` with a `SampleRate` of 1. | ||
This means that all of your data is sent to Honeycomb. | ||
Refinery does not down-sample your data by default. | ||
|
||
```yaml | ||
rules: | ||
# DryRun: false | ||
Sampler: DeterministicSampler | ||
SampleRate: 1 | ||
``` | ||
|
||
### Rules Based Sampler | ||
|
||
The Rules Based Sampler allows you to specify specific span attribute values that will be used to determine a sample rate applied to the trace. | ||
Rules are evaluated in order as they appear in the configuration. | ||
A default rule should also be specified as the last rule. | ||
|
||
```yaml | ||
rules: | ||
# DryRun: false | ||
my_dataset: | ||
Sampler: "RulesBasedSampler" | ||
Rule: | ||
- Name: "keep 5xx errors" | ||
SampleRate: 1 | ||
Condition: | ||
- Field: "status_code" | ||
Operator: ">=" | ||
Value: 500 | ||
- Name: "downsample 200 responses" | ||
SampleRate: 1000 | ||
Condition: | ||
- Field: "http.status_code" | ||
Operator: "=" | ||
Value: 200 | ||
- Name: "send 1 in 10 traces" | ||
SampleRate: 10 # base case | ||
``` | ||
|
||
### Exponential Moving Average (EMA) Dynamic Sampler | ||
|
||
The EMA Dynamic Sampler, will determine sampling rates, based on field values. | ||
Values that are seen often (ie: http status 200) will get sampled less than values that are rare (ie: http status 500). | ||
You configure which fields to use for sampling decisions, the exponential moving average adjustment interval, and weight. | ||
This is the recommended sampling method for most teams. | ||
|
||
```yaml | ||
rules: | ||
# DryRun: false | ||
my_dataset: | ||
Sampler: "EMADynamicSampler" | ||
GoalSampleRate: 2 | ||
FieldList: | ||
- "request.method" | ||
- "response.status_code" | ||
AdjustmentInterval: 15 | ||
Weight: 0.5 | ||
``` | ||
|
||
## Configuration | ||
|
||
The repository's [values.yaml](./values.yaml) file contains information about all configuration options for this chart. | ||
|
||
### Refinery Metrics | ||
|
||
If you decide to send [Refinery's runtime metrics](https://docs.honeycomb.io/manage-data-volume/refinery/scale-and-troubleshoot/#understanding-refinerys-metrics) to Honeycomb, you will need to give Refinery an API for the team you want those metrics sent to. | ||
|
||
You can obtain your API Key by going to your Account profile page within your Honeycomb instance. | ||
|
||
```yaml | ||
# refinery.yaml | ||
config: | ||
Metrics: honeycomb | ||
HoneycombMetrics: | ||
# MetricsHoneycombAPI: https://api.honeycomb.io # default | ||
MetricsAPIKey: YOUR_API_KEY | ||
# MetricsDataset: "Refinery Metrics" # default | ||
# MetricsReportingInterval: 3 # default | ||
``` | ||
|
||
## Parameters | ||
|
||
The following table lists the configurable parameters of the Refinery chart and their default values, as defined in [`values.yaml`](./values.yaml). | ||
|
||
| Parameter | Description | Default | | ||
| --- | --- | --- | | ||
| `replicaCount` | Number of Refinery replicas | `2` | | ||
| `image.repository` | Refinery image name | `honeycombio/refinery` | | ||
| `image.pullPolicy` | Refinery image pull policy | `IfNotPresent` | | ||
| `image.tag` | Refinery image tag (leave blank to use app version) | `nil` | | ||
| `imagePullSecrets` | Specify docker-registry secret names as an array | `[]` | | ||
| `nameOverride` | String to partially override refinery.fullname template with a string (will append the release name) | `nil` | | ||
| `fullnameOverride` | String to fully override refinery.fullname template with a string | `nil` | | ||
| `config` | Refinery core Configuration | see [Refinery Configuration](#configuration) | | ||
| `rules` | Refinery sampling rules | see [Configuring sampling rules](#configuring-sampling-rules) | | ||
| `redis.enabled` | When true, a Redis instance will be installed | `true` | | ||
| `redis.existingHost` | If `redis.enabled` is false, this must be set to the name and port of an existing Redis service | `nil` | | ||
| `redis.image.repository` | Redis image name | `redis` | | ||
| `redis.image.tag` | Redis image tag | `6.0.2` | | ||
| `redis.image.pullPolicy` | Redis image pull policy | `IfNotPresent` | | ||
| `serviceAccount.create` | Specify whether a ServiceAccount should be created | `true` | | ||
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the `refinery.fullname` template | | ||
| `serviceAccount.annotations` | Annotations to be applied to ServiceAccount | `{}` | | ||
| `podAnnotations` | Pod annotations | `{}` | | ||
| `podSecurityContext` | Security context for pod | `{}` | | ||
| `securityContext` | Security context for container | `{}` | | ||
| `service.type` | Kubernetes Service type | `ClusterIP` | | ||
| `service.port` | Service port | `80` | | ||
| `service.annotations` | Service annotations | `{}` | | ||
| `ingress.enabled` | Enable ingress controller resource | `false` | | ||
| `ingress.annotations` | Ingress annotations | `{}` | | ||
| `ingress.hosts[0].name` | Hostname to your Refinery installation | `refinery.local` | | ||
| `ingress.hosts[0].paths` | Path within the url structure | `[]` | | ||
| `ingress.tls` | TLS hosts | `[]` | | ||
| `resources` | CPU/Memory resource requests/limits | limit: 1000m/2Gi, request: 500m/500Mi | | ||
| `nodeSelector` | Node labels for pod assignment | `{}` | | ||
| `tolerations` | Tolerations for pod assignment | `[]`| | ||
| `affinity` | Map of node/pod affinities | `{}` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Honeycomb refinery is setup and configured to refine events that are sent through it. You should see data flowing | ||
within a few minutes at https://ui.honeycomb.io | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "refinery.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "refinery.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "refinery.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "refinery.labels" -}} | ||
helm.sh/chart: {{ include "refinery.chart" . }} | ||
{{ include "refinery.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "refinery.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "refinery.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
|
||
|
||
{{/* | ||
Create a default fully qualified app name for the redis component. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "refinery.redis.fullname" -}} | ||
{{ include "refinery.fullname" . }}-redis | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
Common labels for redis | ||
*/}} | ||
{{- define "refinery.redis.labels" -}} | ||
helm.sh/chart: {{ include "refinery.chart" . }} | ||
{{ include "refinery.redis.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels for redis | ||
*/}} | ||
{{- define "refinery.redis.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "refinery.name" . }}-redis | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "refinery.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "refinery.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "refinery.fullname" . }}-config | ||
labels: | ||
{{- include "refinery.labels" . | nindent 4 }} | ||
data: | ||
config.yaml: | | ||
{{- toYaml .Values.config | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "refinery.fullname" . }}-rules | ||
labels: | ||
{{- include "refinery.labels" . | nindent 4 }} | ||
data: | ||
rules.yaml: | | ||
{{- toYaml .Values.rules | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{{- if .Values.redis.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "refinery.redis.fullname" . }} | ||
labels: | ||
{{- include "refinery.redis.labels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "refinery.redis.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "refinery.redis.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "refinery.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: redis | ||
image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}" | ||
imagePullPolicy: {{ .Values.redis.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: 6379 | ||
protocol: TCP | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not worth a lot of effort, but if possible: the API is configurable, so this note can be misleading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the UI link, not the API link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, so in my case I would be looking at https://ui-dogfood.honeycomb.io. But no one outside Honeycomb would go to another UI, so now that I think about it, it seems OK hard-coded.