-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 reader factory and config #3049
Add Prometheus metrics reader factory and config #3049
Conversation
Signed-off-by: albertteoh <albert.teoh@logz.io>
Codecov Report
@@ Coverage Diff @@
## master #3049 +/- ##
==========================================
+ Coverage 95.98% 96.03% +0.04%
==========================================
Files 225 229 +4
Lines 9891 9937 +46
==========================================
+ Hits 9494 9543 +49
+ Misses 327 325 -2
+ Partials 70 69 -1
Continue to review full report at Codecov.
|
pkg/prometheus/config/config.go
Outdated
|
||
import "time" | ||
|
||
// Configuration describes the options to customize the storage behavior |
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.
// Configuration describes the options to customize the storage behavior | |
// Configuration describes the options to customize the storage behavior. |
plugin/metrics/factory.go
Outdated
case prometheusStorageType: | ||
return prometheus.NewFactory(), nil | ||
} | ||
return nil, fmt.Errorf("unknown metrics type %s. Valid types are %v", factoryType, AllStorageTypes) |
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.
return nil, fmt.Errorf("unknown metrics type %s. Valid types are %v", factoryType, AllStorageTypes) | |
return nil, fmt.Errorf("unknown metrics type %q. Valid types are %v", factoryType, AllStorageTypes) |
plugin/metrics/factory.go
Outdated
func (f *Factory) CreateMetricsReader() (metricsstore.Reader, error) { | ||
factory, ok := f.factories[f.MetricsStorageType] | ||
if !ok { | ||
return nil, fmt.Errorf("no %s backend registered for metrics store", f.MetricsStorageType) |
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.
return nil, fmt.Errorf("no %s backend registered for metrics store", f.MetricsStorageType) | |
return nil, fmt.Errorf("no %q backend registered for metrics store", f.MetricsStorageType) |
) | ||
|
||
const ( | ||
suffixHostPort = ".host-port" |
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.
Please, tell me that the next change is about adding TLS support to the communication with Prometheus :-)
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.
Ah yes, thanks :) I've added it to the checklist.
Signed-off-by: albertteoh <albert.teoh@logz.io>
Thanks @jpkrohling! |
Which problem is this PR solving?
Short description of the changes