OTEL Collector Architecture
Understanding otel collector and how it works is important for us to configure and push relevant metrics over. The focus of this article is to provide a simple sraight forward configurations. There are more complex setup available, we will cover those later.
This is an example of the OTEL architecture
Receiver
First we have the "Receiver" - where data comes in. In this setup, data can be pushed via port 4318 (over http) and 4317 (over gRPC).
Exporter
Here we have configure our otel collector to log metric to console (debug) and prometheus on port 8888. So we are exposing a new promethus service here and any prometheus services (if configured correctly) would be able to scrap these out.
The endpoint exposed is /metrics
And then we need to bring it together by using services. Noticed that for prometheus, we only exposes "metrics" (as prometheus is designed for metric data only)
To be able to get metrics data from prometheus, we can run the following command :-
Invoke-WebRequest -Uri "http://localhost:8881/metrics" -Method GET | Select-Object -ExpandProperty Content
And if things goes well, we would have the followings outputs.
The behaviou that I notice here is that it will it is provide you with the latest data. If you missed it in a single point in time, you missed those data. :)
Comments