Skip to content

Commit

Permalink
fix refactored metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed Jun 17, 2024
1 parent e6e129e commit 6174be1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Following metrics are supported:
| `upper_mac_total_slot_count` | Counter | Counters for all received slots | `logical_channel`: The logical channel that is contained in the slot. |
| `upper_mac_slot_error_count` | Counter | Counters for all received slots with errors | `logical_channel`: The logical channel that is contained in the slot. `error_type`: Any of `CRC Error` or `Decode Error`. This includes errors in decoding for the upper mac or any layer on above. Errors in decoding reconstructed fragments are reported in the slot of the last fragment. |
| `upper_mac_fragment_count` | Counter | Counters for all received c-plane fragments | `type`: Any of `Continous` or `Stealing Channel`. `counter_type`: Any of `All` or `Reconstuction Error`. If there was a disallowed state transition in the reconstruction, the counter is incremented. Additional for `Stealing Channel` the counter is incremented if the fragment was not finalized across the stealing channel. |
| `packet_count` | Counter | Counter for all received packets in a protocol layer. | `protocol`: Any of `Upper Mac`, `C-Plane Signalling` (Before reconstruction. Start fragments are seperated), `Logical Link Control`, ` Mobile Link Entity`, `Circuit Mode Control Entity`, `Mobile Management`. `packet_type`: The packet types of the specific protocol. |
| `protocol`_`packet_count` | Counter | Counter for all received packets in a protocol layer. | `protocol`: Any of `upper_mac`, `c_plane_signalling` (Before reconstruction. Start fragments are seperated), `logical_link_control`, `mobile_link_entity`, `circuit_mode_control_entity`, `mobile_management`. `packet_type`: The packet types of the specific protocol. |
2 changes: 1 addition & 1 deletion include/l2/logical_link_control.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LogicalLinkControl {
"ReservedLayer2SignallingPdu14",
"ReservedLayer2SignallingPdu15"};
if (prometheus_exporter) {
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "Logical Link Control");
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "logical_link_control");
}
};
~LogicalLinkControl() noexcept = default;
Expand Down
2 changes: 1 addition & 1 deletion include/l3/circuit_mode_control_entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CircuitModeControlEntity {
}

if (prometheus_exporter) {
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "Circuit Mode Control Entity");
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "circuit_mode_control_entity");
}
};
~CircuitModeControlEntity() noexcept = default;
Expand Down
2 changes: 1 addition & 1 deletion include/l3/mobile_link_entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MobileLinkEntity {
}

if (prometheus_exporter) {
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "Mobile Link Entity");
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "mobile_link_entity");
}
};
~MobileLinkEntity() noexcept = default;
Expand Down
2 changes: 1 addition & 1 deletion include/l3/mobile_management.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class MobileManagement {
"U-MM PDU/FUNCTION NOT SUPPORTED"};
}
if (prometheus_exporter) {
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "Mobile Management");
metrics_ = std::make_unique<PacketCounterMetrics>(prometheus_exporter, "mobile_management");
}
}
~MobileManagement() noexcept = default;
Expand Down
4 changes: 2 additions & 2 deletions src/prometheus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ auto PrometheusExporter::upper_mac_fragment_count() noexcept -> prometheus::Fami
auto PrometheusExporter::packet_count(const std::string& protocol) noexcept
-> prometheus::Family<prometheus::Counter>& {
return prometheus::BuildCounter()
.Name("packet_count")
.Name(protocol + "_packet_count")
.Help("Incrementing counter of the number of received packets in a protocol layer.")
.Labels({{"name", prometheus_name_}, {"protocol", protocol}})
.Labels({{"name", prometheus_name_}})
.Register(*registry_);
}

0 comments on commit 6174be1

Please sign in to comment.