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

fix(inputs.gnmi): Register connection statistics before creating client #16171

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Mrflatt
Copy link
Contributor

@Mrflatt Mrflatt commented Nov 9, 2024

Summary

Now gnmi selfstat does not report status of connection if setup of subscription fails. This makes harder to check all hosts statuses, when they are missing from selfstat. We are using internal plugin to see failures on grpc status, and some host are missing cause subscription fails and self stat is never reported.

Also changed selfstat source to be same as in other metrics, don't know if this is ok to do :)

Checklist

  • No AI generated code was used in this PR

Related issues

@telegraf-tiger telegraf-tiger bot added area/gnmi feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Nov 9, 2024
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @Mrflatt! Just one question if we still need the address in the handler... Otherwise the code looks good.

Comment on lines 281 to 282
address: addr,
host: host,
Copy link
Member

Choose a reason for hiding this comment

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

Do we need the address in the handler then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No if I add port also to handler, is that better? To drop address and add host + port, as client, err := grpc.NewClient(h.address, opts...) still needs host + port

Copy link
Contributor Author

@Mrflatt Mrflatt Nov 11, 2024

Choose a reason for hiding this comment

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

dropped address and added port to handler and joining address from it, before connecting

@srebhan srebhan changed the title feat(inputs.gnmi): add connection selfstat status before creating client fix(inputs.gnmi): Register connection statistics before creating client Nov 11, 2024
@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Nov 11, 2024
@srebhan srebhan removed the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Nov 11, 2024
@Mrflatt Mrflatt force-pushed the gnmi-connection-status branch 4 times, most recently from 4e23111 to bd0f82a Compare November 11, 2024 15:19
Now selfstat does not report status of connection if setup of subscription fails.
This makes harder to check all hosts statuses, when host count per telegraf is high.
@telegraf-tiger
Copy link
Contributor

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @Mrflatt!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 12, 2024
@DStrand1 DStrand1 merged commit e5e52f0 into influxdata:master Nov 12, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.32.3 milestone Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gnmi fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants