-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add Prometheus metrics for number of log messages #65
Conversation
Added dependency using: ``` $ dep ensure github.com/marccarre/promrus@v1.0.0 && dep ensure && dep prune ```
This fixes: ``` middleware/grpc_logging.go:10:2: case-insensitive import collision: "github.com/weaveworks/common/vendor/github.com/Sirupsen/logrus" and "github.com/weaveworks/common/vendor/github.com/sirupsen/logrus" ``` Changelog: - Changed `import` statements from `Sirupsen/logrus` to `sirupsen/logrus`, as per the official documentation: https://github.com/sirupsen/logrus - Ran: ``` dep ensure && dep prune ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure about the Sirupsen case thing. I got bit by it a while ago. I suggest trying to use this branch of common
in a project with executables before merging it.
What do you mean by not sure? I initially did not realise this would lead to such changes when I added |
In any case, I'll try it against Cortex and will report back. |
Not sure as in "I did something like this a few months ago and regretted it but can't recall the details". It might well break things. |
I haven't tried on Cortex yet, but trying on a reduction of the problem (i.e. a smaller project mimicking its dependencies) shows that:
yields metrics which do not increase over time:
|
The `promrus` project's ownership has changed, and now belongs to Weaveworks. Command ran: ``` $ dep ensure github.com/weaveworks/promrus@v1.0.0 && dep ensure && dep prune ```
1270de8
to
279ce76
Compare
Why do we even want this? |
What do you mean by "this"?
Feel free to revert if causing issues though. |
@@ -27,6 +28,11 @@ func Setup(logLevel string) error { | |||
} | |||
log.SetLevel(level) | |||
log.SetFormatter(&textFormatter{}) | |||
hook, err := promrus.NewPrometheusHook() // Expose number of log messages as Prometheus metrics. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Adjust the MetricNameRE to reflect the actual behavior
Promrus is a Logrus hook to expose the number of log messages as Prometheus metrics:
Added dependency using:
Fixed casing in
logrus
imports, causing the following issue:by:
import
statements fromSirupsen/logrus
tosirupsen/logrus
, as per the official documentation, anddep ensure && dep prune
.