Skip to content

Commit 06e4f74

Browse files
committed
Updated Scope Reference Handling
1 parent 13cbebc commit 06e4f74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/prometheus/scope.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,6 @@ end
200200
function Scope:addChild(scope)
201201
-- This will add all References from that Scope to higher Scopes. Note that the higher scopes may only be global
202202
for scope, ids in pairs(scope.variablesFromHigherScopes) do
203-
if not scope.isGlobal then
204-
logger:error("Tried to Add Child that is referencing a Higher non global variable!");
205-
end
206203
for id, count in pairs(ids) do
207204
if count and count > 0 then
208205
self:addReferenceToHigherScope(scope, id, count);
@@ -240,6 +237,9 @@ end
240237
function Scope:addReferenceToHigherScope(scope, id, n, b)
241238
n = n or 1;
242239
if self.isGlobal then
240+
if not scope.isGlobal then
241+
logger:error(string.format("Could not resolve Scope \"%s\"", scope.name))
242+
end
243243
return
244244
end
245245
if scope == self then

0 commit comments

Comments
 (0)