Skip to content

Commit 4794b58

Browse files
committed
1.2.1 - split endpoint and endpoint_name labels
1 parent d6b291c commit 4794b58

11 files changed

Lines changed: 241 additions & 300 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "distributed-metrics"
3-
version = "1.2.0"
3+
version = "1.2.1"
44
edition = "2021"
55
repository = "https://github.com/BitpingApp/distributed-metrics"
66
homepage = "https://bitping.com"

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
{
4040
default = pkgs.rustPlatform.buildRustPackage {
4141
pname = "distributed-metrics";
42-
version = "1.2.0";
42+
version = "1.2.1";
4343
src = ./.;
44-
cargoHash = "sha256-Cd+jNSFPGZYiTBVoqQSJAmzMh5Irw5MymH/dCBBP3Pw=";
44+
cargoHash = "sha256-AYOYM2DkGIBlOfYaUibn5HQdtW032duafQUabBd2Vjg=";
4545
};
4646
}
4747
);

src/collectors/dns/errors.rs

Lines changed: 0 additions & 120 deletions
This file was deleted.

src/collectors/dns/mod.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
mod errors;
2-
31
use super::{Collector, CollectorErrors};
4-
use distributed_metrics::config::{DnsConfig, LookupTypes};
52
use crate::types::{
63
PerformDnsBodyConfiguration, PerformDnsBodyConfigurationLookupTypesItem,
74
PerformDnsBodyContinentCode, PerformDnsBodyCountryCode, PerformDnsBodyMobile,
@@ -10,6 +7,7 @@ use crate::types::{
107
};
118
use crate::API_CLIENT;
129
use color_eyre::eyre::Result;
10+
use distributed_metrics::config::{DnsConfig, LookupTypes};
1311
use geohash::Coord;
1412
use metrics::{counter, gauge, histogram};
1513
use std::collections::hash_map::DefaultHasher;
@@ -155,12 +153,7 @@ impl Collector for DnsCollector {
155153
}
156154

157155
fn handle_response(&self, response: PerformDnsResponse) -> Result<(), CollectorErrors> {
158-
let endpoint = self
159-
.config
160-
.common_config
161-
.name
162-
.as_ref()
163-
.unwrap_or(&self.config.common_config.endpoint);
156+
let endpoint = &self.config.common_config.endpoint;
164157

165158
let node_info = response
166159
.node_info
@@ -175,6 +168,9 @@ impl Collector for DnsCollector {
175168
("os", node_info.operating_system.clone()),
176169
("endpoint", endpoint.clone()),
177170
]);
171+
if let Some(name) = &self.config.common_config.name {
172+
labels.insert("endpoint_name", name.clone());
173+
}
178174
if let Ok(v) = geohash::encode(
179175
Coord {
180176
x: node_info.lon,

0 commit comments

Comments
 (0)