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

Update GetModuleLogs method when tail + since + until options are provided #4987

Merged

Conversation

yophilav
Copy link
Contributor

Cherry-picked: 2b650a8

TL;DR - This PR chances the behavior of GetModuleLogs method to better facilitate the portal experience.

Previous, when the GetModuleLogs is triggered from the azure portal with tail + since + until, all the 3 options are passed to Docker API management to fetch the log. The Docker API does the following:

  1. Fetch the log of the module
  2. Apply tail to the log
  3. Apply the since and until to the log
    This results in an empty log most of the time which is not a desirable behavior.

This PR changes the GetModuleLogs when the tail + since + until are specified together by doing the following:

  1. Fetch Docker API with since + until log option
  2. tail the returning log using LogProcessor (post-Akka).
    This allows a customer to get a tail of log within a given time frame.

Note: This PR doesn't change the behavior of any other option combinations (i.e. tail + since, tail, since, etc). These combination are still managed by Docker API.

Note2: I set RequestHandle timeout to be 30s instead of 600s by default

… provided. (Azure#4922)

TL;DR - This PR chances the behavior of `GetModuleLogs` method to better facilitate the portal experience. 

Previous, when the `GetModuleLogs` is triggered from the azure portal with `tail + since + until`, all the 3 options are passed to Docker API management to fetch the log. The Docker API does the following: 
1. Fetch the log of the module
2. Apply `tail` to the log
3. Apply the `since` and `until` to the log
This results in an empty log most of the time which is not a desirable behavior. 

This PR changes the `GetModuleLogs` when the `tail + since + until` are specified together by doing the following:
1. Fetch Docker API with `since + until` log option
2. `tail` the returning log using LogProcessor (post-Akka).
This allows a customer to get a tail of log within a given time frame. 

Note: This PR doesn't change the behavior of any other option combinations (i.e. `tail + since`, `tail`, `since`, etc). These combination are still managed by Docker API.

Note2: I set RequestHandle timeout to be 30s instead of 600s by default
Copy link
Contributor

@dylanbronson dylanbronson left a comment

Choose a reason for hiding this comment

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

cherry pick lgtm

@kodiakhq kodiakhq bot merged commit c1dba55 into Azure:release/1.1 May 14, 2021
darobs pushed a commit to darobs/iotedge that referenced this pull request May 26, 2021
… provided (Azure#4987)

Cherry-picked: Azure@2b650a8

TL;DR - This PR chances the behavior of `GetModuleLogs` method to better facilitate the portal experience. 

Previous, when the `GetModuleLogs` is triggered from the azure portal with `tail + since + until`, all the 3 options are passed to Docker API management to fetch the log. The Docker API does the following: 
1. Fetch the log of the module
2. Apply `tail` to the log
3. Apply the `since` and `until` to the log
This results in an empty log most of the time which is not a desirable behavior. 

This PR changes the `GetModuleLogs` when the `tail + since + until` are specified together by doing the following:
1. Fetch Docker API with `since + until` log option
2. `tail` the returning log using LogProcessor (post-Akka).
This allows a customer to get a tail of log within a given time frame. 

Note: This PR doesn't change the behavior of any other option combinations (i.e. `tail + since`, `tail`, `since`, etc). These combination are still managed by Docker API.

Note2: I set RequestHandle timeout to be 30s instead of 600s by default
darobs added a commit that referenced this pull request May 26, 2021
* Update the KeyVault for Test pipelines (#4937)

* Metrics Collector: Remove test-specific additional tags logic (#4950)

* Metrics Collector: Add gzip compression in the iot message scenario (#4955)

* E2E: Metrics Collector Smoke Test (#4945)

* Metrics Collector: Cleanup startup logging (#4953)

* Metrics Collector: Update product info and message id (#4962)

* Metrics Collector: Rename HubResourceId -> ResourceId (#4956)

* Adds SharedAccessSignature to repo with fix for vulnerability (#4943) (#4967)

* Metrics Collector: Release and publish pipelines (#4969)

* Close AMQP connection explicitly when no more links (removing links kept tcp level connection) (#4984)

* Update `GetModuleLogs` method when `tail + since + until` options are provided (#4987)

* Introduce `Timestamps` Option via mgmt.sock  (#4988)

* Cherry-pick to Release/1.1: Fix edgehub queue len metric (#4952) (#4990)

* Update Base Images for Security Patch (#4994)

* Update v1.1 YAML pipelines to 1ES-hosted agents (#4844)

* Fix potential instability in iotedged after UploadSupportBundle fails (#4942)

* Rename end-to-end test log artifacts (#5006)

* Merge Prometheus parser fix. (#5007)

* Prepare for Release 1.1.3 (#5008)

* Fixing diagnostics image for 1.1 (#5018)

* Prepare for Release1.1.3 (part 2) (#5020)

* Remove PII from log. (#5022)

Co-authored-by: yophilav <54859653+yophilav@users.noreply.github.com>
Co-authored-by: Andrew Smith <als5ev@virginia.edu>
Co-authored-by: Robert T Jang <robbaldwin95@gmail.com>
Co-authored-by: vipeller <51135538+vipeller@users.noreply.github.com>
Co-authored-by: Damon Barry <damonbarry@users.noreply.github.com>
Co-authored-by: Pedro Marcelo Zara <pmzara@hotmail.com>
Co-authored-by: dylanbronson <55515325+dylanbronson@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants