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

chore: Add flag to skip legacy duplicate telemetry #630

Merged

Conversation

kavirajk
Copy link
Contributor

@kavirajk kavirajk commented Dec 9, 2024

Currently we have some legacy metrics with peer_id in the metrics suffix (in addition to same metrics with peer_idd as label)

  1. raft_replication_appendEntries_rpc_peer0
  2. raft_replication_appendEntries_logs_peer0
  3. raft_replication_heartbeat_peer0
  4. raft_replication_installSnapshot_peer0

These metrics may have additional _count or _sum metrics. And each metrics are multiplicative. Meaning if I have 10 peers, these metrics will be 10x.

This PR adds a flag noLegacyTelemetry (default: false) which by setting to true you can skip those duplicate metrics.

Before (weaviate_internal is some custom prefix)

Screenshot 2024-12-09 at 23 37 21

After

Screenshot 2024-12-09 at 23 28 28

Currently we have some legacy metrics with `peer_id` in the metrics suffix (in addition to same metrics with `peer_id`d as label)
1. `raft_replication_appendEntries_rpc_peer0`
2. `raft_replication_appendEntries_logs_peer0`
3. `raft_replication_heartbeat_peer0`
4. `raft_replication_installSnapshot_peer0`

These metrics may have additional `_count` or `_sum` metrics. And each metrics are multiplicative. Meaning if I have 10 peers, these metrics will be 10x.

This PR adds a flag `noLegacyTelemetry` (default: false) which by setting to `true` you can skip those duplicate metrics.

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
@kavirajk kavirajk requested review from a team as code owners December 9, 2024 23:00
@kavirajk kavirajk requested a review from skpratt December 9, 2024 23:00
Copy link

hashicorp-cla-app bot commented Dec 9, 2024

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
pkazmierczak
pkazmierczak previously approved these changes Dec 12, 2024
Copy link
Contributor

@pkazmierczak pkazmierczak left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @kavirajk. Mind adding a changelog entry?

api.go Outdated Show resolved Hide resolved
config.go Outdated Show resolved Hide resolved
Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Thanks @kavirajk this is a useful addition and something we have not gotten around to doing for way to long 😅 .

I made one super minor request that doesn't impact behavior. I think @pkazmierczak also requested a changelog update which is hopefully simple.

If you're able to do those I think we'd be good to merge this. If not we can probably take care of that in a spare minute, but I'm a fan of commits/attribution staying with the person who did the hard work if possible!

// NoLegacyTelemetry allow to skip the legacy metrics to avoid duplicates.
// legacy metrics are which has `_peer_name` as metric suffix instead as labels.
// e.g: raft_replication_heartbeat_peer0
NoLegacyTelemetry bool
Copy link
Member

Choose a reason for hiding this comment

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

Minor thing, but we'd prefer to move this above the private internal-only skipStartup option. We typically keep these internal-only details grouped at the end of the struct just to make it clearer at a glance which configs are public.

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
@kavirajk
Copy link
Contributor Author

@banks @pkazmierczak thanks for the review :) Addressed the comments.

Copy link
Contributor

@pkazmierczak pkazmierczak left a comment

Choose a reason for hiding this comment

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

Minor suggestion about the phrasing of the changelog entry, but otherwise lgtm!

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Piotr Kazmierczak <470696+pkazmierczak@users.noreply.github.com>
Copy link
Contributor

@pkazmierczak pkazmierczak left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution @kavirajk!

@pkazmierczak pkazmierczak merged commit a5bc06c into hashicorp:main Dec 12, 2024
12 checks passed
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.

3 participants