apm-server

by 4ops

Helm chartv0.1.2App 7.17.6Verified publisher

The APM Server receives data from Elastic APM agents and transforms it into Elasticsearch documents

About this chart

apm-server

The APM Server receives data from Elastic APM agents and transforms it into Elasticsearch documents

Installing the Chart

To install the chart with the release name my-release:

$ helm repo add kube-ops https://charts.kube-ops.io
$ helm repo update
$ helm upgrade my-release kube-ops/apm-server --install --namespace my-namespace --create-namespace --wait

Uninstalling the Chart

To uninstall the chart:

$ helm uninstall my-release --namespace my-namespace

Updating CRDs

$ kubectl apply -k https://gitlab.com/kube-ops/helm/apps/traefik

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
agentConfigCacheExpirationstring"30s"When using APM agent configuration, information fetched from Kibana will be cached in memory for some time. Specify cache key expiration via this setting. Default is 30 seconds.
autoscaling.enabledboolfalseSpecifies the horizontal pod autoscaling is enabled. Only used if deploymentType == Deployment.
autoscaling.maxReplicasint100
autoscaling.minReplicasint1
autoscaling.targetCPUUtilizationPercentageint80
capturePersonalDatabooltrueIf true, APM Server captures the IP of the instrumented service or the IP and User Agent of the real user (RUM requests).
configFilenamestring"/etc/apm-server/config.yml"
configOverridestring""- Config file and paths
consoleobject{"json":{"escapeHtml":false,"pretty":false}}- Output: Console
console.jsonobject{"escapeHtml":false,"pretty":false}Configure JSON encoding.
console.json.escapeHtmlboolfalseConfigure escaping HTML symbols in strings.
console.json.prettyboolfalsePretty-print JSON event.
containerPortint8200
dataDir.emptyDirobject{}
dataDir.mountPathstring"/usr/share/apm-server/data"
defaultServiceEnvironmentstring""If specified, APM Server will record this value in events which have no service environment defined, and add it to agent configuration queries to Kibana when none is specified in the request from the agent.
deploymentTypestring"Deployment"Type of the application controller. Possible values: Deployment, DaemonSet
dnsConfigobject{}
dnsPolicystring""Pod-specific DNS policy. If hostNetwork is set to true, use ClusterFirstWithHostNet dnsPolicy value.
elasticsearchobject{"backoffInit":"1s","backoffMax":"60s","bulkMaxSize":50,"compressionLevel":0,"headers":{},"hosts":["elasticsearch:9200"],"index":"apm-%{[observer.version]}-%{+yyyy.MM.dd}","indices":[],"maxRetries":3,"path":"","pipeline":"","proxyUrl":"","timeout":90,"worker":1}- Output: ElasticSearch
elasticsearch.backoffInitstring"1s"The number of seconds to wait before trying to reconnect to Elasticsearch after a network error. After waiting backoff.init seconds, apm-server tries to reconnect. If the attempt fails, the backoff timer is increased exponentially up to backoff.max. After a successful connection, the backoff timer is reset. The default is 1s.
elasticsearch.backoffMaxstring"60s"The maximum number of seconds to wait before attempting to connect to Elasticsearch after a network error. The default is 60s.
elasticsearch.bulkMaxSizeint50The maximum number of events to bulk in a single Elasticsearch bulk API index request. The default is 50.
elasticsearch.compressionLevelint0Set gzip compression level.
elasticsearch.headersobject{}Custom HTTP headers to add to each request.
elasticsearch.hostslist["elasticsearch:9200"]Array of hosts to connect to. Scheme and port can be left out and will be set to the default (http and 9200). In case you specify and additional path, the scheme is required: http://localhost:9200/path. IPv6 addresses should always be defined as: https://[2001:db8::1]:9200.
elasticsearch.indexstring"apm-%{[observer.version]}-%{+yyyy.MM.dd}"By using the configuration below, APM documents are stored to separate indices, depending on their processor.event: - error - transaction - span - sourcemap The indices are all prefixed with apm-%{[observer.version]}. To allow managing indices based on their age, all indices (except for sourcemaps) end with the information of the day they got indexed. e.g. "apm-7.3.0-transaction-2019.07.20" Be aware that you can only specify one Elasticsearch template. If you modify the index patterns you must also update these configurations accordingly, as they need to be aligned: * setupTemplate.name * setupTemplate.pattern
elasticsearch.maxRetriesint3The number of times a particular Elasticsearch index operation is attempted. If the indexing operation doesn't succeed after this many retries, the events are dropped. The default is 3.
elasticsearch.pathstring""Optional HTTP Path.
elasticsearch.pipelinestring""A pipeline is a definition of processors applied to documents when ingesting them to Elasticsearch. APM Server comes with a default pipeline definition, located at ingest/pipeline/definition.json, which is loaded to Elasticsearch by default (see apm-server.register.ingest.pipeline). APM pipeline is enabled by default. To disable it, set pipeline: _none.
elasticsearch.proxyUrlstring""Proxy server url.
elasticsearch.timeoutint90Configure http request timeout before failing an request to Elasticsearch.
elasticsearch.workerint1Number of workers per Elasticsearch host.
existingConfigMapNamestring""
extraEnvVarslist[]Additional environment variables
extraVolumeMountslist[]Additional mounts for application
extraVolumeslist[]Additional volumes for application
fullnameOverridestring""Overrides the full name
globalobject{"imagePullPolicy":"IfNotPresent","imagePullSecrets":[]}- Global
global.imagePullPolicystring"IfNotPresent"Image download policy ref: https://kubernetes.io/docs/concepts/containers/images/#updating-images
global.imagePullSecretslist[]List of the Docker registry credentials ref: https://kubernetes.io/docs/concepts/containers/images/#updating-images
hostAliaseslist[]Adding entries to Pod /etc/hosts with HostAliases
hostNetworkboolfalseSpecifies whether a container ports should be exposed to host.
httpPortint0
idleTimeoutstring"45s"Maximum amount of time to wait for the next incoming request before underlying connection is closed.
imageobject{"repository":"docker.io/elastic/apm-server","tag":""}- Pod and container configuration
image.repositorystring"docker.io/elastic/apm-server"Overrides the image repository
image.tagstring""Overrides the image tag whose default is the chart appVersion.
indexLifecycleManagement.enabledstring"auto"Supported values are auto, true and false. true: Make use of Elasticsearch's Index Lifecycle Management (ILM) for APM indices. If no Elasticsearch output is configured or the configured instance does not support ILM, APM Server cannot apply ILM and must create unmanaged indices instead. false: APM Server does not make use of ILM in Elasticsearch. auto: If an Elasticsearch output is configured with default index and indices settings, and the configured Elasticsearch instance supports ILM, auto will resolve to true. Otherwise auto will resolve to false. Default value is auto.
indexLifecycleManagement.setup.enabledbooltrueOnly disable setup if you want to set up everything related to ILM on your own. When setup is enabled, the APM Server creates: - aliases and ILM policies if apm-server.ilm.enabled resolves to true. - An ILM specific template per event type. This is required to map ILM aliases and policies to indices. In case ILM is disabled, the templates will be created without any ILM settings. Be aware that if you turn off setup, you need to manually manage event type specific templates on your own. If you simply want to disable ILM, use the above setting, apm-server.ilm.enabled, instead.
indexLifecycleManagement.setup.mappinglist[]Customized mappings will be merged with the default setup, so you only need to configure mappings for the event types, policies, and index suffixes that you want to customize. Indices are named in this way: apm-%{[observer.version]}-%{[event.type]}-{index_suffix}, e.g., apm-7.9.0-span-custom*. The index_suffix is optional. NOTE: When configuring an index_suffix, ensure that no previously set up templates conflict with the newly configured ones. If an index matches multiple templates with the same order, the settings of the templates will override each other. Any conflicts need to be cleaned up manually. NOTE: When customizing setup.template.name and setup.template.pattern, ensure they still match the indices.
indexLifecycleManagement.setup.overwriteboolfalseConfigure whether or not existing policies and ILM related templates should be updated. This needs to be set to true when customizing your policies.
indexLifecycleManagement.setup.policieslist[]
indexLifecycleManagement.setup.requirePolicybooltrueSet to false when policies are set up outside of APM Server but referenced here.
initContainerslist[]Specifies init containers
jaegerobject{"grpc":{"authTag":"","enabled":false,"host":"0.0.0.0:14250"},"http":{"enabled":false,"host":"0.0.0.0:14268"}}When enabling Jaeger integration, APM Server acts as Jaeger collector. It supports jaeger.thrift over HTTP and gRPC. This is an experimental feature, use with care. WARNING: This configuration is deprecated, and will be removed in the 8.0 release. Jaeger gRPC is now served on the same port as Elastic APM agents, defined by the "apm-server.host" configuration; it is implicitly enabled, and an agent tag called "elastic-apm-auth" is required when auth is enabled.
jaeger.grpc.authTagstring""The tag value should have the same format as an HTTP Authorization header, i.e. "Bearer <secret_token>" or
jaeger.grpc.enabledboolfalseSet to true to enable the Jaeger gRPC collector service.
jaeger.grpc.hoststring"0.0.0.0:14250"Defines the gRPC host and port the server is listening on. Defaults to the standard Jaeger gRPC collector port 14250.
jaeger.http.enabledboolfalseSet to true to enable the Jaeger HTTP collector endpoint.
jaeger.http.hoststring"0.0.0.0:14268"Defines the HTTP host and port the server is listening on. Defaults to the standard Jaeger HTTP collector port 14268.
kibana.enabledboolfalseFor APM Agent configuration in Kibana, enabled must be true.
kibana.hoststring"localhost:5601"Scheme and port can be left out and will be set to the default (http and 5601). In case you specify an additional path, the scheme is required: http://localhost:5601/path. IPv6 addresses should always be defined as: https://[2001:db8::1]:5601.
livenessProbeobject{}
logJsonbooltrue
logLevelstring"info"Sets the minimum log level. The default log level is info. Available log levels are: error, warning, info, or debug.
logsDir.emptyDirobject{}
logsDir.mountPathstring"/usr/share/apm-server/logs"
logstashobject{"backoffInit":"1s","backoffMax":"60s","compressionLevel":3,"escapeHtml":true,"hosts":["localhost:5044"],"index":"","loadbalance":false,"pipelining":2,"proxyUrl":"","proxyUseLocalResolver":false,"slowStart":false,"ttl":"30s","worker":1}- Output: Logstash
logstash.backoffInitstring"1s"The number of seconds to wait before trying to reconnect to Logstash after a network error. After waiting backoffInit seconds, apm-server tries to reconnect. If the attempt fails, the backoff timer is increased exponentially up to backoffMax. After a successful connection, the backoff timer is reset.
logstash.backoffMaxstring"60s"The maximum number of seconds to wait before attempting to connect to Logstash after a network error.
logstash.compressionLevelint3Set gzip compression level.
logstash.escapeHtmlbooltrueConfigure escaping html symbols in strings.
logstash.indexstring""Optional index name.
logstash.loadbalanceboolfalseOptional load balance the events between the Logstash hosts. Default is false.
logstash.pipeliningint2Number of batches to be sent asynchronously to Logstash while processing new batches.
logstash.proxyUrlstring""SOCKS5 proxy server URL
logstash.proxyUseLocalResolverboolfalseResolve names locally when using a proxy server.
logstash.slowStartboolfalseIf enabled only a subset of events in a batch of events is transferred per group. The number of events to be sent increases up to bulkMaxSize if no error is encou

Deploy apm-server with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has apm-server 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 chartapm-server is pinned at v0.1.2 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