History log of /openbsd-current/usr.sbin/bgpctl/ometric.c
Revision Date Author Comments
# 1.10 06-Jan-2023 tb

sync with rpki-client 'more dastardly white spaces' commit


# 1.9 14-Dec-2022 claudio

Add missing type for OMT_INFO.

Changes output like this:
# HELP bgpd bgpd information
-# TYPE bgpd unknown
+# TYPE bgpd info
bgpd_info{nodename="xxx",domainname="xxx",release="7.7"} 1


# 1.8 12-Dec-2022 claudio

Since bgpctl uses clock_gettime() and struct timespec switch ometric code
over to handle struct timespec instead of struct timeval. This way no
extra conversion is needed.
OK tb@


# 1.7 06-Dec-2022 claudio

OpenMetrics is rather strict about naming metricsets.
Add a function that a) verifies that none of the special suffixes is used
and b) that the name itself is not yet used already.
Also when printing a counter _total has to be added to the metric name and
for info metrics _info is added.
With and OK tb@


# 1.6 06-Dec-2022 claudio

Implement ometric_set_timeval() and ometric_set_timeval_with_labels()

Timestamps are special since they can require more significant bits
than a double provides. Instead print them as pseudo float as suggested
by the OpenMetrics draft.
OK cheloha@


# 1.5 05-Dec-2022 claudio

Revert and adjust the changes in ometric_set_state() from last commit.
Calling ometric_set_int_with_labels() for a state metric fails because
there is a check in ometric_set_int comparing the type.
Use olabels_add_extras() and ometric_set_int_value() instead.


# 1.4 01-Dec-2022 claudio

Extend and rename ometric_set_int_with_label to ometric_set_int_with_labels

Instead of passing a single key value pair allow for multiple keys and values.
This is needed for rpki-client where 2 extra key value pairs are needed for
some values. To simplify passing simple values introduce a OKV() macro
which creates a compound literal array with the NULL terminal.
OK tb@


# 1.3 30-Nov-2022 claudio

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.9 14-Dec-2022 claudio

Add missing type for OMT_INFO.

Changes output like this:
# HELP bgpd bgpd information
-# TYPE bgpd unknown
+# TYPE bgpd info
bgpd_info{nodename="xxx",domainname="xxx",release="7.7"} 1


# 1.8 12-Dec-2022 claudio

Since bgpctl uses clock_gettime() and struct timespec switch ometric code
over to handle struct timespec instead of struct timeval. This way no
extra conversion is needed.
OK tb@


# 1.7 06-Dec-2022 claudio

OpenMetrics is rather strict about naming metricsets.
Add a function that a) verifies that none of the special suffixes is used
and b) that the name itself is not yet used already.
Also when printing a counter _total has to be added to the metric name and
for info metrics _info is added.
With and OK tb@


# 1.6 06-Dec-2022 claudio

Implement ometric_set_timeval() and ometric_set_timeval_with_labels()

Timestamps are special since they can require more significant bits
than a double provides. Instead print them as pseudo float as suggested
by the OpenMetrics draft.
OK cheloha@


# 1.5 05-Dec-2022 claudio

Revert and adjust the changes in ometric_set_state() from last commit.
Calling ometric_set_int_with_labels() for a state metric fails because
there is a check in ometric_set_int comparing the type.
Use olabels_add_extras() and ometric_set_int_value() instead.


# 1.4 01-Dec-2022 claudio

Extend and rename ometric_set_int_with_label to ometric_set_int_with_labels

Instead of passing a single key value pair allow for multiple keys and values.
This is needed for rpki-client where 2 extra key value pairs are needed for
some values. To simplify passing simple values introduce a OKV() macro
which creates a compound literal array with the NULL terminal.
OK tb@


# 1.3 30-Nov-2022 claudio

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.8 12-Dec-2022 claudio

Since bgpctl uses clock_gettime() and struct timespec switch ometric code
over to handle struct timespec instead of struct timeval. This way no
extra conversion is needed.
OK tb@


# 1.7 06-Dec-2022 claudio

OpenMetrics is rather strict about naming metricsets.
Add a function that a) verifies that none of the special suffixes is used
and b) that the name itself is not yet used already.
Also when printing a counter _total has to be added to the metric name and
for info metrics _info is added.
With and OK tb@


# 1.6 06-Dec-2022 claudio

Implement ometric_set_timeval() and ometric_set_timeval_with_labels()

Timestamps are special since they can require more significant bits
than a double provides. Instead print them as pseudo float as suggested
by the OpenMetrics draft.
OK cheloha@


# 1.5 05-Dec-2022 claudio

Revert and adjust the changes in ometric_set_state() from last commit.
Calling ometric_set_int_with_labels() for a state metric fails because
there is a check in ometric_set_int comparing the type.
Use olabels_add_extras() and ometric_set_int_value() instead.


# 1.4 01-Dec-2022 claudio

Extend and rename ometric_set_int_with_label to ometric_set_int_with_labels

Instead of passing a single key value pair allow for multiple keys and values.
This is needed for rpki-client where 2 extra key value pairs are needed for
some values. To simplify passing simple values introduce a OKV() macro
which creates a compound literal array with the NULL terminal.
OK tb@


# 1.3 30-Nov-2022 claudio

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.7 06-Dec-2022 claudio

OpenMetrics is rather strict about naming metricsets.
Add a function that a) verifies that none of the special suffixes is used
and b) that the name itself is not yet used already.
Also when printing a counter _total has to be added to the metric name and
for info metrics _info is added.
With and OK tb@


# 1.6 06-Dec-2022 claudio

Implement ometric_set_timeval() and ometric_set_timeval_with_labels()

Timestamps are special since they can require more significant bits
than a double provides. Instead print them as pseudo float as suggested
by the OpenMetrics draft.
OK cheloha@


# 1.5 05-Dec-2022 claudio

Revert and adjust the changes in ometric_set_state() from last commit.
Calling ometric_set_int_with_labels() for a state metric fails because
there is a check in ometric_set_int comparing the type.
Use olabels_add_extras() and ometric_set_int_value() instead.


# 1.4 01-Dec-2022 claudio

Extend and rename ometric_set_int_with_label to ometric_set_int_with_labels

Instead of passing a single key value pair allow for multiple keys and values.
This is needed for rpki-client where 2 extra key value pairs are needed for
some values. To simplify passing simple values introduce a OKV() macro
which creates a compound literal array with the NULL terminal.
OK tb@


# 1.3 30-Nov-2022 claudio

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.7 06-Dec-2022 claudio

OpenMetrics is rather strict about naming metricsets.
Add a function that a) verifies that none of the special suffixes is used
and b) that the name itself is not yet used already.
Also when printing a counter _total has to be added to the metric name and
for info metrics _info is added.
With and OK tb@


# 1.6 06-Dec-2022 claudio

Implement ometric_set_timeval() and ometric_set_timeval_with_labels()

Timestamps are special since they can require more significant bits
than a double provides. Instead print them as pseudo float as suggested
by the OpenMetrics draft.
OK cheloha@


# 1.5 05-Dec-2022 claudio

Revert and adjust the changes in ometric_set_state() from last commit.
Calling ometric_set_int_with_labels() for a state metric fails because
there is a check in ometric_set_int comparing the type.
Use olabels_add_extras() and ometric_set_int_value() instead.


# 1.4 01-Dec-2022 claudio

Extend and rename ometric_set_int_with_label to ometric_set_int_with_labels

Instead of passing a single key value pair allow for multiple keys and values.
This is needed for rpki-client where 2 extra key value pairs are needed for
some values. To simplify passing simple values introduce a OKV() macro
which creates a compound literal array with the NULL terminal.
OK tb@


# 1.3 30-Nov-2022 claudio

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.4 01-Dec-2022 claudio

Extend and rename ometric_set_int_with_label to ometric_set_int_with_labels

Instead of passing a single key value pair allow for multiple keys and values.
This is needed for rpki-client where 2 extra key value pairs are needed for
some values. To simplify passing simple values introduce a OKV() macro
which creates a compound literal array with the NULL terminal.
OK tb@


# 1.3 30-Nov-2022 claudio

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.3 30-Nov-2022 claudio

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.2 01-Nov-2022 claudio

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@


# 1.1 17-Oct-2022 claudio

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@