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

Handle HTTP 304s when setting span status #121

Merged
merged 4 commits into from
Jul 7, 2023
Merged

Handle HTTP 304s when setting span status #121

merged 4 commits into from
Jul 7, 2023

Conversation

akshayjshah
Copy link
Member

@akshayjshah akshayjshah commented Jul 6, 2023

If the RPC is using the Connect protocol and returns a not modified
error, we shouldn't set the span status to error. Follow-up to #120.

If the RPC is using the Connect protocol and returns a not modified
error, we shouldn't set the span status to error.
@joshcarp
Copy link
Contributor

joshcarp commented Jul 6, 2023

This also brings up the problem that ~3 months ago there was a breaking change to how grpc span statuses are set in the opentelemetry specification: open-telemetry/opentelemetry-specification#3333

Table as follows:

gRPC Status Code SpanKind.SERVER Span Status SpanKind.CLIENT Span Status
OK unset unset
CANCELLED unset Error
UNKNOWN Error Error
INVALID_ARGUMENT unset Error
DEADLINE_EXCEEDED Error Error
NOT_FOUND unset Error
ALREADY_EXISTS unset Error
PERMISSION_DENIED unset Error
RESOURCE_EXHAUSTED unset Error
FAILED_PRECONDITION unset Error
ABORTED unset Error
OUT_OF_RANGE unset Error
UNIMPLEMENTED Error Error
INTERNAL Error Error
UNAVAILABLE Error Error
DATA_LOSS Error Error
UNAUTHENTICATED unset Error

@jhump
Copy link
Member

jhump commented Jul 6, 2023

@akshayjshah, I pushed a commit with a test.

@joshcarp, maybe file that as a separate issue? Maybe we can address that in subsequent PR -- and maybe even subsequent release? Ideally, we'd get this fix out soon since the current release is causing unnecessary alerts in the BSR.

Copy link
Member

@jhump jhump left a comment

Choose a reason for hiding this comment

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

LGTM. You may want to take a look at my test and revise if you see a better way to do this (or are unhappy with the buf lint exclusions I added).

@akshayjshah
Copy link
Member Author

Thanks for the test case, @jhump! I pushed a small change to make the Ping method idempotent rather than introducing a new one, but the test logic itself looks great.

@akshayjshah akshayjshah merged commit e89c998 into main Jul 7, 2023
@akshayjshah akshayjshah deleted the ajs/304 branch July 7, 2023 21:41
renovate bot referenced this pull request in open-feature/flagd Jul 8, 2023
… to v0.4.0 (#739)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/bufbuild/connect-opentelemetry-go](https://togithub.com/bufbuild/connect-opentelemetry-go)
| require | minor | `v0.3.0` -> `v0.4.0` |

---

### Release Notes

<details>
<summary>bufbuild/connect-opentelemetry-go
(github.com/bufbuild/connect-opentelemetry-go)</summary>

###
[`v0.4.0`](https://togithub.com/bufbuild/connect-opentelemetry-go/releases/tag/v0.4.0)

[Compare
Source](https://togithub.com/bufbuild/connect-opentelemetry-go/compare/v0.3.0...v0.4.0)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Enhancements

- Add option to omit trace events for unary RPCs by
[@&#8203;jipperinbham](https://togithub.com/jipperinbham) in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/98](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/98)
- Make option to omit trace events apply to streaming RPCs by
[@&#8203;joshcarp](https://togithub.com/joshcarp) in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/123](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/123)

##### Bugfixes

- Set status codes properly for HTTP 304s by
[@&#8203;jhump](https://togithub.com/jhump) in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/120](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/120)
- Set span status properly for HTTP 304s by
[@&#8203;akshayjshah](https://togithub.com/akshayjshah) in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/121](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/121)
- Update studio URL in README by
[@&#8203;pkwarren](https://togithub.com/pkwarren) in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/124](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/124)

##### Other changes

- Tighten internal linting for import aliases by
[@&#8203;zchee](https://togithub.com/zchee) in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/116](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/116)

#### New Contributors

- [@&#8203;jhump](https://togithub.com/jhump) made their first
contribution in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/120](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/120)
- [@&#8203;jipperinbham](https://togithub.com/jipperinbham) made their
first contribution in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/98](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/98)
- [@&#8203;pkwarren](https://togithub.com/pkwarren) made their first
contribution in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/124](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/124)
- [@&#8203;zchee](https://togithub.com/zchee) made their first
contribution in
[https://github.com/bufbuild/connect-opentelemetry-go/pull/116](https://togithub.com/bufbuild/connect-opentelemetry-go/pull/116)

**Full Changelog**:
bufbuild/connect-opentelemetry-go@v0.3.0...v0.4.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-feature/flagd).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNTkuNyIsInVwZGF0ZWRJblZlciI6IjM1LjE1OS43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
akshayjshah added a commit that referenced this pull request Jul 26, 2023
If the RPC is using the Connect protocol and returns a not modified
error, we shouldn't set the span status to error. Follow-up to #120.

---------

Co-authored-by: Josh Humphries <2035234+jhump@users.noreply.github.com>
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