-
Notifications
You must be signed in to change notification settings - Fork 589
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
GenerateAccessLogsCommand from '@aws-sdk/client-amplify' dates range #6462
Comments
Hey @teresarg, Thanks for the feedback! I can reproduce this issue - The code I have - import {
AmplifyClient,
GenerateAccessLogsCommand,
} from "@aws-sdk/client-amplify";
const client = new AmplifyClient({ region: "us-west-2" });
const currentTime = new Date();
// Example for getting logs from 10 minutes before.
const endTime = new Date(currentTime.getTime() );
const startTime = new Date(endTime.getTime() - 10 * 60 * 1000);
console.log(reg)
const input = {
// GenerateAccessLogsRequest
startTime: startTime,
endTime: endTime,
domainName: "main.MyDomainName.amplifyapp.com", // required
appId: "/myappID", // required
};
const command = new GenerateAccessLogsCommand(input);
const response = await client.send(command);
const logsResponse = await fetch(response.logUrl || "");
const logs = await logsResponse.text();
console.log(response); I want to include logs generated from 10 min ago to now, and then I got logs that are generated 17 min ago. log I got when running the project at Wed Sep 18 18_30_18 UTC 2024 -
I will bring it up to the team and I will get back to you when I get an update. Thanks! |
Hi Maggie,
It happens repeatedly. I provide you the request id:
x-amz-id-2:
vwDuFzLii9mv0b5oTU+2WnCYY0vMq15ZkbeJb3BpjGUJ5N/Dxk17Cti4/IMygMsbOSD+sCqdQhM=
x-amz-request-id:
C32VRYGDCCYZWWH0
Thanks!
Teresa
El mié, 18 sept 2024 a las 18:57, Maggie Ma ***@***.***>)
escribió:
… Hey @teresarg <https://github.com/teresarg>,
I have forwarded this issue to service team, and they are investigating
this issue. I'd also like to know if this is one time thing or it happens
repeatedly? Could you please provide the request id?
Thanks!
Maggie
—
Reply to this email directly, view it on GitHub
<#6462 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEG5ZVU4UFQU2CTITO3HBHLZXGWI3AVCNFSM6AAAAABOBJJZBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJYHE3TSNJUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks for the response! import ##boto3
import datetime
client = boto3.client('amplify')
client = boto3.client('amplify', region_name='us-west-2')
current_time = datetime.datetime.now()
end_time = current_time
start_time = current_time - datetime.timedelta(minutes=10)
print(current_time)
response = client.generate_access_logs(
startTime= start_time,
endTime = end_time,
domainName = 'main.myDomainName.amplifyapp.com', # required
appId = 'myAppId'
)
print(response["logUrl"]) The time method was called is UTC 2024-09-19 15:54:23.221632
I can confirm that this issue is generated from service team, I will create a ticket to the service team and post the update here. Thanks! |
Internal Ref: V1522271556 |
great, thanks Maggie 🙂
El jue, 19 sept 2024 a las 18:09, Maggie Ma ***@***.***>)
escribió:
… Internal Ref: V1522271556
—
Reply to this email directly, view it on GitHub
<#6462 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEG5ZVR2E23HTJELDHAGHGLZXLZK7AVCNFSM6AAAAABOBJJZBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRRGQZTOMRQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hey @teresarg , I just got updates from service team that this is a known limitation of this API. There are internal limitation that makes the API aggregate more time range than provided. But an important note is that the API will not omit logs, it will only add unneeded logs outside the time range. This is not a good user experience and this is on our radar, but we don't have an ETA that can be shared. Thanks! |
Checkboxes for prior research
Describe the bug
I am using
GenerateAccessLogsCommand
to get the access logs from my amplify app for a specific time.When calling GenerateAccessLogsCommand, if, for example, I send as start date: 2024-09-11T14:12:21.237Z and as end date: 2024-09-11T15:12:21.237Z, I get some logs out of this range of dates. In this case, I am getting logs from 14:22 until 15:39.
This looks a bit random, cause sometimes I also miss some logs from the date ranges, and other times I get logs previous to the dates range I send.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v16.20.2
Reproduction Steps
Observed Behavior
Getting logs out of the range
Expected Behavior
Get all logs includes in the range of dates I send to GenerateAccessLogsCommand
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: