Getting started with Monium
Monium is a platform made to collect metrics, logs, and traces from Yandex Cloud, other clouds, or your local infrastructure.
Follow this guide to send telemetry data from your app or demo app via OTel Collector
To get started with Yandex Cloud metrics, refer to Getting started with Yandex Cloud resource metrics.
To get started with app telemetry in Monium:
-
Set up telemetry transmission from your app or demo app.
If you have already set up OTLP telemetry, specify the Monium connection settings.
Get your cloud ready
-
Log in to the management console
or sign up. If not signed up yet, navigate to the management console and follow the instructions. -
On the Yandex Cloud Billing page
, make sure you have a linked billing account with theACTIVEorTRIAL_ACTIVEstatus. If you do not have a billing account yet, create one.If you have an active billing account, you can navigate to the cloud page
to create or select a folder for your infrastructure.
Create a service account and API key
-
In the management console
, navigate to the folder where you want to store your telemetry. -
Go to Identity and Access Management.
-
Click Create service account.
-
Enter a name for the service account, e.g.,
monium-ca. -
Click
Add role and addmonium.telemetry.writer.
If you plan to transfer only particular data types, instead ofmonium.telemetry.writer, select one or more of the following roles:monium.metrics.writer,monium.logs.writer, andmonium.traces.writer. -
Click Create.
-
Select the account you created from the list.
-
In the top panel, click
Create new key and select Create API key. -
Select Scope:
yc.monium.telemetry.write. -
Optionally, specify Expires at.
-
Click Create.
-
Save the secret key for the next step.
Set up telemetry transmission from your app
If you do not have a ready-made application, use a demo app.
In Monium, telemetry has this hierarchy: project → cluster → service. Data for each service-cluster pair is distributed to individual shards.
-
Set these environment variables:
-
MONIUM_PROJECT: Monium project name.By default, when you create a cloud and folder, two projects are created:
cloud__<cloud_ID>andfolder__<folder_ID>. You can also create other projects.To test Monium, you can specify a project folder, e.g.,
folder__b1g86q4m5vej********.If entering it manually, make sure that
folderis followed by two underscores. -
MONIUM_API_KEY: API key.
-
-
Set up your application to send OTLP telemetry:
- Install the auto-instrumentation
agent to automatically collect some telemetry data and send it to OTLP. - Add the OpenTelemetry SDK
to your app.
- Install the auto-instrumentation
-
Install
OTel Collector.You can send data to Monium directly from the OpenTelemetry SDK, without using the agent.
-
In the
otel-collector.yamlconfiguration file, configure data transfer to Monium.Example of a minimal
otel-collector.yamlconfiguration:receivers: otlp: # Target type: OTLP protocols: # Protocols that OTel Collector listens to grpc: # gRPC, default port 4317 http: # HTTP, default port 4318 processors: cumulativetodelta: batch: exporters: # Connecting to Monium otlp/monium: compression: zstd endpoint: ingest.monium.yandex.cloud:443 headers: Authorization: "Api-Key ${env:MONIUM_API_KEY}" x-monium-project: "${env:MONIUM_PROJECT}" service: pipelines: metrics: # Transferring metrics receivers: [ otlp ] processors: [ batch, cumulativetodelta ] exporters: [ otlp/monium ] traces: # Transferring traces receivers: [ otlp ] processors: [ batch ] exporters: [ otlp/monium ] logs: # Transferring logs receivers: [ otlp ] processors: [ batch ] exporters: [ otlp/monium ] -
Set the environment variables to distribute data across shards in Monium:
OTEL_SERVICE_NAME: Name of your application or service.OTEL_RESOURCE_ATTRIBUTES="cluster=my-cluster": Name of the installation the application operates in, e.g., production or test environment. This is an optional setting. The default value iscluster=default.
-
Run your app and start sending telemetry.
Monium connection settings and data distribution
If your application is already configured to send telemetry, specify these settings:
- Authentication: API key.
- Endpoint:
ingest.monium.yandex.cloud:443. - In the header:
x-monium-project=folder__<folder_ID>parameter. - In
OTEL_RESOURCE_ATTRIBUTES:clusterordeployment.nameandserviceorservice.name.
All metrics, logs, and traces in Monium have mandatory labels: project, cluster, and service. These labels form the shard key.
When delivering telemetry in OpenTelemetry format, the values of these key attributes are determined as follows:
- Highest priority: Values set via HTTP or gRPC headers.
- Then, the values set in the resource attributes of the request body with the
clusterandservicekeys. - Then, the values set in the resource attributes recommended by the OpenTelemetry semantic convention.
- Otherwise, a default value is assigned.
The project name is only taken from the header. The algorithm for determining the shard key is presented in the table below.
|
header |
resource’s own attribute |
resource’s standard attribute |
default value |
|
|
— |
— |
— |
|
|
|
|
|
|
|
|
|
|
View the data 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.
-
Note
Keep in mind that data in Monium appears with a lag rather than immediately, since the Otel Collector starts sending data after 60 seconds.
To use the data you collected, you can create dashboards and alerts.
Demo app setup example
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 -
Download and install OTel Collector
suitable for your OS. Here is an example:wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v144.0/otelcol-linux_amd64.tar.gz tar xvf otelcol-linux_amd64.tar.gz -
Set these environment variables:
export MONIUM_PROJECT=folder__<folder_ID> export MONIUM_API_KEY=<API_key> -
Create a file named
stream_put_record.pyand paste the following code to it:receivers: otlp: protocols: grpc: http: exporters: otlp_grpc/monium: compression: zstd endpoint: ingest.monium.yandex.cloud:443 headers: Authorization: "Api-Key ${env:MONIUM_API_KEY}" x-monium-project: "${env:MONIUM_PROJECT}" sending_queue: batch: service: pipelines: metrics: receivers: [ otlp ] exporters: [ otlp_grpc/monium ] traces: receivers: [ otlp ] exporters: [ otlp_grpc/monium ] logs: receivers: [ otlp ] exporters: [ otlp_grpc/monium ] telemetry: metrics: level: normal readers: - periodic: exporter: otlp: protocol: http/protobuf endpoint: http://localhost:4318 interval: 30000 timeout: 5000 -
Run OTel Collector:
./otelcol-linux_amd64 --config otel-collector.yamlIt will start listening on ports
4317(gRPC) and4318(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 to send telemetry to OTel Collector:
OTEL_SERVICE_NAME=spring-petclinic \ OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="delta" \ java -javaagent:./opentelemetry-javaagent.jar -jar target/*.jar -
Open the Spring PetClinic website at
http://localhost:8080and simulate user actions.
After you finish the setup, view the telemetry in Monium.