Setting up a demo Java app and collecting telemetry
Getting started
Sign up for Yandex Cloud and create a billing account:
- Navigate to the management console
and log in to Yandex Cloud or create a new account. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVEorTRIAL_ACTIVEstatus. If you do not have a billing account, create one and link a cloud to it.
If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page
Learn more about clouds and folders here.
Setting up a demo app and telemetry delivery
In this example, you will install Spring PetClinic
-
Install Git
and Java suitable for your OS. Here is an example:sudo apt update sudo apt install -y git openjdk-17-jdk -
Install Fluent Bit
4.0 or higher. -
Set these environment variables:
export MONIUM_PROJECT=<project_ID> export MONIUM_API_KEY=<API_key> -
Create a configuration file, e.g.,
fluent-bit.yaml. Use the Fluent Bit settings section configuration. Example for gRPC:pipeline: inputs: - name: opentelemetry listen: 127.0.0.1 port: 4318 outputs: - name: opentelemetry match: "*" host: ingest.monium.yandex.cloud port: 443 tls: on compress: zstd grpc: on header: - Authorization Api-Key ${MONIUM_API_KEY} - x-monium-project ${MONIUM_PROJECT} -
Run Fluent Bit:
fluent-bit -c fluent-bit.yamlFluent Bit will start receiving telemetry over OTLP at
127.0.0.1:4318(HTTP). -
Download and build Spring PetClinic:
git clone https://github.com/spring-projects/spring-petclinic cd spring-petclinic ./mvnw -DskipTests package -
Download the OpenTelemetry Java agent:
curl -L -o opentelemetry-javaagent.jar \ https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar -
Run the application with the Java agent. The telemetry will go to Fluent Bit port 4318. Do not specify
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="delta": when transferred via Fluent Bit, delta metrics cannot be processed correctly.OTEL_SERVICE_NAME=spring-petclinic \ OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="cumulative" \ java -javaagent:./opentelemetry-javaagent.jar -jar target/*.jar -
Open Spring PetClinic at
http://localhost:8080and simulate user actions.
Viewing telemetry in Monium
-
On the Monium
home page, select Shards on the left. -
In the list, select the shard with your service name.
The shard name follows the
<project_name>_<cluster_name>_<service_name>format, e.g.,folder__b1g86q4m5vej********_default_spring-petclinic. -
To view a specific data type, on the left, select:
-
Metrics.
In the query string, select
project,cluster, andserviceone by one and click Execute query.Example of a chart with metrics

Learn more about using metrics.
-
Logs.
In the query string, select
project,cluster, andserviceone by one and click Execute query.Example of a page with logs

Learn more on how to use logs.
-
Traces.
In the query string, select
projectandserviceone by one and click Execute.Example of a page with traces

Learn more on how to use traces.
-