Skip to content

Commit 2f1ba19

Browse files
committed
imp: update grafana alloy/agent for scraping 10.3.1 new tracing endpoint
1 parent b912b62 commit 2f1ba19

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

flake/nixosModules/profile-grafana-agent.nix

+5-3
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ flake: {
464464
++ optionals (cfgSvc ? cardano-node && cfgSvc.cardano-node.enable)
465465
(map (i: let
466466
metrics_path =
467-
if cfgSvc.cardano-node.useLegacyTracing
467+
if cfgSvc.cardano-node.useLegacyTracing || (!cfgSvc.cardano-node.useLegacyTracing && cfgSvc.cardano-node.ngTracer)
468468
then "/metrics"
469469
else "/${(cfgSvc.cardano-node.extraNodeInstanceConfig i).TraceOptionNodeName}";
470470

@@ -475,8 +475,10 @@ flake: {
475475

476476
targets =
477477
if cfgSvc.cardano-node.useLegacyTracing
478-
then ["${hostAddr}:${toString (cardanoNodePrometheusExporterPort + i)}"]
479-
else ["${hostAddr}:${toString cardanoNodePrometheusExporterPort}"];
478+
then "${hostAddr}:${toString (cardanoNodePrometheusExporterPort + i)}"
479+
else if cfgSvc.cardano-node.ngTracer
480+
then "${hostAddr}:${toString (cardanoNodePrometheusExporterPort + i)}"
481+
else "${hostAddr}:${toString cardanoNodePrometheusExporterPort}";
480482
in {
481483
inherit metrics_path;
482484
job_name = "integrations/${serviceName i}";

flake/nixosModules/profile-grafana-alloy.nix

+2-6
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,7 @@ flake @ {moduleWithSystem, ...}: {
302302
cardanoNode = optionals (cfgSvc ? cardano-node && cfgSvc.cardano-node.enable) (map (
303303
i: let
304304
metricsPath =
305-
# Use once PrometheusSimple is available in >= node 10.3
306-
# if cfgSvc.cardano-node.useLegacyTracing || (!cfgSvc.cardano-node.useLegacyTracing && cfgSvc.cardano-node.ngTracer)
307-
if cfgSvc.cardano-node.useLegacyTracing
305+
if cfgSvc.cardano-node.useLegacyTracing || (!cfgSvc.cardano-node.useLegacyTracing && cfgSvc.cardano-node.ngTracer)
308306
then "/metrics"
309307
else "/${(cfgSvc.cardano-node.extraNodeInstanceConfig i).TraceOptionNodeName}";
310308

@@ -316,10 +314,8 @@ flake @ {moduleWithSystem, ...}: {
316314
target =
317315
if cfgSvc.cardano-node.useLegacyTracing
318316
then "${hostAddr}:${toString (cardanoNodePrometheusExporterPort + i)}"
319-
# Use once PrometheusSimple is available in >= node 10.3
320-
# else "${hostAddr}:${toString cardanoNodePrometheusExporterPort}";
321317
else if cfgSvc.cardano-node.ngTracer
322-
then "${hostAddr}:${toString 12808}"
318+
then "${hostAddr}:${toString (cardanoNodePrometheusExporterPort + i)}"
323319
else "${hostAddr}:${toString cardanoNodePrometheusExporterPort}";
324320

325321
toUnderscore = s: replaceStrings ["-"] ["_"] s;

0 commit comments

Comments
 (0)