Skip to content

pkg/services/orgresolver: track pass/fail metrics#2099

Open
jmank88 wants to merge 1 commit into
mainfrom
CRE-3887-org-resolver-metrics
Open

pkg/services/orgresolver: track pass/fail metrics#2099
jmank88 wants to merge 1 commit into
mainfrom
CRE-3887-org-resolver-metrics

Conversation

@jmank88

@jmank88 jmank88 commented May 28, 2026

Copy link
Copy Markdown
Contributor

https://smartcontract-it.atlassian.net/browse/CRE-3887
Support passing a metric.Meter to the org resolver to report pass/fail metrics.

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (3)

pkg/services/orgresolver.(*Config) (1)
  • New — ➕ Added
pkg/services/orgresolver.Config (2)
  • Client — ➕ Added

  • Meter — ➕ Added


📄 View full apidiff report

Comment thread pkg/services/orgresolver/linking.go Outdated
resp, err := o.client.GetOrganizationFromWorkflowOwner(ctx, req)
if err != nil {
if o.failCount != nil {
o.failCount.Add(ctx, 1) //TODO owner attribute?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are owner attributes helpful? Or just noise with extra cardinality?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good q, they are helpful. we generally pass a labeler around in the engine to have KV attributes we want. The potential problem is that we can't have high cardinality values, for instance WorkflowExecutionID. So to give clients the option, we could define a map on Config that is optional for clients creating an org resolver.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But do we actually expect the information to be relevant? I wouldn't think problems at this level would be correlated with particular owners. (and even if they were, that would imply the requests are being received by the server, who should be reporting better information than we can as clients?)

return cfg.New(logger)
}

func (cfg *Config) New(logger log.Logger) (*orgResolver, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why the indirection with exporting New over *Config vs just calling into the exported NewOrgResolverWithClient? The old pattern better supported testing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a new field Meter metric.Meter. The XWithY suffix pattern doesn't scale. Why is testing more difficult?

Comment thread pkg/services/orgresolver/linking.go Outdated
Comment thread pkg/services/orgresolver/linking.go Outdated
resp, err := o.client.GetOrganizationFromWorkflowOwner(ctx, req)
if err != nil {
if o.failCount != nil {
o.failCount.Add(ctx, 1) //TODO owner attribute?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good q, they are helpful. we generally pass a labeler around in the engine to have KV attributes we want. The potential problem is that we can't have high cardinality values, for instance WorkflowExecutionID. So to give clients the option, we could define a map on Config that is optional for clients creating an org resolver.

@jmank88 jmank88 force-pushed the CRE-3887-org-resolver-metrics branch from add60e6 to 26a44e8 Compare June 9, 2026 12:43
@jmank88 jmank88 marked this pull request as ready for review June 9, 2026 12:43
@jmank88 jmank88 requested a review from a team as a code owner June 9, 2026 12:43
@jmank88 jmank88 requested a review from patrickhuie19 June 9, 2026 12:44
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