@@ -116,6 +116,9 @@ service_name=""
116
116
enable_profiler=" false"
117
117
enable_profiler_memory=" false"
118
118
enable_metrics=" false"
119
+ otlp_endpoint=" "
120
+ otlp_endpoint_protocol=" "
121
+ metrics_exporter=" "
119
122
java_zeroconfig_path=" /etc/splunk/zeroconfig/java.conf"
120
123
node_zeroconfig_path=" /etc/splunk/zeroconfig/node.conf"
121
124
dotnet_zeroconfig_path=" /etc/splunk/zeroconfig/dotnet.conf"
@@ -496,7 +499,6 @@ disable_preload() {
496
499
}
497
500
498
501
create_zeroconfig_java () {
499
- local otlp_endpoint=" $1 "
500
502
local version=" $( get_package_version splunk-otel-auto-instrumentation ) "
501
503
local resource_attributes=" splunk.zc.method=splunk-otel-auto-instrumentation-${version} "
502
504
@@ -513,12 +515,22 @@ OTEL_RESOURCE_ATTRIBUTES=${resource_attributes}
513
515
SPLUNK_PROFILER_ENABLED=${enable_profiler}
514
516
SPLUNK_PROFILER_MEMORY_ENABLED=${enable_profiler_memory}
515
517
SPLUNK_METRICS_ENABLED=${enable_metrics}
516
- OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint}
517
518
EOH
518
519
519
520
if [ -n " $service_name " ]; then
520
521
echo " OTEL_SERVICE_NAME=${service_name} " >> $java_zeroconfig_path
521
522
fi
523
+
524
+ if [ -n " $otlp_endpoint " ]; then
525
+ echo " OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint} " >> $java_zeroconfig_path
526
+ if [ -n " $otlp_endpoint_protocol " ]; then
527
+ echo " OTEL_EXPORTER_OTLP_PROTOCOL=${otlp_endpoint_protocol} " >> $java_zeroconfig_path
528
+ fi
529
+ fi
530
+
531
+ if [ -n " $metrics_exporter " ]; then
532
+ echo " OTEL_METRICS_EXPORTER=${metrics_exporter} " >> $java_zeroconfig_path
533
+ fi
522
534
}
523
535
524
536
splunk_otel_js_installed () {
@@ -561,7 +573,6 @@ install_node_package() {
561
573
}
562
574
563
575
create_zeroconfig_node () {
564
- local otlp_endpoint=" $1 "
565
576
local version=" $( get_package_version splunk-otel-auto-instrumentation ) "
566
577
local resource_attributes=" splunk.zc.method=splunk-otel-auto-instrumentation-${version} "
567
578
@@ -578,16 +589,25 @@ OTEL_RESOURCE_ATTRIBUTES=${resource_attributes}
578
589
SPLUNK_PROFILER_ENABLED=${enable_profiler}
579
590
SPLUNK_PROFILER_MEMORY_ENABLED=${enable_profiler_memory}
580
591
SPLUNK_METRICS_ENABLED=${enable_metrics}
581
- OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint}
582
592
EOH
583
593
584
594
if [ -n " $service_name " ]; then
585
595
echo " OTEL_SERVICE_NAME=${service_name} " >> $node_zeroconfig_path
586
596
fi
597
+
598
+ if [ -n " $otlp_endpoint " ]; then
599
+ echo " OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint} " >> $node_zeroconfig_path
600
+ if [ -n " $otlp_endpoint_protocol " ]; then
601
+ echo " OTEL_EXPORTER_OTLP_PROTOCOL=${otlp_endpoint_protocol} " >> $node_zeroconfig_path
602
+ fi
603
+ fi
604
+
605
+ if [ -n " $metrics_exporter " ]; then
606
+ echo " OTEL_METRICS_EXPORTER=${metrics_exporter} " >> $node_zeroconfig_path
607
+ fi
587
608
}
588
609
589
610
create_zeroconfig_dotnet () {
590
- local otlp_endpoint=" $1 "
591
611
local version=" $( get_package_version splunk-otel-auto-instrumentation ) "
592
612
local resource_attributes=" splunk.zc.method=splunk-otel-auto-instrumentation-${version} "
593
613
@@ -611,17 +631,26 @@ OTEL_RESOURCE_ATTRIBUTES=${resource_attributes}
611
631
SPLUNK_PROFILER_ENABLED=${enable_profiler}
612
632
SPLUNK_PROFILER_MEMORY_ENABLED=${enable_profiler_memory}
613
633
SPLUNK_METRICS_ENABLED=${enable_metrics}
614
- OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint}
615
634
EOH
616
635
617
636
if [ -n " $service_name " ]; then
618
637
echo " OTEL_SERVICE_NAME=${service_name} " >> $dotnet_zeroconfig_path
619
638
fi
639
+
640
+ if [ -n " $otlp_endpoint " ]; then
641
+ echo " OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint} " >> $dotnet_zeroconfig_path
642
+ if [ -n " $otlp_endpoint_protocol " ]; then
643
+ echo " OTEL_EXPORTER_OTLP_PROTOCOL=${otlp_endpoint_protocol} " >> $dotnet_zeroconfig_path
644
+ fi
645
+ fi
646
+
647
+ if [ -n " $metrics_exporter " ]; then
648
+ echo " OTEL_METRICS_EXPORTER=${metrics_exporter} " >> $dotnet_zeroconfig_path
649
+ fi
620
650
}
621
651
622
652
create_systemd_instrumentation_config () {
623
- local otlp_endpoint=" $1 "
624
- local sdks=" $2 "
653
+ local sdks=" $1 "
625
654
local version=" $( get_package_version splunk-otel-auto-instrumentation ) "
626
655
local resource_attributes=" splunk.zc.method=splunk-otel-auto-instrumentation-${version} -systemd"
627
656
@@ -640,13 +669,23 @@ DefaultEnvironment="OTEL_RESOURCE_ATTRIBUTES=${resource_attributes}"
640
669
DefaultEnvironment="SPLUNK_PROFILER_ENABLED=${enable_profiler} "
641
670
DefaultEnvironment="SPLUNK_PROFILER_MEMORY_ENABLED=${enable_profiler_memory} "
642
671
DefaultEnvironment="SPLUNK_METRICS_ENABLED=${enable_metrics} "
643
- DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint} "
644
672
EOH
645
673
646
674
if [ -n " $service_name " ]; then
647
675
echo " DefaultEnvironment=\" OTEL_SERVICE_NAME=${service_name} \" " >> $systemd_instrumentation_config_path
648
676
fi
649
677
678
+ if [ -n " $otlp_endpoint " ]; then
679
+ echo " DefaultEnvironment=\" OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint} \" " >> $systemd_instrumentation_config_path
680
+ if [ -n " $otlp_endpoint_protocol " ]; then
681
+ echo " DefaultEnvironment=\" OTEL_EXPORTER_OTLP_PROTOCOL=${otlp_endpoint_protocol} \" " >> $systemd_instrumentation_config_path
682
+ fi
683
+ fi
684
+
685
+ if [ -n " $metrics_exporter " ]; then
686
+ echo " DefaultEnvironment=\" OTEL_METRICS_EXPORTER=${metrics_exporter} \" " >> $systemd_instrumentation_config_path
687
+ fi
688
+
650
689
if item_in_list " java" " $sdks " ; then
651
690
echo " DefaultEnvironment=\" JAVA_TOOL_OPTIONS=-javaagent:${instrumentation_jar_path} \" " >> $systemd_instrumentation_config_path
652
691
fi
@@ -910,48 +949,54 @@ Auto Instrumentation:
910
949
(default: --without-systemd-instrumentation)
911
950
--with[out]-instrumentation-sdk "<s>" Whether to enable Auto Instrumentation for a specific language. This option
912
951
takes a comma separated set of values representing supported
913
- auto-instrumentation SDKs. Currently supported: java,node,dotnet.
952
+ auto-instrumentation SDKs.
953
+ Currently supported values: "java", "node", and "dotnet"
914
954
Use --with-instrumentation-sdk to enable only the specified language(s),
915
955
for example "--with-instrumentation-sdk java".
916
956
*Note*: .NET (dotnet) auto instrumentation is only supported on x86_64/amd64.
917
- (default: --with-instrumentation-sdk "$( echo $all_sdks | tr ' ' ' ,' ) " if
918
- --with-instrumentation or --with-systemd-instrumentation is also specified)
957
+ (default: --with-instrumentation-sdk $( echo $all_sdks | tr ' ' ' ,' ) )
919
958
--npm-path <path> If Auto Instrumentation for Node.js is enabled, npm is required to install the
920
959
included Splunk OpenTelemetry Auto Instrumentation for Node.js package. If npm
921
- is not found via the ' command -v npm' shell command or if installation fails,
960
+ is not found via the " command -v npm" shell command or if installation fails,
922
961
Auto Instrumentation for Node.js will not be activated. Use this option to
923
962
specify a custom path to npm, for example "/my/path/to/npm".
924
963
(default: npm)
925
- --deployment-environment <value> Set the ' deployment.environment' resource attribute to the specified value.
964
+ --deployment-environment <value> Set the " deployment.environment" resource attribute to the specified value.
926
965
If not specified, the "Environment" in the Splunk APM UI will appear as
927
- "unknown" for the auto instrumented application(s).
928
- Only applicable if the '--with-instrumentation' or
929
- '--with-systemd-instrumentation' option is also specified.
966
+ "unknown" for all instrumented applications. The resource attribute will be
967
+ appended to the OTEL_RESOURCE_ATTRIBUTES environment variable.
930
968
(default: empty)
931
- --service-name <name> Override the auto-generated service names for all instrumented Java applications
932
- on this host with '<name>'.
933
- Only applicable if the '--with-instrumentation' or
934
- '--with-systemd-instrumentation' option is also specified.
969
+ --service-name <name> Override the auto-generated service names for all instrumented applications
970
+ on this host with the specified value. The value will be set to the
971
+ OTEL_SERVICE_NAME environment variable.
935
972
(default: empty)
936
- --otlp-endpoint <host:port> Set the OTLP gRPC endpoint for captured traces.
937
- Only applicable if the '--with-systemd-instrumentation' option is also specified.
938
- (default: http://LISTEN_INTERFACE:4317 where LISTEN_INTERFACE is the value from
939
- the --listen-interface option if specified, or "127.0.0.1" otherwise)
940
- --[enable|disable]-profiler Enable or disable AlwaysOn Profiling.
941
- Only applicable if the '--with-instrumentation' or
942
- '--with-systemd-instrumentation' option is also specified.
973
+ --otlp-endpoint <host:port> Set the OTLP endpoint for captured traces, logs, and metrics for all activated
974
+ SDKs. The value will be set to the OTEL_EXPORTER_OTLP_ENDPOINT environment
975
+ variable.
976
+ (default: empty, i.e. defer to the default OTEL_EXPORTER_OTLP_ENDPOINT value for
977
+ each activated SDK)
978
+ --otlp-endpoint-protocol <protocol> Set the protocol for the configured OTLP endpoint, for example "grpc" or
979
+ "http/protobuf". The value will be set to the OTEL_EXPORTER_OTLP_PROTOCOL
980
+ environment variable.
981
+ Only applicable if the "--otlp-endpoint <host:port>" option is also specified.
982
+ (default: empty, i.e. defer to the default OTEL_EXPORTER_OTLP_PROTOCOL value for
983
+ each activated SDK)
984
+ --metrics-exporter <exporters> Comma-separated list of exporters for collected metrics by all activated SDKs,
985
+ for example "otlp,prometheus". Set the value to "none" to disable collection and
986
+ export of metrics. The value will be set to the OTEL_METRICS_EXPORTER
987
+ environment variable.
988
+ (default: empty, i.e. defer to the default OTEL_METRICS_EXPORTER value for each
989
+ activated SDK)
990
+ --[enable|disable]-profiler Enable or disable AlwaysOn Profiling for all activated SDKs that support the
991
+ SPLUNK_PROFILER_ENABLED environment variable.
943
992
(default: --disable-profiler)
944
- --[enable|disable]-profiler-memory Enable or disable AlwaysOn Memory Profiling.
945
- Only applicable if the '--with-instrumentation' or
946
- '--with-systemd-instrumentation' option is also specified.
993
+ --[enable|disable]-profiler-memory Enable or disable AlwaysOn Memory Profiling for all activated SDKs that support
994
+ the SPLUNK_PROFILER_MEMORY_ENABLED environment variable.
947
995
(default: --disable-profiler-memory)
948
- --[enable|disable]-metrics Enable or disable instrumentation metrics collection.
949
- Only applicable if the '--with-instrumentation' or
950
- '--with-systemd-instrumentation' option is also specified.
996
+ --[enable|disable]-metrics Enable or disable instrumentation metrics collection for all activated SDKs that
997
+ support the SPLUNK_METRICS_ENABLED environment variable.
951
998
(default: --disable-metrics)
952
999
--instrumentation-version The splunk-otel-auto-instrumentation package version to install.
953
- Only applicable if the '--with-instrumentation' or
954
- '--with-systemd-instrumentation' option is also specified.
955
1000
*Note*: The minimum supported version for Java and Node.js auto instrumentation
956
1001
is 0.87.0, and the minimum supported version for .NET auto instrumentation is
957
1002
0.99.0.
@@ -1191,7 +1236,6 @@ parse_args_and_install() {
1191
1236
local instrumentation_version=" $default_instrumentation_version "
1192
1237
local deployment_environment=" $default_deployment_environment "
1193
1238
local discovery=
1194
- local otlp_endpoint=" "
1195
1239
local npm_path=" npm"
1196
1240
local node_package_installed=" false"
1197
1241
local with_sdks=" "
@@ -1354,6 +1398,14 @@ parse_args_and_install() {
1354
1398
otlp_endpoint=" $2 "
1355
1399
shift 1
1356
1400
;;
1401
+ --otlp-endpoint-protocol)
1402
+ otlp_endpoint_protocol=" $2 "
1403
+ shift 1
1404
+ ;;
1405
+ --metrics-exporter)
1406
+ metrics_exporter=" $2 "
1407
+ shift 1
1408
+ ;;
1357
1409
--enable-profiler)
1358
1410
enable_profiler=" true"
1359
1411
;;
@@ -1431,14 +1483,6 @@ parse_args_and_install() {
1431
1483
trace_url=" ${ingest_url} /v2/trace"
1432
1484
fi
1433
1485
1434
- if [ -z " $otlp_endpoint " ]; then
1435
- if [ -n " $listen_interface " ]; then
1436
- otlp_endpoint=" http://${listen_interface} :4317"
1437
- else
1438
- otlp_endpoint=" http://127.0.0.1:4317"
1439
- fi
1440
- fi
1441
-
1442
1486
check_support
1443
1487
1444
1488
# check auto instrumentation options
@@ -1543,7 +1587,12 @@ parse_args_and_install() {
1543
1587
fi
1544
1588
echo " AlwaysOn Profiling enabled: $enable_profiler "
1545
1589
echo " AlwaysOn Memory Profiling enabled: $enable_profiler_memory "
1546
- echo " OTLP Endpoint: $otlp_endpoint "
1590
+ if [ -n " $otlp_endpoint " ]; then
1591
+ echo " OTLP Endpoint: $otlp_endpoint "
1592
+ if [ -n " $otlp_endpoint_protocol " ]; then
1593
+ echo " OTLP Endpoint Protocol: ${otlp_endpoint_protocol} "
1594
+ fi
1595
+ fi
1547
1596
fi
1548
1597
echo
1549
1598
@@ -1556,22 +1605,22 @@ parse_args_and_install() {
1556
1605
1557
1606
if [ " $with_instrumentation " = " true" ]; then
1558
1607
if item_in_list " java" " $sdks_to_enable " ; then
1559
- create_zeroconfig_java " $otlp_endpoint "
1608
+ create_zeroconfig_java
1560
1609
sdks_enabled=$( add_item_to_list " java" " $sdks_enabled " )
1561
1610
elif [ -f " $java_zeroconfig_path " ]; then
1562
1611
backup_file " $java_zeroconfig_path "
1563
1612
rm -f " $java_zeroconfig_path "
1564
1613
fi
1565
1614
if item_in_list " node" " $sdks_to_enable " && install_node_package " $npm_path " ; then
1566
- create_zeroconfig_node " $otlp_endpoint "
1615
+ create_zeroconfig_node
1567
1616
node_package_installed=" true"
1568
1617
sdks_enabled=$( add_item_to_list " node" " $sdks_enabled " )
1569
1618
elif [ -f " $node_zeroconfig_path " ]; then
1570
1619
backup_file " $node_zeroconfig_path "
1571
1620
rm -f " $node_zeroconfig_path "
1572
1621
fi
1573
1622
if item_in_list " dotnet" " $sdks_to_enable " && [ -f " $dotnet_agent_path " ]; then
1574
- create_zeroconfig_dotnet " $otlp_endpoint "
1623
+ create_zeroconfig_dotnet
1575
1624
sdks_enabled=$( add_item_to_list " dotnet" " $sdks_enabled " )
1576
1625
elif [ -f " $dotnet_zeroconfig_path " ]; then
1577
1626
backup_file " $dotnet_zeroconfig_path "
@@ -1599,7 +1648,7 @@ parse_args_and_install() {
1599
1648
sdks_enabled=$( remove_item_from_list " dotnet" " $sdks_enabled " )
1600
1649
fi
1601
1650
if [ -n " $sdks_enabled " ]; then
1602
- create_systemd_instrumentation_config " $otlp_endpoint " " $ sdks_enabled"
1651
+ create_systemd_instrumentation_config " $sdks_enabled "
1603
1652
else
1604
1653
backup_file " $systemd_instrumentation_config_path "
1605
1654
rm -f " $systemd_instrumentation_config_path "
0 commit comments