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

Error source handler middleware #1101

Merged
merged 9 commits into from
Oct 15, 2024
Merged

Conversation

marefr
Copy link
Contributor

@marefr marefr commented Oct 3, 2024

Adds an error source handler middleware that can be used both within the SDK and in Grafana.

Still left to share the error source handler middleware logic with the existing auto instrumentation in https://github.com/grafana/grafana-plugin-sdk-go/blob/main/backend/adapter_utils.go and https://github.com/grafana/grafana-plugin-sdk-go/blob/main/backend/data_adapter.go.

Ref #1082

@marefr marefr self-assigned this Oct 3, 2024
@marefr marefr force-pushed the autoinstrumentation_enhancements branch from 309bfc7 to b95ac03 Compare October 3, 2024 09:23
@marefr marefr changed the title Error source middleware Error source handler middleware Oct 7, 2024
@marefr marefr marked this pull request as ready for review October 8, 2024 20:41
@marefr marefr requested a review from a team as a code owner October 8, 2024 20:41
@marefr marefr requested review from wbrowne, andresmgot, xnyo and ivanahuckova and removed request for a team October 8, 2024 20:41
Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

Not an expert in the topic but code-wise LGTM

Copy link
Member

@ivanahuckova ivanahuckova left a comment

Choose a reason for hiding this comment

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

Nice! Great job @marefr.

require.Equal(t, tc.expErrorSource, ss)
})
}
})

t.Run("QueryData response without valid error source error should set error source", func(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@wbrowne wbrowne left a comment

Choose a reason for hiding this comment

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

Just a few things

@marefr marefr merged commit 0afdd23 into main Oct 15, 2024
2 of 3 checks passed
@marefr marefr deleted the autoinstrumentation_enhancements branch October 15, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

5 participants