Skip to content

feat: enhance target up metric#737

Merged
karimra merged 3 commits intoopenconfig:mainfrom
senthilsam:fix/enhance_target_up
Sep 19, 2025
Merged

feat: enhance target up metric#737
karimra merged 3 commits intoopenconfig:mainfrom
senthilsam:fix/enhance_target_up

Conversation

@senthilsam
Copy link
Contributor

Currently target_up metric is 1 even when the connection failed because of auth issues

So I have made changes to reflect with grpc connection states, with one minor change, even from grpc Ready=2, i have kept ready as 1 so our users will still see target_up =1 when the target is actually up

const (
	// Idle indicates the ClientConn is idle.
	Idle [State](https://pkg.go.dev/google.golang.org/grpc/connectivity#State) = [iota](https://pkg.go.dev/builtin#iota)
	// Connecting indicates the ClientConn is connecting.
	Connecting
	// Ready indicates the ClientConn is ready for work.
	Ready
	// TransientFailure indicates the ClientConn has seen a failure but expects to recover.
	TransientFailure
	// Shutdown indicates the ClientConn has started shutting down.
	Shutdown
)

@karimra
Copy link
Collaborator

karimra commented Sep 15, 2025

I'm not sure it's a good idea to modify the existing metric. The intent behind it is to indicate if a target "exists" or not.
Instead I would add a new metric called target_connection_state that reflects the different gRPC connection states.

@karimra karimra changed the title fix: enhance target up metric feat: enhance target up metric Sep 15, 2025
@senthilsam
Copy link
Contributor Author

thanks, made the changes

@senthilsam
Copy link
Contributor Author

@karimra can you please review this.
Also, when is the next release planned??

@karimra
Copy link
Collaborator

karimra commented Sep 18, 2025

Thanks for making the changes!

@karimra karimra merged commit cbfe76f into openconfig:main Sep 19, 2025
2 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.

2 participants