Getting started with OpenTelemetry

OpenTelemetry

Java Instrumentation with OpenTelemetry

    #!/bin/bash

    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]`

+ __[servicename]__: service name.
+ __[endpoint]__ : url of Nudge Exporter (OTEL Collector).
+ __[logginglevel]__ : log level. Possible values : error, warn, info, debug, trace. Default value : info.

OSHI Core [Optional]

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();
	}

Launch of the application

java -javaagent:path/to/opentelemetry-javaagent.jar -jar myapp.jar

NodeJS Instrumentation with OpenTelemetry

Dotnet Instrumentation with OpenTelemetry

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)

We will be using OpenTelemetry v1.14.0.

Configuration

Sharepoint

Troubleshooting

Uninstall OpenTelemetry