refinery

by Honeycomb

Helm chartv3.5.1App 3.5.1

Chart to deploy Honeycomb Refinery

About this chart

Honeycomb Refinery

Refinery is a trace-aware sampling proxy server for Honeycomb.

Honeycomb 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 traces.

helm repo add honeycomb https://honeycombio.github.io/helm-charts
helm install refinery honeycomb/refinery --set rules.Samplers.__default__.DeterministicSampler.SampleRate=2

Prerequisites

  • Helm 3.0+
  • Kubernetes 1.23+

Installing the Chart

Install Refinery with your custom chart values file

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.

Configuration

The repository's values.yaml file contains information about all configuration options for this chart. For details on Refinery-specific configuration review the Refinery configuration docs.

NOTE: Configuration does not hot-reload and changes will recycle pods when upgrading via helm upgrade operations.

Refinery Metrics

By default the chart exposes Refinery metrics via Prometheus, but if you decide to send Refinery's runtime 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.

# refinery.yaml
config:
  OTelMetrics:
    enabled: true
    # APIHost: https://api.honeycomb.io # default
    APIKey: YOUR_API_KEY
    # Dataset: "Refinery Metrics" # default
    # ReportingInterval: 30s # default

Configuring sampling rules

Use the Refinery documentation to learn how to configure your sampling rules. When using the operators >, >= or != make sure you indicate that they are strings by enclosing them in single quotes. For example, use '>='.

NOTE: Sampling rules are hot-reloaded and do not require pods to restart to take effect when upgrading via helm upgrade operations.

Disabling Live-Reload on Rules Changes

Depending on Kubernetes use-cases, operators may wish to disable Refinery's default live-reload behavior on rules changes and rely instead on Kubernetes to trigger a rolling pod update when the rule configmap changes.

This can be accomplished by setting

LiveReload: false

Redis Configuration

By default, a single node configuration of Redis will be installed. This configuration is not recommended for production deployments of Refinery. It is recommended that you configure and install a high available setup of Redis that can be used by this chart with the [RedisPeerManagement configuration option](A meaningful link)

Redis is used for peer discovery only, and the workloads on an existing cluster will be minimal.

Scaling Refinery

Refinery is a stateful service and is not optimized for dynamic auto-scaling. As such, we recommend provisioning refinery for your anticipated peak load.

The default configuration is to deploy 3 replicas with resource limits of 2 CPU cores, and 2Gi of memory. This configuration is capable to handle a modest sampling load and should be configured based on your expected peak load. Scaling requirements are largely based on the velocity of spans received per second, and the average number of spans per trace. Other settings such as rule complexity and trace duration timeouts will also have an effect on scaling requirements.

The primary setting that control scaling are replicaCount and resources.limits. Unless overriden, the value for resources.limits.memory will be used for config.Collection.AvailableMemory.

See Refinery: Scale and Troubleshoot for more details on how to properly scale Refinery.

Using Autoscaling

Refinery can be configured to auto-scale with load. During auto-scale events, trace sharding is recomputed, which will result in traces with missing spans being sent to Honeycomb. Traces with missing spans can happen for upto the config.TraceTimeout * 2. In order to avoid auto-scale events, it is recommended to disable scaleDown which will limit broken traces should traffic rapidly go up and down.

Autoscaling of refinery is configured using the autoscaling setting.

Create Markers on Deploy

⚠️ Experimental: this feature is under development. The shape of the configuration and the deploy marker behavior may change or disappear without being reflected as a breaking change in the chart's version number.

This chart can create markers in a Honeycomb dataset when helm install or helm upgrade are run. The marker created includes the time the chart was run, chart version, and the deployed Refinery version. Note: currently, a marker will be created whenever the chart is installed or upgraded, regardless of whether there are state changes in the cluster as a result.

If you have Refinery metrics enabled and sending to Honeycomb, to see deploy markers along with those metrics, enable this feature and give the honeycombDataset: option below the same name as the dataset receiving metrics.

To enable the deploy marker, configure the following options in the chart:

deployMarker:
    enabled: true
    image:
        repository: honeycombio/honeymarker
        pullPolicy: IfNotPresent
        # Overrides the image tag whose default is latest
        tag: "latest"
    honeycombAPI: "https://api.honeycomb.io" #US instance
    honeycombDataset: "dataset-to-add-the-marker"
    environment:
        - name: REFINERY_HONEYCOMB_DEPLOY_MARKER_API_KEY
              ...
    volumes:
        - name: your-secret-store
              ...
    volumeMounts:
        - name: your-secret-store-mount
              ...

NOTE: Ensure that the API key used for the deploy marker has permission to create markers in Honeycomb.

Parameters

The following table lists the configurable parameters of the Refinery chart, and their default values, as defined in values.yaml.

ParameterDescriptionDefault
LiveReloadIf disabled, triggers a rolling restart of the cluster whenever the Rules configmap changestrue
RulesConfigMapNameName of ConfigMap containing Refinery Rules""
affinityMap of node/pod affinities{}
autoscaling.behaviorSet the autoscaling behaviorscaleDown.selectPolicy: disabled
autoscaling.enabledEnabled autoscaling for Refineryfalse
autoscaling.maxReplicasSet maximum number of replicas for Refinery10
autoscaling.minReplicasSet minimum number of replicas for Refinery3
autoscaling.targetCPUUtilizationPercentageSet the target CPU utilization percentage for scaling75
autoscaling.targetMemoryUtilizationPercentageSet the target Memory utilization percentage for scalingnil
configRefinery Configurationsee Refinery Configuration
debug.enabledwhether or not the -d flag should be used in the Refinery arguments to enable the debug servicefalse
debug.portthe port on which the debug service will be exposed6060
extraCommandArgsList of extra string args to pass to refinery start command[]
fullnameOverrideString to fully override refinery.fullname template with a stringnil
grpcIngress.annotationsgRPC Ingress annotations{}
grpcIngress.enabledEnable ingress controller resource for gRPC trafficfalse
grpcIngress.hosts[0].hostHostname to use for gRPC Ingressrefinery.local
grpcIngress.hosts[0].pathPath prefix that will be used for the host/
grpcIngress.labelsgRPC Ingress labels{}
grpcIngress.tlsTLS hosts for gRPC Ingress[]
image.pullPolicyRefinery image pull policyIfNotPresent
image.repositoryRefinery image nameghcr.io/honeycombio/refinery/refinery
image.tagRefinery image tag (leave blank to use app version)nil
imagePullSecretsSpecify docker-registry secret names as an array[]
ingress.annotationsHTTP Ingress annotations{}
ingress.enabledEnable Ingress controller resource for HTTP trafficfalse
ingress.hosts[0].hostHostname to use for HTTP Ingressrefinery.local
ingress.hosts[0].pathPath prefix that will be used for the host/
ingress.labelsHTTP Ingress labels{}
ingress.tlsTLS hosts for HTTP Ingress[]
nameOverrideString to partially override refinery.fullname template with a string (will append the release name)nil
nodeSelector

Deploy refinery with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has refinery on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartrefinery is pinned at v3.5.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply