OpenTelemetry
if [ $# -ne 3 ]; then echo “Usage: ./setup.sh [servicename] [endpoint] [logginglevel]” echo Example : ./setup.sh http://collector debug exit 1 fi
export OTEL_SERVICE_NAME=$1
export OTEL_LOG_LEVEL=$3
export OTEL_METRICS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=$2:4318
export OTEL_INSTRUMENTATION_OSHI_EXPERIMENTAL_METRICS_ENABLED=true
export OTEL_INSTRUMENTATION_RUNTIME_TELEMETRY_EMIT_EXPERIMENTAL_TELEMETRY=true
export OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_REQUEST_HEADERS=Authorization,Cookie
export OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_REQUEST_HEADERS=Authorization,Cookie
```
Usage :
./setup.sh [servicename] [endpoint] [logginglevel]
OSHI Core allows you to retrieve the “memory” metrics displayed in the Service/System tab.
Version 5.3.1 and above supported.
In pom.xml, add the required dependencies:
<!-- opentelemetry-->
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-oshi</artifactId>
<version>0.16.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>5.3.1</version>
</dependency>
In the Java application entry point, add the recording of metric observers.
import io.opentelemetry.instrumentation.oshi.ProcessMetrics;
import io.opentelemetry.instrumentation.oshi.SystemMetrics;
public static void main(String[] args) {
/*
* ...
*/
SystemMetrics.registerObservers();
ProcessMetrics.registerObservers();
}
java -javaagent:path/to/opentelemetry-javaagent.jar -jar myapp.jar
OpenTelemetry .NET automatic instrumentation should work with all officially supported operating systems and versions of .NET. The minimum supported version of .NET Framework is 4.6.2. The following processor architectures are supported: x86 AMD64 (x86-64) ARM64 (experimental)
Import-Module ./env.psm1, then:
Register-OpenTelemetryForIIS -OTelServiceName <service_name> -AppPoolName <app_pool_name> -OtelExporterOtlpEndpoint <endpoint_url> where ./otelcol.exe --config=file:./config.yaml --feature-gates=service.profilesSupportFor SharePoint: If you notice that error messages are not being reported, refresh the page several times.