Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,16 @@ Open Telemetry spans are nested and can have attributes attached to each span. T
"com.microsoft.kiota.handler.decompression.enable": "boolean, true if the handler is present and enabled",
"ParametersNameDecodingHandler_intercept?": {
"com.microsoft.kiota.handler.parameters_name_decoding.enable": "boolean, true if the handler is present and enabled",
"Request_transport?": {
// this span is present only to measure network latency and deduct it from the middleware pipeline
"SunsetHandler_intercept?": {
"com.microsoft.kiota.handler.sunset.enable": "boolean, true if the handler is present and enabled",
"Event - com.microsoft.kiota.sunset_header_received?": {
// raised only if a sunset header is present in the response
"sunset_date": "Date at internet date format from the sunset header value",
"sunset_link?": "link header with a sunset value for rel (only the URI)"
},
"Request_transport?": {
// this span is present only to measure network latency and deduct it from the middleware pipeline
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This repository holds documents related to current and on-going work on Microsof
| | Connection Management | | | | | |
| | Long Running Operations | | | | | |
| | Chaos Handler | |[✓][java_chaoshandler] |O| | |
| | [Sunset Handler](middleware/SunsetHandler.md) |
| | Service Discovery Handler | | | | | |
| [Content](content/ContentArchitecturalConstraints.md)
|| [Batch Request Content](content/BatchRequestContent.md) |[✓][dotnet_batchrequestcontent]|[✓][java_batchrequestcontent]|[✓][js_batchrequestcontent]| | |
Expand Down
5 changes: 3 additions & 2 deletions middleware/RetryHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Objectives

Provide a reusuable component that provides application developers with effective handling of failed requests that can be retried.
Provide a reusable component that provides application developers with effective handling of failed requests that can be retried.

## Requirements

Expand Down Expand Up @@ -45,7 +45,8 @@ The thread processing a request should not be blocked while waiting for a retry
[Graph Throttling](https://developer.microsoft.com/en-us/graph/docs/concepts/throttling)

## Open Issues

- New requests made while an existing request has been queued for retry, should be considered for adding to the queue.
- Requests with the exact same URL should be queued.
- Requests with the same path should be queued.
- Requests with n matching initial segments should be queued after 5-n throtted requests. e.g. If a there have been 3 throttled requests for requests with the first two segments matching, then the next matching request should be queued.
- Requests with n matching initial segments should be queued after 5-n throttled requests. e.g. If a there have been 3 throttled requests for requests with the first two segments matching, then the next matching request should be queued.
14 changes: 14 additions & 0 deletions middleware/SunsetHandler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Sunset Handler

## Objectives

Let application operation teams know that a given operation depends on an API which is slated for removal so they can proactively update the application before a breakage occurs.
Copy link
Contributor

Choose a reason for hiding this comment

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

For more context, would adding that this handler uses the Sunset header only to communicate that a resource is slated for removal. In the RFC, a resource might communicate about sunset policy by using the sunset link but that is not handled in the scope of this handler.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think those are mutually exclusive. From reading the RFC my understanding is that the link can be provided even in a deprecation scenario.
And there's nothing in the RFC that'd allow us to mechanically parse the sunset "type" either. So from a client middleware perspective, I think we need to treat them as equivalent.
Now, you bring a good point, maybe we should also parse the link header and add it to the event attributes when present so admins have a hint to where start looking at. I'll make that addition.

Copy link
Member Author

Choose a reason for hiding this comment

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

(sorry apparently the pr was on auto-merge and when I pushed the resolution of the conflict, it got merged)

Copy link
Contributor

Choose a reason for hiding this comment

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

Parsing the link and adding it as an event is a good idea. So, either header or link.


## Requirements

- MUST provide an option to disable the behaviour for a given request with a settable default for all requests.
- Additional observability requirements in [Observability](../Observability.md)
- MUST create an event under the span (see Observability) whenever an [HTTP sunset header](https://datatracker.ietf.org/doc/html/rfc8594) is encountered in the response.
- The additional event MUST contain the sunset date value provided by the header as an attribute.
- The span and event MUST NOT contain the URI since parent spans already offer that tag/attribute and it could contain sensitive information.
- The additional event MUST contain the sunset link value (see RFC) if present as an attribute.