【zipkin/jaeger使用系列】jaeger v1.15.1安装、配置

背景

jaeger又更新新版本了,虽然不是什么大版本,但是还是更新测试环境版本吧。

官方指南和常规方法

官方文档:https://www.jaegertracing.io/docs/1.15/cli/
看了官方文档,照着去测试环境操作,没有看到自己想看到的效果(jaeger_colletor的help效果如下).说好的elasticsearch、kafka配置呢?

help与环境变量耦合

jaeger-collector使用elasticsearch为存储

大胆的猜测,help命令和环境变量耦合了。输入:

SPAN_STORAGE_TYPE=elasticsearch ./jaeger-collector --help

果然,输出的效果如下,真的是防不甚防啊。

2019-12-01 22:18:33 maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined
Jaeger collector receives traces from Jaeger agents and runs them through a processing pipeline.
Usage:
jaeger-collector [flags]
jaeger-collector [command]
Available Commands:
docs Generates documentation
env Help about environment variables.
help Help about any command
version Print the version.
Flags:
--admin-http-port int The http port for the admin server, including health check, /metrics, etc. (default 14269)
--collector.grpc-port int The gRPC port for the collector service (default 14250)
--collector.grpc.tls Enable TLS on the server
--collector.grpc.tls.cert string Path to a TLS Certificate file, used to identify this server to clients
--collector.grpc.tls.client-ca string Path to a TLS CA (Certification Authority) file used to verify certificates presented by clients (if unset, all clients are permitted)
--collector.grpc.tls.client.ca string (deprecated) see --collector.grpc.tls.client-ca
--collector.grpc.tls.key string Path to a TLS Private Key file, used to identify this server to clients
--collector.http-port int The HTTP port for the collector service (default 14268)
--collector.num-workers int The number of workers pulling items from the queue (default 50)
--collector.port int The TChannel port for the collector service (default 14267)
--collector.queue-size int The queue size of the collector (default 2000)
--collector.zipkin.allowed-headers string Comma separated list of allowed headers for the Zipkin collector service, default content-type (default "content-type")
--collector.zipkin.allowed-origins string Comma separated list of allowed origins for the Zipkin collector service, default accepts all (default "*")
--collector.zipkin.http-port int The HTTP port for the Zipkin collector service e.g. 9411
--config-file string Configuration file in JSON, TOML, YAML, HCL, or Java properties formats (default none). See spf13/viper for precedence.
--downsampling.hashsalt string Salt used when hashing trace id for downsampling.
--downsampling.ratio float Ratio of spans passed to storage after downsampling (between 0 and 1), e.g ratio = 0.3 means we are keeping 30% of spans and dropping 70% of spans; ratio = 1.0 disables downsampling. (default 1)
--es-archive.bulk.actions int The number of requests that can be enqueued before the bulk processor decides to commit
--es-archive.bulk.flush-interval duration A time.Duration after which bulk requests are committed, regardless of other thresholds. Set to zero to disable. By default, this is disabled. (default 0s)
--es-archive.bulk.size int The number of bytes that the bulk requests can take up before the bulk processor decides to commit
--es-archive.bulk.workers int The number of workers that are able to receive bulk requests and eventually commit them to Elasticsearch
--es-archive.create-index-templates Create index templates at application startup. Set to false when templates are installed manually.
--es-archive.enabled Enable extra storage
--es-archive.index-prefix string Optional prefix of Jaeger indices. For example "production" creates "production-jaeger-*".
--es-archive.max-num-spans int The maximum number of spans to fetch at a time per query in Elasticsearch
--es-archive.max-span-age duration The maximum lookback for spans in Elasticsearch (default 0s)
--es-archive.num-replicas int The number of replicas per index in Elasticsearch
--es-archive.num-shards int The number of shards per index in Elasticsearch
--es-archive.password string The password required by Elasticsearch
--es-archive.server-urls string The comma-separated list of Elasticsearch servers, must be full url i.e. http://localhost:9200
--es-archive.sniffer The sniffer config for Elasticsearch; client uses sniffing process to find all nodes automatically, disable if not required
--es-archive.tags-as-fields.all (experimental) Store all span and process tags as object fields. If true .tags-as-fields.config-file is ignored. Binary tags are always stored as nested objects.
--es-archive.tags-as-fields.config-file string (experimental) Optional path to a file containing tag keys which will be stored as object fields. Each key should be on a separate line.
--es-archive.tags-as-fields.dot-replacement string (experimental) The character used to replace dots (".") in tag keys stored as object fields.
--es-archive.timeout duration Timeout used for queries. A Timeout of zero means no timeout (default 0s)
--es-archive.tls Enable TLS with client certificates.
--es-archive.tls.ca string Path to TLS CA file
--es-archive.tls.cert string Path to TLS certificate file
--es-archive.tls.key string Path to TLS key file
--es-archive.tls.skip-host-verify (insecure) Skip server's certificate chain and host name verification
--es-archive.token-file string Path to a file containing bearer token. This flag also loads CA if it is specified.
--es-archive.use-aliases (experimental) Use read and write aliases for indices. Use this option with Elasticsearch rollover API. It requires an external component to create aliases before startup and then performing its management. Note that es-archive.max-span-age is not taken into the account and has to be substituted by external component managing read alias.
--es-archive.username string The username required by Elasticsearch. The basic authentication also loads CA if it is specified.
--es-archive.version uint The major Elasticsearch version. If not specified, the value will be auto-detected from Elasticsearch.
--es.bulk.actions int The number of requests that can be enqueued before the bulk processor decides to commit (default 1000)
--es.bulk.flush-interval duration A time.Duration after which bulk requests are committed, regardless of other thresholds. Set to zero to disable. By default, this is disabled. (default 200ms)
--es.bulk.size int The number of bytes that the bulk requests can take up before the bulk processor decides to commit (default 5000000)
--es.bulk.workers int The number of workers that are able to receive bulk requests and eventually commit them to Elasticsearch (default 1)
--es.create-index-templates Create index templates at application startup. Set to false when templates are installed manually. (default true)
--es.index-prefix string Optional prefix of Jaeger indices. For example "production" creates "production-jaeger-*".
--es.max-num-spans int The maximum number of spans to fetch at a time per query in Elasticsearch (default 10000)
--es.max-span-age duration The maximum lookback for spans in Elasticsearch (default 72h0m0s)
--es.num-replicas int The number of replicas per index in Elasticsearch (default 1)
--es.num-shards int The number of shards per index in Elasticsearch (default 5)
--es.password string The password required by Elasticsearch
--es.server-urls string The comma-separated list of Elasticsearch servers, must be full url i.e. http://localhost:9200 (default "http://127.0.0.1:9200")
--es.sniffer The sniffer config for Elasticsearch; client uses sniffing process to find all nodes automatically, disable if not required
--es.tags-as-fields.all (experimental) Store all span and process tags as object fields. If true .tags-as-fields.config-file is ignored. Binary tags are always stored as nested objects.
--es.tags-as-fields.config-file string (experimental) Optional path to a file containing tag keys which will be stored as object fields. Each key should be on a separate line.
--es.tags-as-fields.dot-replacement string (experimental) The character used to replace dots (".") in tag keys stored as object fields. (default "@")
--es.timeout duration Timeout used for queries. A Timeout of zero means no timeout (default 0s)
--es.tls Enable TLS with client certificates.
--es.tls.ca string Path to TLS CA file
--es.tls.cert string Path to TLS certificate file
--es.tls.key string Path to TLS key file
--es.tls.skip-host-verify (insecure) Skip server's certificate chain and host name verification
--es.token-file string Path to a file containing bearer token. This flag also loads CA if it is specified.
--es.use-aliases (experimental) Use read and write aliases for indices. Use this option with Elasticsearch rollover API. It requires an external component to create aliases before startup and then performing its management. Note that es.max-span-age is not taken into the account and has to be substituted by external component managing read alias.
--es.username string The username required by Elasticsearch. The basic authentication also loads CA if it is specified.
--es.version uint The major Elasticsearch version. If not specified, the value will be auto-detected from Elasticsearch.
--health-check-http-port int (deprecated) see --admin-http-port
-h, --help help for jaeger-collector
--log-level string Minimal allowed log Level. For more levels see https://github.com/uber-go/zap (default "info")
--metrics-backend string Defines which metrics backend to use for metrics reporting: expvar, prometheus, none (default "prometheus")
--metrics-http-route string Defines the route of HTTP endpoint for metrics backends that support scraping (default "/metrics")
--sampling.strategies-file string The path for the sampling strategies file in JSON format. See sampling documentation to see format of the file
--span-storage.type string (deprecated) please use SPAN_STORAGE_TYPE environment variable. Run this binary with the 'env' command for help.
Use "jaeger-collector [command] --help" for more information about a command.

jaeger-collector使用kafka为存储

SPAN_STORAGE_TYPE=kafka ./jaeger-collector --help

输出如下:

2019/12/01 22:31:21 maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined
Jaeger collector receives traces from Jaeger agents and runs them through a processing pipeline.
Usage:
jaeger-collector [flags]
jaeger-collector [command]
Available Commands:
docs Generates documentation
env Help about environment variables.
help Help about any command
version Print the version.
Flags:
--admin-http-port int The http port for the admin server, including health check, /metrics, etc. (default 14269)
--collector.grpc-port int The gRPC port for the collector service (default 14250)
--collector.grpc.tls Enable TLS on the server
--collector.grpc.tls.cert string Path to a TLS Certificate file, used to identify this server to clients
--collector.grpc.tls.client-ca string Path to a TLS CA (Certification Authority) file used to verify certificates presented by clients (if unset, all clients are permitted)
--collector.grpc.tls.client.ca string (deprecated) see --collector.grpc.tls.client-ca
--collector.grpc.tls.key string Path to a TLS Private Key file, used to identify this server to clients
--collector.http-port int The HTTP port for the collector service (default 14268)
--collector.num-workers int The number of workers pulling items from the queue (default 50)
--collector.port int The TChannel port for the collector service (default 14267)
--collector.queue-size int The queue size of the collector (default 2000)
--collector.zipkin.allowed-headers string Comma separated list of allowed headers for the Zipkin collector service, default content-type (default "content-type")
--collector.zipkin.allowed-origins string Comma separated list of allowed origins for the Zipkin collector service, default accepts all (default "*")
--collector.zipkin.http-port int The HTTP port for the Zipkin collector service e.g. 9411
--config-file string Configuration file in JSON, TOML, YAML, HCL, or Java properties formats (default none). See spf13/viper for precedence.
--downsampling.hashsalt string Salt used when hashing trace id for downsampling.
--downsampling.ratio float Ratio of spans passed to storage after downsampling (between 0 and 1), e.g ratio = 0.3 means we are keeping 30% of spans and dropping 70% of spans; ratio = 1.0 disables downsampling. (default 1)
--health-check-http-port int (deprecated) see --admin-http-port
-h, --help help for jaeger-collector
--kafka.producer.authentication string Authentication type used to authenticate with kafka cluster. e.g. none, kerberos, tls (default "none")
--kafka.producer.brokers string The comma-separated list of kafka brokers. i.e. '127.0.0.1:9092,0.0.0:1234' (default "127.0.0.1:9092")
--kafka.producer.compression string (experimental) Type of compression (none, gzip, snappy, lz4, zstd) to use on messages (default "none")
--kafka.producer.compression-level int (experimental) compression level to use on messages. gzip = 1-9 (default = 6), snappy = none, lz4 = 1-17 (default = 9), zstd = -131072 - 22 (default = 3)
--kafka.producer.encoding string Encoding of spans ("json" or "protobuf") sent to kafka. (default "protobuf")
--kafka.producer.kerberos.config-file string Path to Kerberos configuration. i.e /etc/krb5.conf (default "/etc/krb5.conf")
--kafka.producer.kerberos.keytab-file string Path to keytab file. i.e /etc/security/kafka.keytab (default "/etc/security/kafka.keytab")
--kafka.producer.kerberos.password string The Kerberos password used for authenticate with KDC
--kafka.producer.kerberos.realm string Kerberos realm
--kafka.producer.kerberos.service-name string Kerberos service name (default "kafka")
--kafka.producer.kerberos.use-keytab Use of keytab instead of password, if this is true, keytab file will be used instead of password
--kafka.producer.kerberos.username string The Kerberos username used for authenticate with KDC
--kafka.producer.protocol-version string Kafka protocol version - must be supported by kafka server
--kafka.producer.required-acks string (experimental) Required kafka broker acknowledgement. i.e. noack, local, all (default "local")
--kafka.producer.tls.ca string Path to the TLS CA for the Kafka connection
--kafka.producer.tls.cert string Path to the TLS Certificate for the Kafka connection
--kafka.producer.tls.key string Path to the TLS Key for the Kafka connection
--kafka.producer.topic string The name of the kafka topic (default "jaeger-spans")
--log-level string Minimal allowed log Level. For more levels see https://github.com/uber-go/zap (default "info")
--metrics-backend string Defines which metrics backend to use for metrics reporting: expvar, prometheus, none (default "prometheus")
--metrics-http-route string Defines the route of HTTP endpoint for metrics backends that support scraping (default "/metrics")
--sampling.strategies-file string The path for the sampling strategies file in JSON format. See sampling documentation to see format of the file
--span-storage.type string (deprecated) please use SPAN_STORAGE_TYPE environment variable. Run this binary with the 'env' command for help.
Use "jaeger-collector [command] --help" for more information about a command.