-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(new source): New prometheus_remote_write source #5144
Conversation
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
…rite-source Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
…rite-source Signed-off-by: Bruce Guenter <bruce@timber.io>
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.
Regarding names, it is a bit confusing with what's the difference between the two prometheus sources, this also applies to their sinks, so we can use the naming to clarify this a bit. It seams that their differentiating feature is if it's push/pull or serving/accepting based, so what about using that in names, ex. :
prometheus_pull
for oldprometheus
sourceprometheus_push
forprometheus_remote_write
sinkprometheus_serve
forprometheus_exporter
sinkprometheus_accept
forprometheus_remote_write
source
@ktff we landed on:
We're trying to use known Prometheus terms. "remote_write" and "exporter" are the standard terms for each Prometheus protocol. |
Ping @lukesteensen @JeanMertz @lucperkins Could I get another review on this? |
Signed-off-by: Bruce Guenter <bruce@timber.io>
…rite-source Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
…rite-source Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
…rite-source Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
message = "No path is set on the endpoint and we got a parse error, did you mean to use /metrics? This behavior changed in version 0.11.", | ||
endpoint = %url | ||
); | ||
} |
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.
Has the formatting messed up here?
I'm surprised the CI doesn't seem to have caught it.
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.
rustfmt
occasionally gives up in the presence of macros and leaves code un-reformatted. It's quite frustrating.
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.
In any case, that code should be unchanged since it's just a rename. I'm not sure why GitHub is showing it as a separate add.
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.
Nice work! I left a few in-line comments, but nothing strictly blocking.
Cargo.toml
Outdated
@@ -335,7 +335,7 @@ sources-kubernetes-logs = ["kubernetes", "transforms-merge", "transforms-regex_p | |||
sources-logplex = ["sources-utils-http"] | |||
sources-mongodb_metrics = ["mongodb"] | |||
sources-nginx_metrics = [] | |||
sources-prometheus = ["prometheus-parser"] | |||
sources-prometheus = ["prometheus-parser", "snap", "sources-utils-http", "warp"] |
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 think I would prefer to have sources-prometheus_scrape
and sources-promotheus_remote_write
as separate features. This would be:
- Consistent with the rest of the sources list
- Allow easily building just one of the components without the features needed of the other
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.
OTOH there are several interrelated sinks that have a single feature flag: sinks-gcp
and sinks-influxdb
(and I added sinks-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.
🤔 I see. I feel like I'd prefer to see those ones split up too, but we can punt on that.
@@ -97,6 +97,69 @@ impl InternalEvent for PrometheusHttpError { | |||
} | |||
} | |||
|
|||
#[derive(Debug)] | |||
pub struct PrometheusRemoteWriteParseError { |
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.
Nit: I might put these events in separate modules for each source.
@@ -6,8 +6,10 @@ mod tcp; | |||
#[cfg(all(unix, feature = "sources-utils-unix",))] | |||
mod unix; | |||
|
|||
#[cfg(any(feature = "sources-http", feature = "sources-logplex"))] |
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.
As mentioned above, we could choose to support this feature with this source. That would alleviate the need to conditionally compile it here.
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
* Rename prometheus source to prometheus_scrape (with alias) * Move prometheus shared bits to top level * Add prometheus remote_write source * Unify all the TLS test settings * Add documentation alias for renamed prometheus_exporter sink Signed-off-by: Bruce Guenter <bruce@timber.io> Signed-off-by: Brian Menges <brian.menges@anaplan.com>
I think this is code complete, but I have a couple of questions about non-code bits:
I renamed the existing
prometheus
source toprometheus_metrics
to disambiguate it from thisprometheus_remote_write
source. I really don't like this choice of name but couldn't think of anything more descriptive. I encourage suggestions so I can improve it.The
output
stanza of the cue file is almost certainly wrong. This source translates all input metrics into gauges, unless they are named*_total
in which case they are interpreted as counters. Help with encoding that into the metadata would be appreciated.Closes #4697
Signed-off-by: Bruce Guenter bruce@timber.io