VictoriaTraces Agent - accepts trace spans via OpenTelemetry protocol and replicates them across multiple VictoriaTraces instances.
Prerequisites #
Before installing this chart, ensure your environment meets the following requirements:
- Kubernetes cluster - A running Kubernetes cluster with sufficient resources
- Helm - Helm package manager installed and configured
Additional requirements depend on your configuration:
- Persistent storage - Required if you enable persistent volumes for data retention
- kubectl - Needed for cluster management and troubleshooting
For installation instructions, refer to the official documentation:
Quick start #
This Helm chart deploys vtagent as a StatefulSet. It receives trace spans via OpenTelemetry protocol from cluster workloads and forwards them to the configured VictoriaTraces destinations. If more than one destination is specified, collected trace spans are replicated to all configured destinations. When a destination is unavailable, trace spans are buffered on disk and sent as soon as the destination is back.
- To install single-node version of VictoriaTraces, see these docs .
- To install a VictoriaTraces cluster, see these docs .
Chart configuration #
The simplest working configuration includes specifying the remoteWrite array and setting CPU and memory resources for the chart.
Example of a minimal working configuration:
remoteWrite:
- url: http://victoria-traces:10428
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
If the url has no path, trace spans are sent to the /insert/native endpoint.
If multiple remoteWrite entries are defined, trace spans are replicated to all the specified destinations.
Accepting trace spans #
vtagent accepts trace spans over OTLP/HTTP on the primary HTTP listener (port 10429 by default)
at the /insert/opentelemetry/v1/traces path. The chart always creates a Service for it, named vtagent-<release>.
The Service is headless by default, so its DNS name resolves to the vtagent pod IPs.
To get a regular load-balanced ClusterIP Service instead, unset service.clusterIP:
service:
clusterIP: ""
To additionally accept trace spans over OTLP/gRPC, set the listen address:
otlpGRPC:
listenAddr: :4317
The listener accepts plain-text connections unless otlpGRPC.tls is set. To enable TLS on the OTLP/gRPC listener:
otlpGRPC:
listenAddr: :4317
tls: true
tlsCertFile: /etc/tls/tls.crt
tlsKeyFile: /etc/tls/tls.key
extraVolumes:
- name: tls-certs
secret:
secretName: tls-secret
extraVolumeMounts:
- name: tls-certs
mountPath: /etc/tls
readOnly: true
On-disk buffering #
Trace spans that can’t be delivered are buffered at the data volume, which is an emptyDir by default.
The buffer of each remoteWrite destination is limited by maxDiskUsagePerURL.
To keep the buffer across pod restarts, enable the persistent volume and size it for all the destinations:
maxDiskUsagePerURL: 5GiB
persistentVolume:
enabled: true
size: 10Gi
Basic auth #
If you need to use basic auth, define the needed flags via environment variables as shown below:
remoteWrite:
- url: http://victoria-traces:10428
env:
- name: VM_remoteWrite_basicAuth_password
valueFrom:
secretKeyRef:
name: auth-secret
key: VT_PASSWORD
- name: VM_remoteWrite_basicAuth_username
valueFrom:
secretKeyRef:
name: auth-secret
key: VT_USERNAME
or mount secrets into pod and reference them in remoteWrite section:
remoteWrite:
- url: http://victoria-traces:10428
basicAuth.username: <name>
basicAuth.passwordFile: /path/to/password
extraVolumes:
- name: basic-auth-secret
secret:
secretName: basic-auth-secret
extraVolumeMounts:
- name: basic-auth-secret
mountPath: /path/to
readOnly: true
Multitenancy #
To define
tenant
, use ProjectID and AccountID headers as shown below:
remoteWrite:
- url: http://victoria-traces:10428
headers:
ProjectID: 12
AccountID: 42
TLS #
To enable TLS verification for the remoteWrite target, you can specify the tls-prefixed flags inside each remoteWrite entry.
At a minimum, you should provide the tlsCAFile path so that the agent can verify the server’s TLS certificate.
This is useful when the target endpoint uses a certificate signed by a custom or self-signed Certificate Authority (CA).
remoteWrite:
- url: https://victoria-traces:10428
tlsCAFile: "/etc/tls/ca.crt"
extraVolumes:
- name: tls-certs
secret:
secretName: tls-secret
extraVolumeMounts:
- name: tls-certs
mountPath: /etc/tls
readOnly: true
For mutual TLS (mTLS), additionally specify the client certificate and key:
remoteWrite:
- url: https://victoria-traces:10428
tlsCAFile: "/etc/tls/ca.crt"
tlsCertFile: "/etc/tls/client.crt"
tlsKeyFile: "/etc/tls/client.key"
If you want to disable TLS certificate verification (not recommended in production), you can set tlsInsecureSkipVerify to true.
remoteWrite:
- url: https://victoria-traces:10428
tlsInsecureSkipVerify: true
Extra fields #
You can add custom fields to all the trace spans by including the VT-Extra-Fields header in headers section of remote write configuration.
For example:
remoteWrite:
- url: http://victoria-traces:10428
headers:
VT-Extra-Fields:
zone: us-east1-c
source: victoria-traces-agent
HTTP listen address #
The chart configures the HTTP listen address via .Values.http list.
Each entry in the list configures a separate HTTP listener.
The primary listener (marked with primary: true) is the one service.servicePort, service.targetPort and the Service Monitor apply to.
To enable TLS on the HTTP listener:
http:
- name: https
primary: true
value: :10429
tls: true
tlsCertFile: /path/to/tls.crt
tlsKeyFile: /path/to/tls.key
Resource naming #
Resources are named vtagent-<release>, which matches the naming used by the VictoriaMetrics operator.
Legacy release-name based naming is not supported by this chart.
How to install #
Access a Kubernetes cluster.
Setup chart repository (can be omitted for OCI repositories) #
Add a chart helm repository with follow commands:
helm repo add vm https://victoriametrics.github.io/helm-charts/
helm repo update
List versions of vm/victoria-traces-agent chart available to installation:
helm search repo vm/victoria-traces-agent -l
Install victoria-traces-agent chart
#
Export default values of victoria-traces-agent chart to file values.yaml:
For HTTPS repository
helm show values vm/victoria-traces-agent > values.yamlFor OCI repository
helm show values oci://ghcr.io/victoriametrics/helm-charts/victoria-traces-agent > values.yaml
Change the values according to the need of the environment in values.yaml file.
Consider setting .Values.nameOverride to a small value like vta to avoid hitting resource name limits of 63 characters
Test the installation with command:
For HTTPS repository
helm install vta vm/victoria-traces-agent -f values.yaml -n NAMESPACE --debug --dry-runFor OCI repository
helm install vta oci://ghcr.io/victoriametrics/helm-charts/victoria-traces-agent -f values.yaml -n NAMESPACE --debug --dry-run
Install chart with command:
For HTTPS repository
helm install vta vm/victoria-traces-agent -f values.yaml -n NAMESPACEFor OCI repository
helm install vta oci://ghcr.io/victoriametrics/helm-charts/victoria-traces-agent -f values.yaml -n NAMESPACE
Get the pods lists by running this commands:
kubectl get pods -A | grep 'vta'
Get the application by running this command:
helm list -f vta -n NAMESPACE
See the history of versions of vta application with command.
helm history vta -n NAMESPACE
How to uninstall #
Remove application with command.
helm uninstall vta -n NAMESPACE
Migration to and from the VictoriaMetrics operator #
Resources of this chart can be handed over to the VictoriaMetrics operator and back. Services and persistent volume claims are kept, so no data has to be copied. Pods are restarted.
Back up data and try the procedure on a non-production release first.
Migration preparations #
Commands below use RELEASE and NAMESPACE variables, set them to the release name and namespace:
export RELEASE=<release> NAMESPACE=<namespace>
Make sure that:
- The custom resource has the same name and namespace as the Helm release.
- The VictoriaMetrics operator is installed and watches the release namespace.
- Helm 3.17+,
kubectlandjqare installed.
Disruptive parameters, which must be set when the chart is installed. Changing them later leads to an outage and data loss:
useLegacyNaming: falseis set.fullnameOverrideis not set.
From chart to operator #
Complete migration preparations .
Save values and manifests of the release:
helm get values $RELEASE -n $NAMESPACE -o yaml > values.yaml helm get manifest $RELEASE -n $NAMESPACE > manifest.yamlGenerate the custom resource from
values.yamlwith helm-converter . Passvictoria-traces-agentas-chart, the release name as-nameand the release namespace as-namespace.Review the generated
cr.yaml, since it isn’t a 1:1 copy of the chart configuration. Check helm-converter limitations and:- set the image version to the one used by the release, otherwise the operator applies its own default version;
- make sure the storage size and class match the existing persistent volume claims.
Append
/insert/nativetoremoteWriteURLs without a path incr.yaml. The chart appends it, but helm-converter doesn’t, and data isn’t accepted without it.Delete the Helm release history, so Helm stops managing the resources. Don’t run
helm uninstall, as it deletes them:kubectl delete secrets -n $NAMESPACE -l owner=helm,name=$RELEASECreate the custom resource and wait until the operator takes the resources over:
kubectl apply -n $NAMESPACE -f cr.yaml kubectl wait vtagent/$RELEASE -n $NAMESPACE --for=jsonpath='{.status.updateStatus}'=operational --timeout=10mList resources of the chart that the operator didn’t take over, such as Ingresses, ServiceMonitors or cluster roles:
kubectl get -n $NAMESPACE -f manifest.yaml --ignore-not-found -o json | \ jq -r '.items[] | select(.kind != "PersistentVolumeClaim" and .metadata.ownerReferences == null) | "\(.kind)/\(.metadata.name)"'Delete the ones that are no longer needed.
From operator to chart #
Complete migration preparations .
Create
values.yamlmanually with settings that match the custom resource, including the image version, storage size and class.Pause the custom resource and delete it, keeping the resources it owns:
kubectl patch vtagent $RELEASE -n $NAMESPACE --type=merge -p '{"spec":{"paused":true}}' kubectl wait vtagent/$RELEASE -n $NAMESPACE --for=jsonpath='{.status.updateStatus}'=paused --timeout=2m kubectl delete vtagent $RELEASE -n $NAMESPACE --cascade=orphanDon’t omit
--cascade=orphan, otherwise the workloads and Services are deleted together with the custom resource.Delete Deployments and StatefulSets, keeping their pods. Helm can’t update immutable StatefulSet fields and leaves containers and volumes added by the operator in place:
kubectl delete deployments,statefulsets -n $NAMESPACE -l app.kubernetes.io/instance=$RELEASE --cascade=orphanCheck that the selector doesn’t match workloads of other applications.
Install the chart over the existing resources:
helm install $RELEASE vm/victoria-traces-agent -n $NAMESPACE -f values.yaml --take-ownershipFor Helm 4 add
--force-conflicts.List resources left by the operator and delete the ones that are no longer needed:
kubectl get secrets,configmaps,roles,rolebindings,vmservicescrapes -n $NAMESPACE -l app.kubernetes.io/instance=$RELEASE,managed-by=vm-operator -o json | \ jq -r '.items[] | select(.metadata.annotations["meta.helm.sh/release-name"] == null) | "\(.kind)/\(.metadata.name)"'
Parameters #
The following tables lists the configurable parameters of the chart and their default values.
Change the values according to the need of the environment in victoria-traces-agent/values.yaml file.
| Key | Description |
|---|---|
| (object)Pod affinity |
| (object)Annotations to be added to the deployment |
| (object)Custom DNS config for pod. Details are here |
| (list)Environment variables (ex.: secret tokens) |
| (object)VTAgent extra command line arguments |
| (list)Add extra specs dynamically to this chart |
| (list)Extra Volume Mounts for the container |
| (list)Extra Volumes for the pod |
| (string)Override resources fullname |
| (string)K8s cluster domain suffix, used for building storage pods’ FQDN. Details are here |
| (object)Openshift security context compatibility configuration |
| (object)Annotations added to all resources |
| (object)Labels added to all resources |
| (string)Image registry, that can be shared across multiple helm charts |
| (list)Image pull secrets, that can be shared across multiple helm charts |
| (object)Horizontal Pod Autoscaler. |
| (bool)Use HPA for vtagent |
| (int)Maximum replicas for HPA to use to scale vtagent |
| (list)Metric for HPA to use to scale vtagent |
| (int)Minimum replicas for HPA to use to scale vtagent |
| (list)HTTP listen addresses configuration. Each item configures an HTTP listen address with optional TLS settings. Items are used for Pod ports, command line arguments and Service port generation. OTLP/HTTP trace spans are accepted on the primary listener at |
| (string)Image pull policy |
| (string)Image registry |
| (string)Image repository |
| (string)Image tag |
| (string)Image tag suffix, which is appended to |
| (list)Image pull secrets. Overrides |
| (string)Maximum disk usage per remoteWrite URL. When exceeded, old trace spans will be deleted. |
| (string)Override chart name |
| (object)See |
| (object)Extra annotations for NetworkPolicy |
| (list)Egress rules |
| (list)Ingress rules |
| (object)Extra labels for NetworkPolicy |
| (list)Policy types. When empty, they are derived from the configured |
| (object)Pod’s node selector. Details are here |
| (string)OTLP/gRPC listen address. The listener is disabled when empty. The recommended value is |
| (bool)Enable TLS for incoming OTLP/gRPC requests. Requires |
| (string)Path to file with TLS certificate for the OTLP/gRPC listener |
| (string)Path to file with TLS key for the OTLP/gRPC listener |
| (string)Minimum TLS version for the OTLP/gRPC listener |
| (list)Array of access modes. Must match those of existing PV or dynamic provisioner. Details are here |
| (object)Persistent volume annotations |
| (bool)Create/use Persistent Volume Claim for vtagent. Empty dir if false |
| (string)Existing Claim name. If defined, PVC must be created manually before volume will be bound |
| (object)Persistent volume additional labels |
| (object)Bind Persistent Volume by labels. Must match all labels of targeted PV |
| (string)Size of the volume. Should be big enough to keep buffers for all remoteWrite destinations, see |
| (string)StorageClass to use for persistent volume claim. Empty string means default StorageClass |
| (string)VolumeAttributesClass to use for persistent volume |
| (object)Annotations to be added to pod |
| (object)Extra labels for Pods only |
| (string)Deploy order policy for StatefulSet pods |
| (object)Security context to be added to pod |
| (string)Priority class to be assigned to the pod(s) |
| (list)List of trace destinations. Trace spans will be replicated to all listed destinations. If the url path is not specified, the trace spans will be sent to the /insert/native endpoint. |
| (int)Replica count |
| (string) |
| (string)Name of the RuntimeClass used to run the pod, e.g. “gvisor” |
| (object)Security context to be added to pod’s containers |
| (object)Service annotations |
| (string)Service ClusterIP. The Service is headless by default, which gives each vtagent pod a stable DNS name. Set it to an empty string to get a regular ClusterIP Service. It is ignored when |
| (list)Service external IPs. Check here for details |
| (string)Service external traffic policy. Check here for details |
| (object)Service labels |
| (list)Extra service ports |
| (string)Health check node port for a service. Check here for details |
| (string)Service internal traffic policy. Check here for details |
| (list)List of service IP families. Check here for details. |
| (string)Service IP family policy. Check here for details. |
| (string)Service load balancer IP |
| (list)Load balancer source range |
| (object)Per-port Service overrides, keyed by port name. Each entry may override port, protocol, targetPort, nodePort and/or appProtocol |
| (object)Extra selector labels common for service only |
| (string)Service port |
| (string)Target port of the primary HTTP listener. Defaults to the primary |
| (string)Traffic Distribution. Check Traffic distribution |
| (string)Service type |
| (object)Annotations to add to the service account |
| (bool)Mount API token to pod directly. vtagent doesn’t access Kubernetes API, so it is disabled by default |
| (bool)Specifies whether a service account should be created |
| (string)The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| (object)Service Monitor annotations |
| (object)Basic auth params for Service Monitor |
| (bool)Enable deployment of Service Monitor for vtagent. This is Prometheus operator object |
| (object)Service Monitor labels |
| (list)Service Monitor metricRelabelings |
| (string)Service Monitor port. Uses primary http item name by default |
| (list)Service Monitor relabelings |
| (string)Service Monitor target port. Overrides port when set |
| (list)Node tolerations for server scheduling to nodes with taints. Details are here |
| (string)Pod topologySpreadConstraints |
| (object)Vertical Pod Autoscaler. Requires VPA CRD ( |
| (bool)Use VPA for vtagent |