-
-
Notifications
You must be signed in to change notification settings - Fork 120
feat: warp10 exporter #76
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
Conversation
|
That's sounds good to me so far. But I have only done a quick review. As proposed in the rieman client MR:
I had a lack of time to propose something here. :( Basically, we are doing almost the same stuffs in prom, riemann and warp10 exporters. This led to duplicated code and long methods so errors . If it is possible for you, we could do a pair programming session to get rid of this issue. I think it will be the fastest way to progress on this. |
| let minor_version = version_parts.next().unwrap(); | ||
| format!("{}.{}{}", major_version, patch_version, minor_version) | ||
| } | ||
| // Copyright 2020 The scaphandre authors. |
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.
Oh great to add the licence !
| ExporterOption { | ||
| default_value: None, | ||
| help: String::from("Time step between measurements, in seconds."), | ||
| long: String::from("qemu"), |
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.
Hum I guess there is an issue in the option name, or more likely this option is not required.
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've not yet pushed the code attached to it, sorry :)
I'm actually using it in the exporter (and I'm currently trying to fix some issues related to the label resulting from it)
| takes_value: true, | ||
| }, | ||
| ); | ||
| options.insert( |
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.
Not really fan of this option, I would merge with the host one and create an url option maybe.
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've done it like that because another option to send data to warp10 is websockets. Because the uri for that would look like ws://host/api/v0...
I thought it would be cleaner to have a separate variable to manage the protocol. 🤔
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.
Make sens in that case.
src/exporters/riemann.rs
Outdated
| topo_procs_len, | ||
| ); | ||
|
|
||
| //TODO: metric sent twice ? |
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.
Yep looks like it is the case :)
src/exporters/riemann.rs
Outdated
| socket.stat_buffer.len(), | ||
| ); | ||
|
|
||
| //TODO: fix metric |
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.
Maybe provide a bit more details here.
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.
Here the value is socket.stat_buffer.len() for both scaph_self_socket_stats_nb and scaph_self_socket_records_nb.
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.
yep pitfall here. :(
| None | ||
| } | ||
|
|
||
| pub fn get_scaphandre_version() -> String { |
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.
👍
| takes_value: true, | ||
| }, | ||
| ); | ||
| options.insert( |
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.
Hum i guess it is a secret. I think it is "safer" to pass it in a file and not cmdline.
We may allow to pass it from cmdline with a warning saying it is dangerous.
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.
You're right, it's a very dumb way to do it. I've done it like that first to bootstrap the feature quickly. I'll fix that prior merging.
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 an env var and a file option could be nice. An env var will probably make it easier to integrate with docker, k8s secrets.
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've added the env var option, let's create the file option when someone asks for it explicitely :)
| None, | ||
| String::from("scaph_self_version"), | ||
| labels.clone(), | ||
| warp10::Value::Double(scaphandre_version.parse::<f64>().unwrap()), |
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.
Another thing we could factorize maybe. Maybe, we could leverage the Metric trait to send something whatever the type it will select the appropriate method (Double, Long, ...).
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 you have a point here. This would be much cleaner. I don't yet imagine how it would integrate with the warp10 lib however.
|
You should prefix the MR with |
Thanks a lot !
I agree, it would be much cleaner.
Great idea, let's discuss about a meeting schedule that fits both of our agendas to work on that :) |
|
|
||
| ## Metrics exposed | ||
|
|
||
| Typically the Warp10 exporter is working in the same way as the riemann exporter regarding metrics. Please look at details in [Prometheus exporter](exporter-prometheus.md) documentations to get the extensive list of metrics available. No newline at end of file |
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.
Typically the Warp10 exporter is working in the same way as the prometheus and riemann exporters regarding metrics.
…g/scaphandre into feature/fr-#22-warp10-exporter
Work in progress for #22