Skip to content

Conversation

@tacho
Copy link
Contributor

@tacho tacho commented Aug 18, 2023

Currently the exporter only supports lines, which breaks byte-oriented protocols such as the PostgreSQL StartTLS handshake.

We also give a working example for Postgres in the sample configuration.

Fixes: #801

@tacho tacho force-pushed the fix-postgres-tls-probes branch from 21d61c5 to ac9bb34 Compare August 18, 2023 07:43
@Raymondmax
Copy link

Is there any ETA for this PR merge?

@tacho
Copy link
Contributor Author

tacho commented Oct 27, 2023

I was wondering the same - it's been two months without any reaction. Is this project dead, or abandoned?

@rj-home
Copy link

rj-home commented Dec 5, 2023

+1 on this PR, we have the same issue which will be fixed after the merge

@freeyoung
Copy link

+1 on this PR too, would be nice to have this builtin

@sonman
Copy link

sonman commented May 27, 2024

+1 if we can use blackbox exporter also for postgres

@SuperQ SuperQ requested review from electron0zero and mem May 27, 2024 09:48
@Raymondmax
Copy link

FYI, here's a demo code to get Postgres cert info via TrustManager when connecting to the server

https://github.com/Raymondmax/PostgresCert/blob/main/main.java

Currently the exporter only supports lines, which breaks byte-oriented
protocols such as the PostgreSQL StartTLS handshake.

We also give a working example for Postgres in the sample configuration.

Signed-off-by: Stanislav Grozev <[email protected]>
@tacho tacho force-pushed the fix-postgres-tls-probes branch from ac9bb34 to 6cd70e8 Compare July 23, 2024 11:24
@electron0zero electron0zero requested a review from SuperQ July 23, 2024 15:59
probeFailedDueToRegex.Set(0)
send = string(qr.Expect.Regexp.Expand(nil, []byte(send), scanner.Bytes(), match))
}
if qr.ExpectBytes != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks OK to me.

I would prefer to have stronger validation in the configuration, because as this section of the code shows, it's possible to specify both a regular expression and the sequence of bytes to be read, and I'm not sure how that's going to play together. If you think specifying both at the same time makes sense, I would like to see an example (and also a test).

My hunch is that it has to be either the regular expression or the specific sequence of bytes, but not both at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense it would be one or the other - protocols are either line oriented or not. I'll adjust the patch soon.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be awesome if we get this MR merged and release :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also want expect and expect_bytes to be mutually exclusive.

protocols are either line oriented or not. I'll adjust the patch soon.

@tacho is this done? I am happy to give it another review once the comments are addressed.

@gartemiev
Copy link

Any update on this?

@dtseiler
Copy link

dtseiler commented Dec 5, 2024

+1 would be great to be able to check my PG cert expiry via blackbox_exporter

probeFailedDueToRegex.Set(0)
send = string(qr.Expect.Regexp.Expand(nil, []byte(send), scanner.Bytes(), match))
}
if qr.ExpectBytes != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also want expect and expect_bytes to be mutually exclusive.

protocols are either line oriented or not. I'll adjust the patch soon.

@tacho is this done? I am happy to give it another review once the comments are addressed.

[ source_ip_address: <string> ]
# The query sent in the TCP probe and the expected associated response.
# expect_bytes does exact byte-by-byte match.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we mention that expect and expect_bytes are mutually exclusive?

we do mention it for body and body_file in http_probe, and few other places.

@electron0zero
Copy link
Member

electron0zero commented Feb 26, 2025

@tacho gentle ping, we would love to get this merged but review comments need to be addressed. it also need a rebased due to merged conflicts.

Copy link

@simskij simskij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tacho @electron0zero - just had a look at this and looks fine to me as soon as the comments have been addressed. if @tacho is not interested in driving this across the finish line, we might be able to contribute the delta from the canonical observability team, as this is a bug fix we know multiple of our users are eagerly awaiting.

@electron0zero
Copy link
Member

electron0zero commented Oct 29, 2025

we might be able to contribute the delta from the canonical observability team, as this is a bug fix we know multiple of our users are eagerly awaiting.

@simskij I am happy to take some time out and review a PR to push this over finish line, I am reviewing #1441 right now 🙏🏼

@electron0zero
Copy link
Member

I did a review of #1441, and I am looking to merge #1441 because that PR is addressing the comments left in this PR's review.

I will go ahead and close this PR to avoid confusion, please chime in #1441 if you have any comments or questions 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to scrape Postgres cert metrics