Skip to content

Change error logs to debug for trigger type parsing #297

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

Merged
merged 1 commit into from
Nov 8, 2022
Merged
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
6 changes: 3 additions & 3 deletions src/trace/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
EventBridgeEvent,
} from "aws-lambda";
import * as eventType from "../utils/event-type-guards";
import { logError } from "../utils";
import { logDebug } from "../utils";
import { gunzipSync } from "zlib";

type LambdaURLEvent = {
Expand Down Expand Up @@ -303,7 +303,7 @@ export function extractTriggerTags(event: any, context: Context) {
try {
eventSourceARN = parseEventSourceARN(eventSource, event, context);
} catch (error) {
logError(`failed to extract ${eventSource} arn from the event`, { error });
logDebug(`failed to extract ${eventSource} arn from the event`, { error });
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, is there any problem with the way we log { error }? From both user reports, I didn't see any error being logged, which is probably the most valuable part of this log.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this is actually super confusing because looking at the code all it seems like we're doing is returning a field in an object and somehow an error is being thrown. I've tried to replicate it here.

}
if (eventSourceARN) {
triggerTags["function_trigger.event_source_arn"] = eventSourceARN;
Expand All @@ -314,7 +314,7 @@ export function extractTriggerTags(event: any, context: Context) {
try {
triggerTags = { ...triggerTags, ...extractHTTPTags(event) };
} catch (error) {
logError(`failed to extract http tags from ${eventSource} event`);
logDebug(`failed to extract http tags from ${eventSource} event`);
}
}
return triggerTags;
Expand Down