Skip to content

Commit

Permalink
joins working
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayko001 committed Oct 4, 2023
1 parent 981af9b commit 3fff1db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@ options (
object 'metric_values'
);
```
SELECT * FROM metric_values WHERE metric_time > 1696046400 AND metric_time < 1696132800;
SELECT * FROM metric_values WHERE metric_time > 1696046400 AND metric_time < 1696132800;

SELECT
label.metric_name AS metric_label,
value.metric_time,
value.metric_value
FROM
metric_labels AS label
JOIN
metric_values AS value
ON
label.metric_id = value.metric_id
WHERE
label.metric_name = 'container_threads' AND
value.metric_time < 1696046400 AND value.metric_time > 1696132800;
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ impl PrometheusFdw {
if let Some(metric_name_qual) = metric_name_filter {
let metric_name = Self::value_to_promql_string(&metric_name_qual.value);
let ret = format!("{}?query={}", base_url, metric_name);
warning!("ret: {}", ret);
warning!("inside metric_labels");
warning!("Constructed URL: {}", ret);
ret
} else {
println!("No metric_name filter found in quals");
Expand All @@ -254,7 +255,8 @@ impl PrometheusFdw {
"{}_range?query=container_threads&start={}&end={}&step=1m",
base_url, lower_timestamp, upper_timestamp
);
println!("Constructed URL: {}", ret); // Add logging here
warning!("inside metric_values");
warning!("Constructed URL: {}", ret);
ret
} else {
println!("Timestamp filters not found in quals");
Expand Down Expand Up @@ -284,8 +286,6 @@ impl ForeignDataWrapper for PrometheusFdw {
let client = reqwest::Client::new();
ret.client = Some(client);

warning!("created client");

ret
}

Expand Down

0 comments on commit 3fff1db

Please sign in to comment.