-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
collected metric ... was collected before with the same name and label values #636
Comments
Its certainly possible, though what's supposed to happen is the metric
objects get reused when the program loads.
This error says there's two programs using the same metrics. So my guess is
a race condition during program reload, if there's a log line that matches
that coincides.
I'm away from the keyboard but will investigate further when I return. If
you'd like to follow the debugging guide in the meantime you're more than
welcome.
…On Fri, 15 Apr 2022, 07:31 MrRothstein, ***@***.***> wrote:
I'm saw this error with rc48. It went away after restart, and when I
looked at the source of the metric in question (from /json), I see two
sources from the same program (lines 1 and 11). The program is 9 lines
long... Is it possible reloading mtail using "kill -SIGHUP $(pidofproc
$PROGNAME)" caused it to load the program twice somehow?
—
Reply to this email directly, view it on GitHub
<#636>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXFX6YZ4U4S5IE3IWW7Z23VFCFDRANCNFSM5TO6B2DA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I think I see what happened. The previous version of the program did declare the same variable on line 11. So, the following appears to have happened:
Not sure if this is correct or the expected behavior |
Oh that's interesting, the variable moved places? Yes I can see how that
would trigger the error!
That's not ideal behaviour. I'll see what we can do about it and try to
preserve the intent of the check.
…On Fri, 15 Apr 2022, 09:47 MrRothstein, ***@***.***> wrote:
I think I see what happened. The previous version of the program did
declare the same variable on line 11. So, the following appears to have
happened:
1. A program declares a counter on line 11
2. Metrics are generated with the counter
3. A program is updated with a version where the variable is declared
on line 1
4. Mtail is reloaded, but metrics still include the counter sourced
from line 11
5. Metrics are generated with the counter on line 1
6. Prometheus receives 500 response trying to scrape "metric ... was
collected before with the same name and label values"
Not sure if this is correct or the expected behavior
—
Reply to this email directly, view it on GitHub
<#636 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXFX6YNHUZGUYMGWAJZT43VFCU7ZANCNFSM5TO6B2DA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This fails (adds two metrics):
It looks like the dupe check is skipped for metrics where the sources are different, but the check does not differentiate between the program being different or only the position: mtail/internal/metrics/store.go Line 56 in bba4c70
I don't see a "FromString" type function available for Position and I'm not completely sure if the source and position represent the same thing. If this is the issue, would it make sense to convert Source in Metric from string to Position and compare only the file name during the dupe check? |
I'm saw this error with rc48. It went away after restart, and when I looked at the source of the metric in question (from /json), I see two sources from the same program (lines 1 and 11). The program is 9 lines long... Is it possible reloading mtail using "kill -SIGHUP $(pidofproc $PROGNAME)" caused it to load the program twice somehow?
The text was updated successfully, but these errors were encountered: