No, the order of labels doesn't matter. Either at ingestion time or at query time.
Note that `instance` is a reserved label name for Prometheus. Prometheus injects the `instance` label for you, the app does not need to know anything about instance or other deployment topology information. This is handled by service discovery. On Thu, Sep 28, 2023 at 11:41 AM Andrii Babanin <[email protected]> wrote: > Hi > > I'm working on a proprietary metrics framework that exposes the metrics > page for Prometheus to scrape from. > > I wonder if will it affect the Prometheus server if I change the order of > labels. For instance, > > In framework v1 I expose metrics with unordered labels: > > test_counter{instance="test:80",error="false",app_name="TestApp"} > > In framework v2 labels are lexicographically sorted: > > test_counter{app_name="TestApp",error="false",instance="test:80"} > > > Does the order of metrics important? > Will Prometheus be able to continue scraping my metric endpoint with no > issues? > > TIA > > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/98998994-47c5-4004-a4e9-8df2abd6a35dn%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/98998994-47c5-4004-a4e9-8df2abd6a35dn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CABbyFmojc_Y9S-W7MsVHosjqt5Fs%3D2tYRH%3D7oioeMocvOL5u6w%40mail.gmail.com.

