Skip to content

Conversation

@therealvio
Copy link

@therealvio therealvio commented Jan 16, 2025

Purpose 🎯

This change adds a configuration option for users to expose successful connection logs. This is controlled via an environment variable that, when set to true, will produce the successful connection log as an info level message, rather than a debug level message.

Exposing these logs can be useful for calculating SLIs. SLIs are the quotient of errors over valid requests, therefore all valid messages need to be surfaced to perform an accurate calculation of the metric.

Context 🧠

Note

#122 should be finalised, and merged before this PR comes in since it is based off of the changes it includes.

This changes removes the addition of the eventPayload key that was
imposed in the previous commit. I would rather leave the decision to the
maintainers.

Whether it be reverting *this* commit, or accepting this one, or leaving
it to the future PR.
This change adds a configuration option for users to expose successful
connection logs. This is controlled via an environment variable that,
when set to true, will produce the successful connection log as an
`info` level message, rather than a `debug` level message.

Exposing these logs can be useful for calculating SLIs. SLIs are the
quotient of errors over valid requests, therefore all valid messages
need to be surfaced to perform an accurate calculation of the metric.
: replace(upper(obj.az), "-", "_") => join(",", obj.route_table_ids)
}
has_ipv6_env_var = { "HAS_IPV6" = var.lambda_has_ipv6 }
log_successful_connections_env_var = { "LOG_SUCCESSFUL_CONNECTIONS" = var.log_successful_connections }
Copy link
Author

Choose a reason for hiding this comment

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

I am not incredibly versed in base Terraform, being a CDKTF user myself. I am looking to make sure I am adding this variable right. Any and all feedback on how to achieve this is welcome!

@therealvio therealvio marked this pull request as ready for review January 16, 2025 05:03
@therealvio therealvio requested a review from a team as a code owner January 16, 2025 05:03
@therealvio therealvio changed the title feat: use structured logging with structlog feat: opt-in to expose successful connection logs Jan 16, 2025
@bwhaley
Copy link
Collaborator

bwhaley commented Jan 21, 2025

Thank you for the PR! I am a bit busy atm, but I hope to review & discuss in the coming days. Appreciate the patience!

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.

2 participants