I am trying to setup telegraf to listen for metrics from Apache Airflow v2.7.1
Using the input module http_listener_v2. I am getting one log message when I enable debugging which is “Number of Configs: 0”
Here is my full telegraf configuration
[agent]
interval = "5s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "5s"
flush_jitter = "0s"
precision = "0s"
debug = true
quiet = false
logtarget = "file"
logfile = ""
omit_hostname = false
[[inputs.http_listener_v2]]
service_address = ":8080"
paths = ["/v1/metrics"]
methods = ["POST", "PUT"]
data_source = "body"
read_timeout = "20s"
write_timeout = "20s"
data_format = "xpath_protobuf"
xpath_protobuf_import_paths = [".", "opentelemetry/proto/metrics/v1"]
xpath_protobuf_file = "opentelemetry/proto/metrics/v1/metrics.proto"
xpath_protobuf_type = "opentelemetry.proto.metrics.v1.MetricsData"
[[outputs.file]]
files = ["stdout"]
I downloaded the opentelemetry proto files from https://github.com/open-telemetry/opentelemetry-proto/tree/main/opentelemetry/proto
and moved it to the same directory and I am sure telegraf can read it because it was giving parsing error before I do that.
I am running both telegraf and apache airflow on localhost without using docker
As far as I can tell, airflow is producing the metrics in the exact format as the .proto files specify.
here is a metric produced by airflow represented in json format for readability
{
"resource_metrics": [
{
"resource": {
"attributes": {
"service.name": "Airflow"
},
"schema_url": ""
},
"scope_metrics": [
{
"scope": {
"name": "airflow.metrics.otel_logger",
"version": null,
"schema_url": ""
},
"metrics": [
{
"name": "airflow-otel.serde.load_serializers",
"description": "",
"unit": "",
"data": {
"data_points": [
{
"attributes": {},
"start_time_unix_nano": 0,
"time_unix_nano": 1708089023039230000,
"value": 0.005870708031579852
}
]
}
}
],
"schema_url": ""
}
],
"schema_url": ""
}
]
}
I am not sure how to debug this further, any clues?