OTLP in Monium
Monium can receive metrics via OTLP
Endpoints
Monium provides the following endpoints for receiving metrics in OTLP format:
|
Protocol |
Endpoint |
Description |
|
HTTP |
|
HTTP endpoint for receiving metrics |
|
HTTP |
|
HTTP endpoint for receiving logs |
|
HTTP |
|
HTTP endpoint for receiving traces |
|
gRPC |
|
gRPC endpoint for receiving all telemetry |
The gRPC and HTTP endpoints are fully compatible with the OTLP specification
Authorization
Requests are authorized using an API key provided in the Authorization header:
Authorization: Api-Key <API_key>
The API key is created for a service account with the monium.telemetry.writer role. The key must have the yc.monium.telemetry.write scope to write any type of telemetry or one or more of the following for granular access: yc.monium.metrics.write, yc.monium.logs.write, yc.monium.traces.write. Learn more about creating an API key.
Headings
Required headers
|
Header |
Description |
Example |
|
|
API key for authentication |
|
|
|
Project name: Monium |
|
Optional headers
|
Header |
Description |
Example |
Default value |
|
|
Cluster name |
|
|
|
|
Service name |
|
|
Distribution by shards
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 |
|
|
— |
— |
— |
|
|
|
|
|
|
|
|
|
|
Learn more about sharding parameters in Basic terms.
Data compression
Realtime API supports the following compression types:
|
Method |
HTTP header |
gRPC |
Recommendation |
|
No compression. |
– |
– |
For debugging or for a small data stream |
|
gzip |
|
|
Supported by default |
|
zstd |
|
|
Recommended: more efficient in terms of computing resources |
Metric type mapping
This section maps OpenTelemetry data types to Monium types.
OTLP metric types
OpenTelemetry uses the following metric types:
|
OTLP type |
Characteristic |
Use cases |
|
|
Instant value |
Memory usage, temperature |
|
|
Monotonic counter |
Number of requests, request size |
|
|
Additive counter |
Number of active connections |
|
|
Distribution of values |
Request duration, response size |
|
|
Quantiles and sum |
Latency percentiles |
Monium type mapping
Monium converts OTLP types into its internal metric types depending on temporality:
Temporality = Delta
|
OTLP type |
Monotonicity |
Monium type |
Note |
|
|
— |
|
Instant value |
|
|
Monotonic |
|
The sum is divided by the interval length in seconds |
|
|
— |
|
|
|
|
— |
|
|
Temporality = Cumulative
|
OTLP type |
Monotonicity |
Monium type |
Note |
|
|
— |
|
Instant value |
|
|
Non-monotonic |
|
Absolute value of the counter |
|
|
Monotonic |
|
Absolute value of the counter |
|
|
— |
|
|
|
|
— |
|
|
Examples of sum processing
Cumulative Sum
|
Period |
Increments |
Sum |
Value in Monium |
Type |
Note |
|
#1 |
|
15 |
15 |
|
The sum value is used |
|
#2 |
|
10 |
10 |
|
The sum value is used |
|
#3 |
|
10 |
10 |
|
The last value is saved |
Delta Sum, Monotonic
|
Period |
Increments |
Sum, interval |
Value in Monium |
Type |
Note |
|
#1 |
|
|
3 (15 / 5) |
|
Sum is divided by interval |
|
#2 |
|
|
2 (10 / 5) |
|
Sum is divided by interval |
|
#3 |
|
|
0 (0 / 5) |
|
Null value |
Non-monotonic delta sums are typically not used in OpenTelemetry.
Processing resource attributes
Monium processes OTLP resource attributes as follows:
Preserved attributes
The following resource attributes are preserved as metric labels:
Host attributes (prioritized from highest to lowest):
hosthost.namehostname
These attributes are saved under the host label.
Environment attributes (prioritized from highest to lowest):
envdeployment.environment.namedeployment.environment
These attributes are saved under the env label.
Kubernetes and Cloud attributes (saved without renaming):
cloud.availability_zonecloud.regioncontainer.namek8s.cluster.namek8s.container.namek8s.cronjob.namek8s.daemonset.namek8s.deployment.namek8s.job.namek8s.namespace.namek8s.pod.namek8s.replicaset.namek8s.statefulset.name
Reserved labels
If data point attributes use reserved label names, they are automatically renamed:
|
Original name |
Renamed to |
|
|
|
|
|
|
|
|
|
Other attributes
Resource attributes not listed above are discarded.
All data point attributes are preserved as Monium metric labels.
Data format
Monium supports the OTLP Protobuf format for all types of telemetry. The OTLP JSON format is currently supported for logs and traces.