Telegraf as external scrapper

Hello,

I use telegraf to scrape an external cluster and send back data to another telegraf scrape by prometheus (data_fromat set to prometheus in HTTP modules).

Something like that:

                                        INTERNET


                                           │
┌──────────────────┐                       │
│                  │
│   PROMETHEUS     │
│                  │                       │
└────────┬─────────┘                       │
         │
         │
         │                                 │
         │                                 │
         │
         ▼
 ┌────────────────┐                        │                   ┌────────────────┐                        ┌───────────────────┐
 │                │  HTTP listener v2      │                   │                │      INPUT PROMETHEUS  │                   │
 │   TELEGRAF 2   │◄───────────────────────┴───────────────────┤   TELEGRAF1    │ ─────────────────────► │      PODS         │
 │                │                                HTTP OUTPUT │                │                        │                   │
 └────────────────┘                        │                   └────────────────┘                        └───────────────────┘
                                           │


                                           │
                                           │


                                           │
                                           │

Everything is working great, but I was wondering if there is a better way.
Moreover, metrics get in TELEGRAF 2 avec prefix by prometheus so maybe there is a way to do not have this prefix.

Best

Bastien

Hi,

Check out the prometheus plugin readme where it talks about the different metric formats.

It sounds like you are using metric version 2, you may want to see if metric version 1 fits your needs better to maintain the metric names you want. However, there are trade-offs with both metric versions. For example, to pass-through metrics more easily, which sounds like what you are doing, I believe version 2 has some additional benefits.