Merge pull request #48709 from yanghonggang/yhg-jaeger-port

common: add a config option for jaeger agent port

Reviewed-By: tchaikov, zenomri, yuvalif
This commit is contained in:
Yuval Lifshitz 2023-02-20 22:27:06 +02:00 committed by GitHub
commit 75fcae6400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -6368,6 +6368,14 @@ options:
- rgw
- osd
with_legacy: true
- name: jaeger_agent_port
type: int
level: advanced
desc: port number of the jaeger agent
default: 6799
services:
- rgw
- osd
- name: mgr_ttl_cache_expire_seconds
type: uint
level: dev

View File

@ -24,7 +24,9 @@ Tracer::Tracer(opentelemetry::nostd::string_view service_name) {
void Tracer::init(opentelemetry::nostd::string_view service_name) {
if (!tracer) {
opentelemetry::exporter::jaeger::JaegerExporterOptions exporter_options;
exporter_options.server_port = 6799;
if (g_ceph_context) {
exporter_options.server_port = g_ceph_context->_conf.get_val<int64_t>("jaeger_agent_port");
}
const opentelemetry::sdk::trace::BatchSpanProcessorOptions processor_options;
const auto jaeger_resource = opentelemetry::sdk::resource::Resource::Create(std::move(opentelemetry::sdk::resource::ResourceAttributes{{"service.name", service_name}}));
auto jaeger_exporter = std::unique_ptr<opentelemetry::sdk::trace::SpanExporter>(new opentelemetry::exporter::jaeger::JaegerExporter(exporter_options));

View File

@ -720,6 +720,11 @@ prepare_conf() {
$(format_conf "${extra_conf}")
$AUTOSCALER_OPTS
EOF
if [ "$with_jaeger" -eq 1 ] ; then
wconf <<EOF
jaeger_agent_port = 6831
EOF
fi
if [ "$lockdep" -eq 1 ] ; then
wconf <<EOF
lockdep = true