Skip to content
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

app/vmalert: support DNS SRV record in -remoteWrite.url #6299

Merged
merged 6 commits into from
May 22, 2024
Merged

Conversation

Haleygo
Copy link
Collaborator

@Haleygo Haleygo commented May 18, 2024

Describe Your Changes

part of #6053,
supports DNS SRV address in -remoteWrite.url command-line option.

Checklist

The following checks are mandatory:

@Haleygo Haleygo requested review from valyala and hagen1778 May 18, 2024 09:07
// and register stats metrics for conns.
func GetStatDialFunc(metricPrefix string) func(ctx context.Context, network, addr string) (net.Conn, error) {
metricSetRegister.Do(func() {
dialsTotal = metrics.NewCounter(fmt.Sprintf(`%s_dials_total`, metricPrefix))
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need custom metric name for each component?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not? I think it is useful to have these metrics, unless they start to collide.

Copy link
Contributor

Choose a reason for hiding this comment

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

imho finding needed data on grafana is easier, when you have a static metric name with different label values

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think differently, when you know which metric you wanna use, having different metricName or different labels with same metricName are the same.
But when you can't remember the exact metricName, using auto-complete, having specific metricName prefix like remotewrite or remoteread can help to find metrics that component exposes for specific feature.

Copy link
Collaborator

@hagen1778 hagen1778 left a comment

Choose a reason for hiding this comment

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

Would be nice to add few lines to vmalert docs about this new feature, besides flag description update.

app/vmalert/remotewrite/init.go Show resolved Hide resolved
// and register stats metrics for conns.
func GetStatDialFunc(metricPrefix string) func(ctx context.Context, network, addr string) (net.Conn, error) {
metricSetRegister.Do(func() {
dialsTotal = metrics.NewCounter(fmt.Sprintf(`%s_dials_total`, metricPrefix))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not? I think it is useful to have these metrics, unless they start to collide.

lib/httputils/statconn.go Show resolved Hide resolved
@Haleygo
Copy link
Collaborator Author

Haleygo commented May 20, 2024

Would be nice to add few lines to vmalert docs about this new feature, besides flag description update.

I think flag description is pretty clear for vmalert here, since DNS SRV record is a common term and extra chapter in doc won't contain any extra message.
vmagent has one, I suppose it's mostly a tip for non-flag usages.

@Haleygo Haleygo requested a review from hagen1778 May 20, 2024 18:10
Copy link
Collaborator

@hagen1778 hagen1778 left a comment

Choose a reason for hiding this comment

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

Thanks! Please see my comments and a follow-up commit 4d9d6d7. Would appreciate your opinion on it

dashboards/vmalert.json Show resolved Hide resolved
docs/CHANGELOG.md Outdated Show resolved Hide resolved
docs/vmalert.md Show resolved Hide resolved
lib/httputils/statconn.go Outdated Show resolved Hide resolved
@Haleygo Haleygo force-pushed the gh-6053 branch 3 times, most recently from 8e2b71d to 691bf6f Compare May 21, 2024 14:32
Signed-off-by: hagen1778 <roman@victoriametrics.com>
Copy link
Collaborator

@hagen1778 hagen1778 left a comment

Choose a reason for hiding this comment

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

LGTM

@hagen1778 hagen1778 merged commit d7b5062 into master May 22, 2024
7 checks passed
@hagen1778 hagen1778 deleted the gh-6053 branch May 22, 2024 08:52
hagen1778 pushed a commit that referenced this pull request May 22, 2024
part of #6053,
supports [DNS SRV](https://en.wikipedia.org/wiki/SRV_record) address in
`-remoteWrite.url` command-line option.

(cherry picked from commit d7b5062)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants